|
Forum Index : Microcontroller and PC projects : PC emulator for Micropython on the Pico Computer 3
| Page 1 of 2 |
|||||
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
A full function emulator is now available for Micropython on the Pico Computer 3 https://github.com/UKTailwind/micropython/releases/latest This is a Linux application but full details are included for installing it to run under WSL on a windows computer. The emulator has exactly the same functionality as the real thing including video modes and audio other than the ability to physically control pins. However, if you "import Pins" in a program you will get a I/O panel so you can even test the basic I/O. |
||||
| dddns Guru Joined: 20/09/2024 Location: GermanyPosts: 874 |
I downloaded pc3emu-linux-x64.tar.gz and extracted it to my home folder. Then: ./pc3emu /home/dietmar/pc3emu-linux-x64/pc3emu-bin: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.43' not found (required by /home/dietmar/pc3emu-linux-x64/pc3emu-bin) /home/dietmar/pc3emu-linux-x64/pc3emu-bin: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by /home/dietmar/pc3emu-linux-x64/pc3emu-bin) /home/dietmar/pc3emu-linux-x64/pc3emu-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.42' not found (required by /home/dietmar/pc3emu-linux-x64/pc3emu-bin) So I downloaded the source and tried to compile but it can't find ../../lib/ulab/code/micropython.mk: make -C ports/unix VARIANT=pc3 -j8 make: Verzeichnis „/home/dietmar/Downloads/micropython-0.9/ports/unix“ wird betreten Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity. Including User C Module from ../../ports/rp2/boards/PICO_COMPUTER_3/emulator/src ../../ports/rp2/boards/PICO_COMPUTER_3/emulator/src/micropython.mk:48: ../../lib/ulab/code/micropython.mk: Datei oder Verzeichnis nicht gefunden make: *** Keine Regel, um „../../lib/ulab/code/micropython.mk“ zu erstellen. Schluss. make: Verzeichnis „/home/dietmar/Downloads/micropython-0.9/ports/unix“ wird verlassen I'm using Ubuntu 22.04 Regards |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
This is why I despise Linux... I've made some updates so you should now be able to follow the release-notes recipe verbatim — git clone --branch pico-computer-3, then make -C mpy-cross, make -C ports/unix VARIANT=pc3 submodules, make -C ports/unix VARIANT=pc3 The pre-built version assumes glibc 2.43 / Ubuntu 26.04 |
||||
| LeoNicolas Guru Joined: 07/10/2020 Location: CanadaPosts: 595 |
Peter Thank you very much for this emulator. It is easiest to work from the PC when developing complex programs. Today I will try it on my Fedora |
||||
| dddns Guru Joined: 20/09/2024 Location: GermanyPosts: 874 |
Thank you very much—it worked exactly as described! Regards and best success |
||||
| llovhaug Newbie Joined: 07/07/2026 Location: United StatesPosts: 6 |
So would it be possible to create such an emulator (i.e. Pico Computer 3) with MMBASIC at its core rather than MicroPython? |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352 |
I'm wondering why all of GLIBC_2.43, GLIBC_2.38 and GLIBC_2.42 are being explicitly wanted? Won't just any reasonably recent glibc be fine? The missing micropython.mk doesn't look like Linux is at fault. John Edited 2026-07-18 22:39 by JohnS |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
It just wants 2.43 but I assume the errors identify for each missing bit of functionality or changed api the version in which that function became available |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352 |
Maybe you don't have that installed or it's not being found. John |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
The instructions on the github are now correct and work for building under linux - tested |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352 |
In case you have files a bit like my system (not ubuntu, so...), I think this tells me all the GLIBC variants there's a chance to link for: nm /lib/libc.so.6 | grep ' A ' | grep GLIBC | sort The sort etc aren't actually needed but make the output a bit clearer. I had to dig that off the net as I've not hit this problem. John Edited 2026-07-18 23:08 by JohnS |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8964 |
I understood marginally less than none at all of that. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4352 |
Fair enough. nm gets all the names (symbols) from the file(s) the grep selects those with just A (space each side), which are absolute symbols i.e. won't need moving around by the linker the grep GLIBC then extracts from those the ones with GLIBC in their name the sort just makes their order easier on the human eye Hopefully those help with Peter's original problem. Overall it looks like his build needed at least GLIBC version 2.43 which probably wasn't installed or may have not been where the linker/toolchain could find it. I don't see any of this as a problem with Linux but Linux-haters might. (I don't tend to write code which requires specific GLIBC versions (let alone very recent ones) but it may well not have been Peter's code.) When forced to use Windows I used to complain about "DLL hell"... John Edited 2026-07-19 02:00 by JohnS |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 8964 |
Thanks. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
I haven't got a problem. I just installed WSL on windows and got a working environment. dddns had a problem because he was using an older version of Ubuntu and an older version of GLibC so the supplied binary wouldn't run. + the tar I had posted on the release didn't contain all the modules needed so I had to specify a different way of doing the build. On the glibc issue the C source for the functions used and the actual machine-level interface are unchanged between the versions. What happened is glibc's symbol versioning: when glibc revises a function's ABI contract it publishes the same function under a new version tag, and the linker on a new system always binds your call to the newest tag available. The math functions were re-tagged in 2.38/2.43 as part of the C23 conformance work, and the cf*speed family was re-tagged in 2.42 when glibc reworked termios to support arbitrary baud rates (a new speed_t representation). Our code neither knows nor cares — but the binary now names those tags, and Ubuntu 22.04's loader has never heard of them, so it refuses at startup before a single instruction runs. This is precisely why I gave up on the Raspberry Pi port of MMbasic. Every operating system or module update f..ks everything up so nothing runs. The Linux concept seems to be that anything that isn't supported by the particular distro needs to be compiled from source. This is why it will never overtake Windows as an "open" desktop system and why Apple will never be open. |
||||
| dddns Guru Joined: 20/09/2024 Location: GermanyPosts: 874 |
My problem took just 20 minutes to be solved and I think Linux is great! :) I just tried to run the binary compiled with 22.04 and packed with make-dist.sh on a 24.04 live-session. This just works and I think GLibC is downward compatible. |
||||
| toml_12953 Guru Joined: 13/02/2015 Location: United StatesPosts: 685 |
The description says, "...and runs the book's programs unmodified" What book is that? Does it come with an SD card? |
||||
| okwatts Regular Member Joined: 27/09/2022 Location: CanadaPosts: 76 |
I tried the setup under Mint21.3 Cinammon and got it to build following the instructions but upon starting got the banner, >>> prompt, a window flashed open and then seg faulted. I will try either the Windows install or taking a run at a straight Ubuntu setup to see if either can run successfuly. Much appreciate the effort and I am amazed at what Peter( and Claude) have accomplished. Fortunately the last revision of the HDMIUSBI2S board allows me to play although without RM2 or SD card. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11636 |
Try this and report finding seach test is one line, and the results will help pin it down: 1. Software renderer (most likely fix): SDL_RENDER_DRIVER=software ~/micropython/ports/rp2/boards/PICO_COMPUTER_3/emulator/pc3emu 2. If still crashing — rule out audio: SDL_AUDIODRIVER=dummy ~/micropython/ports/rp2/boards/PICO_COMPUTER_3/emulator/pc3emu 3. If still crashing — a real backtrace (they built from source, so symbols are meaningful): sudo apt install gdb cd ~/micropython/ports/unix gdb -ex run -ex bt --args ./build-pc3/micropython -X heapsize=8m -i -c "import emuboot" |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6546 |
If you are running Oracle Virtualbox, turning on Hyper V is likely to cause grief. There are ways to run both systems but for now, I will look at installing the code on my virtualbox Linux instead. That might solve my other issue: ![]() I am unable to get anything other than the minimised view The console functions OK but no display. Jim VK7JH MMedit |
||||
| Page 1 of 2 |
|||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |