Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:08 07 Nov 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite - integrated compact C-compiler / C-runtime

     Page 4 of 4    
Author Message
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 264
Posted: 11:56am 05 Nov 2026
Copy link to clipboard 
Print this post

I think, this will be an interesting possibility:

https://www.thebackshed.com/forum/ViewTopic.php?TID=19209&P=1#260985

"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"
https://github.com/DnCraptor/pico-mm/blob/tcc/Bas/pm_library_csub_tcc.bas
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 661
Posted: 02:19pm 05 Nov 2026
Copy link to clipboard 
Print this post

Please help a C beginner ... what's wrong here?

>
> list "x.c
#include <stdio.h>
int main(int argc, char **argv)
{
   printf("Hello from C, argc=%d\n", argc);
   For (int i = 1; i < argc; i++)
       printf("  argv[%d] = %s\n", i, argv[i]);
   Return 0;
}
>
>
> run "x.c
x.c:6: warning: implicit declaration of function 'For'
x.c:6: error: identifier expected
Error : C compilation failed
>

Tnx,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
MikeV73
Newbie

Joined: 03/07/2025
Location: Ukraine
Posts: 39
Posted: 02:24pm 05 Nov 2026
Copy link to clipboard 
Print this post

  ville56 said  Please help a C beginner ... what's wrong here?

>
> list "x.c
#include <stdio.h>
int main(int argc, char **argv)
{
   printf("Hello from C, argc=%d\n", argc);
   For (int i = 1; i < argc; i++)
       printf("  argv[%d] = %s\n", i, argv[i]);
   Return 0;
}
>
>
> run "x.c
x.c:6: warning: implicit declaration of function 'For'
x.c:6: error: identifier expected
Error : C compilation failed
>

Tnx,
Gerald


capitalisation. C is case secisitive lang.
it should be "for", not "For", and "return", not "Return"
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 661
Posted: 02:31pm 05 Nov 2026
Copy link to clipboard 
Print this post

ouch ... thank you.

Had a C/C++ course 30 years ago. Used it only once in 1999 to get a DCF77 NTP server Y2k ready which the vendor refused to do saying it was impossible. Was rather trivial then. But now all memories of C have faded away.
                                                                 
73 de OE1HGA, Gerald
 
MikeV73
Newbie

Joined: 03/07/2025
Location: Ukraine
Posts: 39
Posted: 04:02pm 05 Nov 2026
Copy link to clipboard 
Print this post

UPD:
+ RC3: https://github.com/DnCraptor/pico-mm/releases/tag/PicoMite-V7.0.00b8-tcc-elf-RC3

What's new since RC2

1. Resident keyboard remapping
- New C API for remapping physical keyboard input (PS/2 and USB).
- Key press, release, repeat and modifier events.
- Callbacks remain active across BASIC RUN and END.
- New printable-character classification hook for console, EDIT and FM.

2. Russian keyboard support (KeyRus)
- Resident EN/RU keyboard remapper using Windows-1251.
- Ctrl+Shift switches between layouts.
- Includes an 8x16 Cyrillic font (#10).
- Works on RP2350 (TinyCC) and RP2040 (precompiled ELF).
- Includes install, start and stop scripts.
- Supports automatic startup with OPTION AUTORUN ON.

Source: KeyRus files and examples

3. C syntax highlighting in EDIT
- Syntax colours for .c and .h files.
- Keywords, directives, comments, strings and numbers.
- Recognises native PicoMite C API functions.
- Different colours for functions unavailable or restricted in CSUB.
- Works on the local display and ANSI terminals.

4. Console font API
- Added pm_set_console_font() for resident-controlled console fonts.
- Custom fonts can be used in the console and EDIT.
- Fixed lost FM colours when using custom fonts in video mode 1.

Bug fixes

- OPTION LOGGING no longer writes extra bytes or garbage after error messages (#139).
- MM.INFO(USB VID/PID n) now returns 0 for unused channels (#142).
- PLAY TONE and PLAY SOUND now play at the correct speed and pitch after WAV/MOD playback or a USB connection sound (#145).
- Fixed Python detection when embedding TinyCC headers during RP2350 builds.

Native C API

Updated to API v35, adding keyboard remapping, printable-character classification and console font control.

KeyRus quick start

Copy the KeyRus files to the PicoMite filesystem, then run:


RUN "key_rus_install.bas"


To stop:

RUN "key_rus_stop.bas"


To enable automatic startup, load key_rus_start.bas into the program memory and use:

OPTION AUTORUN ON


Changes since RC2

Full comparison: RC2 to RC3

RC3 source commit: 67a9e5477
Edited 2026-11-06 02:06 by MikeV73
 
MikeV73
Newbie

Joined: 03/07/2025
Location: Ukraine
Posts: 39
Posted: 04:07pm 05 Nov 2026
Copy link to clipboard 
Print this post

Actually, any language may be provided, and russian with cp1251 - just techno demo.
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 2143
Posted: 04:14pm 05 Nov 2026
Copy link to clipboard 
Print this post

  ville56 said  ouch ... thank you.

Had a C/C++ course 30 years ago. Used it only once in 1999 to get a DCF77 NTP server Y2k ready which the vendor refused to do saying it was impossible. Was rather trivial then. But now all memories of C have faded away.


I just take MMBasic code and have Gemini translate to C  

I also set:

  Quote  >OPTION CASE LOWER
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 661
Posted: 04:39pm 05 Nov 2026
Copy link to clipboard 
Print this post

nah, want to write my own C code in the first place. AI may come later after I have understood C a bit more.
But tnx for the hint with option case lower.
                                                                 
73 de OE1HGA, Gerald
 
ville56
Guru

Joined: 08/06/2022
Location: Austria
Posts: 661
Posted: 08:36pm 06 Nov 2026
Copy link to clipboard 
Print this post

MikeV73,

I think there is some instability in FM in your latest build. FM crashes when selecting and deleting files, sometimes just when navigating.

Example:

        208 x.c                       |         207 x.cmd                      
        208 x.c.bak                   |         202 x.cmd.bak                  
        207 x.cmd                     |          67 y.cmd                      
        202 x.cmd.bak                 |          67 y.cmd.bak                  
         67 y.cmd                     |          66 z.cmd                      
         67 y.cmd.bak                 |                                        
         66 z.cmd                     |*** FAULT PC=100069FC LR=100069D5 SP=200808E0 CFSR=00008200 HFSR=40000000
*** FAULT R0=01000000 R1=00000000 R2=0000000C R3=40828000 R12=00000180 XPSR=09100000 FAR=40828230 EXC=FFFFFFE9
Total of 5 Mbytes PSRAM available

In the example above, there were A: and B: drive used. The same FM operations with the latest MMBasic version from Peter has no issues insofar.

Environment:
PicoMitePC3 MMBasic USB RP2350B Edition V7.00.00RC7
OPTION SERIAL CONSOLE COM2,GP8,GP9
OPTION SYSTEM I2C GP20,GP21
OPTION FLASH SIZE 16777216
OPTION COLOURCODE ON
OPTION CASE LOWER
OPTION KEYBOARD GR
OPTION HEARTBEAT OFF
OPTION PICO OFF
OPTION RESOLUTION 1280x720 @ 372000KHz
OPTION DISPLAY 30, 80
OPTION HDMI PINS  1, 3, 5, 7
OPTION WIFI JN88fg, *********, PC3-2
OPTION SDCARD GP33, GP30, GP31, GP28
OPTION AUDIO I2S GP10,GP22', ON PWM CHANNEL 11
OPTION RTC AUTO ENABLE
OPTION COUNT GP34,GP35,GP36,GP37
OPTION COMPILE ON
OPTION PLATFORM PICO COMPUTER 3
OPTION DEFAULT FONT 3, 1
OPTION PSRAM PIN GP47

Gerald
                                                                 
73 de OE1HGA, Gerald
 
MikeV73
Newbie

Joined: 03/07/2025
Location: Ukraine
Posts: 39
Posted: 11:26pm 06 Nov 2026
Copy link to clipboard 
Print this post

  ville56 said  MikeV73,

I think there is some instability in FM in your latest build. FM crashes when selecting and deleting files, sometimes just when navigating.

...
Gerald


Thanks, Gerald, for the detailed report!

The fault information is very useful. Could you please clarify a few things?

1. Which exact UF2 build are you testing? A filename or download link would help.
2. Does FM crash on A: only, B: only, or both? Does it happen while navigating, selecting a file, or confirming deletion?
3. Can you reproduce it reliably, or does it happen randomly?
4. Does it still happen with `OPTION COMPILE OFF` after reboot?
5. If possible, could you also try a lower CPU speed (252 or 315 MHz) and see whether the crashes persist?

The fault points to an invalid memory access. I will also check PC `0x100069FC` against the matching ELF/map file.

Thanks again for testing!
 
     Page 4 of 4    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026