|
Forum Index : Microcontroller and PC projects : PicoMite - integrated compact C-compiler / C-runtime
| Author | Message | ||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
Fork and branch with working copy: https://github.com/DnCraptor/pico-mm/tree/tcc Initial documentation: https://github.com/DnCraptor/pico-mm/blob/tcc/docs/PicoMite-native-C-support.md Changes: + TinyCC 0.9.27 with a Thumb-2 back end (RP2350 only); + C-runtime (2040/2350); + documentation: PicoMite-native-C-support.md; + several simple examples in "C" folder; + murmulator 2.0 board support in the configuration; + native elf-files execution; + PIO IDLE MMBasic command. Several examples: https://github.com/DnCraptor/pico-mm/tree/tcc/C Related .uf2 builds are publishing there: https://t.me/ZX_MURMULATOR/251133 Edited 2026-11-02 00:25 by MikeV73 |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 2126 |
Great work I think my head is about to explode. I haven't caught up with Pete's latest developments yet. |
||||
| hhtg1968 Senior Member Joined: 25/05/2023 Location: GermanyPosts: 278 |
I have to echo that. |
||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
Small update: + LIBRARY C/ELF CSUB support; + LIBRARY ELF-residents (with PIO/GPIO/DMA claim support); (the same fork/branch) |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1164 |
I don't really understand what this is all about. Can I use this to write C programs on an RP2350 and then run them on a PicoMite? Or does the compiler already run on a PicoMite, and is BASIC being extended to include C? Could you maybe describe the entire process of how to use this??? Frank |
||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
Here are some practical use cases for the pico-mm / tcc branch: 1. Run C programs directly (RP2350 only). Copy a .c file to the SD card and type RUN "maze3.c". PicoMite compiles and runs it automatically. No PC compiler is needed. Example: maze3.c 2. Compile once, run many times (2040/2350). Use TCC "-o game.elf game.c" to build an ELF file. Later, just use RUN "game.elf". You can also build programs from multiple C source files. 3. Run C programs compiled on a PC. Both RP2040 and RP2350 can load suitable ARM ELF object files, even without TinyCC installed in the firmware. Example: ELF loader 4. Use C functions inside BASIC (RP2350 only). Write a CSUB in C instead of manually creating hexadecimal machine code. PicoMite compiles it when saving the BASIC program. The CSUB then runs directly from flash. Example: C CSUB 5. Mix BASIC and C. C programs can read and change BASIC variables and arrays, execute BASIC commands, and call BASIC SUBs and FUNCTIONs. Variables example | BASIC function example 6. Write graphics and games in C (RP2350 only). Use PicoMite graphics, sprites, framebuffers, keyboard, mouse, GUI controls and sound through the C API. Animation | GUI | Sound 7. Control hardware from C. Access GPIO, UART, I2C, SPI, ADC and PWM using PicoMite's existing hardware support. UART | I2C | PWM 8. Use PIO, DMA and hardware events. Control PIO state machines, transfer data with DMA, and receive GPIO or gamepad events in C. PIO/DMA | Gamepad 9. Create resident C services. Install a C service in the flash LIBRARY. It can continue working after BASIC END or another RUN, keeping its state and reserved GPIO, PIO or DMA resources. Similar in purpose to a DOS TSR, but with a controlled API. Resident timer | Resident DMA 10. Work with files using standard C functions. Use fopen, fread, fwrite, fprintf, directory listing and other familiar C functions on PicoMite's filesystem. Example: files.c Important: The built-in TinyCC compiler works on RP2350 only, and PSRAM is strongly recommended. Precompiled ELF code can run on both RP2040 and RP2350. Hardware features depend on the firmware build. This is still a development branch, not a finished release. Full documentation: Native C support in PicoMite Edited 2026-11-02 21:19 by MikeV73 |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 9286 |
C makes me shudder. lol No offence, Mike, this is very clever stuff, but if I wanted it I'd connect the Pico to the Arduino system and use C++, not Tiny C. Give me MMBasic any day. :) My poor old brain has enough problems in using that. (Goes back to the comforting world of laying out PCB traces manually - never trust the autorouter!) Mick Zilog Inside! nascom.info for Nascom & Gemini |
||||
| Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 1164 |
@MikeV73: Thank you very much for your explanation! But the RP2350 doesn't come with an editor, does it? The site isn't working for me... Frank |
||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
It is part of solution. You can build your code on PC, than just use compiled .elf-file as well as .c-file, or .bas-file |
||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
Build in EDIT command is there. Also, F2-RUN is working for C-sources. |
||||
| MikeV73 Newbie Joined: 03/07/2025 Location: UkrainePosts: 15 |
Build for what hardware you prefer? Current list: PICO PICOUSB PICOMIN VGA M2P1VGA VGAUSB WEB PICORP2350 PICOUSBRP2350 VGARP2350 VGAUSBRP2350 WEBRP2350 HDMI M2P2HDMI HDMIUSB PICOBTRP2350 PICOBTHRP2350 HDMIBTH HDMIWEB PC3 But actually tested by me for now: M2P1VGA (2040) and M2P2HDMI (2350) |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |