|
Forum Index : Microcontroller and PC projects : PicoMite Firware V8.00.00b4 onwards: MMbasic multi-tasking
| Author | Message | ||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
PicoMite V8.00.00b4: the fourth beta of V8 Beta 4 brings threads to every PicoMite build: SUBs that run alongside the main program, each with its own loops, local variables and PAUSEs, with the same commands as the Colour Maximite 2. It also changes how listings behave inside a program and fixes the RTC, WEB TRANSMIT FILE, a TLS connection that the server closed, LIBRARY LOAD and empty RAM and flash slots. This is a beta for testing: V7.00.00 stays the current release. The firmware for all 18 builds, the manuals, the release notes and the apps are on GitHub: https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V8.00.00b4 Every build resets at its first boot of b4: every build's flash region has moved up 16 KB to make room for threads. Save your options first with OPTION DISK SAVE "B:/myoptions.txt" and load them again afterwards with OPTION DISK LOAD "B:/myoptions.txt". The flash slots and program memory are cleared, and on a board with 2 or 4 MB of flash the A: drive too. A PicoComputer 3 keeps its A: drive, and so does the PicoMiteRP2040MIN, whose program memory is 4 KB smaller instead (108 KB). Programs saved by b3 do not need loading again. Threads A thread is an ordinary SUB started with THREAD START. It runs for as long as it likes while the main program carries on, and the firmware shares the processor between them a millisecond at a time: Dim Integer beats Sub Heart Do Inc beats Pause 500 ' the rest of the program runs meanwhile Loop End Sub Thread Start 1, Heart Do Print "Beats: "; beats Pause 1000 Loop Until Inkey$ <> "" End ' the threads stop with the program Threads suit work that goes on by itself: a clock in the corner of the screen, a tune played note by note, a sensor read every second, a game's aliens each moving on its own, a long calculation while the screen stays alive, a network request while the user types. • Up to eight threads, numbered 1 to 8. THREAD EXIT, STOP, YIELD, PAUSE, RESUME, SLICE, PRIORITY and SIZE manage them, THREAD LIST shows where each one is and how much stack it has used, and MM.INFO(THREAD) reports on them. • A thread that waits uses no processor time. PAUSE, INPUT, SYNC, TEMPR(, the frame waits on the VGA and HDMI builds, and the network's and Bluetooth's commands all let the other threads run, so a program can sit in INPUT while its threads keep the screen moving. • Sharing safely. Sixteen locks (THREAD LOCK and UNLOCK, a mutex), THREAD HOLD and RELEASE for a few statements that must not be split, and THREAD WAIT for a thread to end or a FLAG( to be set. An interrupt runs in the thread that set it up. • The same commands as the Colour Maximite 2, so a program's threads work the same on both, within the PicoMite's limits: eight threads, and an 8 KB stack each by default. A thread of the defaults takes about 10.5 KB of the heap, and a program that starts no thread runs as fast as before. • An error in any thread stops the whole program and shows where it was, as [#3:40] (thread 3, line 40) before the statement. The User Manual has the commands in its Commands listing and an overview in its new Appendix N. The new MMBasic Threads User Manual (MMBasic_Threads_User_Manual.pdf, in the supplementary manuals zip) covers threads in detail, with worked programs, for the Colour Maximite 2 and the PicoMite together; notes beginning PicoMite give the PicoMite's differences. How many threads, realistically Each thread has its own stack, 8 KB unless SIZE says otherwise, and a record, so a thread of the defaults takes about 10.5 KB of the heap (measured on a PicoComputer 3; a little less on the RP2040). Each also reserves local variable slots for its LOCAL variables and SUB parameters: 24 on the RP2350 and 16 on the RP2040. Memory and those slots are the two limits, besides the eight threads. All the threads share one processor core, so threads give a program structure, not speed. They suit work that spends most of its time waiting (in PAUSE, INPUT or the network); eight threads that all calculate flat out each get a ninth of the processor. • PicoMiteVGA (RP2040): 118 KB of heap at the prompt, shared with the program's variables, arrays and strings, and with any FRAMEBUFFER or LAYER it creates. Eight threads of the defaults take about 80 KB, so they fit beside a small program. With a few arrays, four to six is realistic, and SIZE 6 LOCALS 8 NEST 4 makes a thread of under 8 KB for a simple loop. The default stack allows about two FUNCTION calls inside each other (SUB calls cost almost nothing), so keep deep or recursive work in the main program, or give that thread a larger SIZE. Local slots are no problem: eight default threads take 128 of the 240. Good uses are a clock on the screen, a sensor read every second, a tune played note by note, a few moving sprites, or a display that keeps moving while the program waits for keys. • PicoMite (RP2350): over 300 KB of heap, so memory is no limit. All eight threads fit with plenty to spare, and a thread doing deep work can have a much larger stack: SIZE 32 allows about twenty FUNCTION calls inside each other. The limit here is the local slots. The region has 192, and each default thread reserves 24, so seven default threads leave the main program 24 for its own SUBs. For eight, start them with LOCALS 16, or put OPTION LOCAL VARIABLES 256 at the top of the program (512 global variables remain). • PicoMitePC3: 104 KB of SRAM for the threads, since a thread's stack and record are always in SRAM (the PSRAM cannot be read while the flash is written). Eight threads of the defaults take about 84 KB of it. A program's large arrays (over 52 KB) go straight to the 8 MB PSRAM, but its smaller variables and strings fill the SRAM first, so start the threads early in the program. The local region has 256 slots here, so eight default threads leave the main program 64. With OPTION COMPILE ON a FUNCTION call takes half the stack, about six levels in the default 8 KB. A thread can own the network or Bluetooth, so a web request, an NTP update or an MQTT client can run in a thread while the screen and keyboard stay with the main program. Try it demo_input.bas runs four bouncing balls and a clock as five threads, and they keep going while the main program waits in INPUT for you to type a line. It needs an RP2350 with a VGA or HDMI build (it uses MODE 3). Type Q to quit. https://github.com/UKTailwind/PicoMite/blob/PicoMite-V8.00.00b4/Bas/threads/demo_input.bas What else has changed • Listings in a program. A listing that stops with PRESS ANY KEY at every screen full now belongs to the command prompt: in a running program LIST, LIST file$, FLASH LIST n, RAM LIST n, LIBRARY LIST, LIST VARIABLES, LIST COMMANDS, LIST FUNCTIONS and LIST PINS give "Invalid in a program". Each has an ALL form that lists without stopping, and LIST VARIABLES, LIST COMMANDS, LIST FUNCTIONS and LIST PINS get theirs new in this beta. At the command prompt everything pages as before. • The MMBasic heap is 4 KB smaller on the PicoMiteRP2350USB, PicoMiteHDMI, PicoMiteHDMIUSB, PicoMiteHDMIWEB and PicoMitePC3, to leave the processor's stack the room it needs. The largest program is unchanged. What is fixed • The RTC (#164): an RTC whose backup battery has failed restarts in 2000, and with OPTION RTC AUTO ENABLE that time was taken at every boot and every day, over a good time from WEB NTP. A lost time is no longer taken: the boot says "RTC time not set". • WEB TRANSMIT FILE (#165) sent a large file at about half a second a chunk; it now goes as fast as the connection takes it. • A TLS connection that the server closed before sending anything (#166) left freed memory in use, and the next close could crash the board. A request on it now gives "No connection". • LIBRARY LOAD as a program's first statement emptied MM.CMDLINE$, and in a program started by CHAIN it wiped the variables the chain had kept (it is now an error there). • RAM RUN, RAM CHAIN, FLASH RUN, FLASH CHAIN and FLASH LIST n of an empty slot left the empty slot as the program in memory. The program you had loaded now stays. • LOAD PNG uses 5.4 KB less stack. This beta has been tested on the PicoComputer 3, where all 40 thread tests pass, with and without OPTION COMPILE ON, and on the PicoMiteRP2040MIN, PicoMiteRP2040VGA, PicoMiteRP2040USB and PicoMiteRP2040VGAUSB builds. The other builds compile cleanly, so reports from other boards are welcome. |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 694 |
Great job Peter, incredible what you have implemented. Thank you. Minor finding: EXECUTE "files" in a thread seems to corrupt the system with *** FAULT PC=00000000 LR=2002F000 SP=2002CB98 CFSR=00020000 HFSR=40000000 *** FAULT R0=20014F00 R1=00000000 R2=2002F000 R3=2002F000 R12=00000000 XPSR=68100000 FAR=FFFFFFFF EXC=FFFFFFED Other commands like 'EXECUTE "list pins all"' are rejected as described. Environment: PicoMitePC3 MMBasic USB RP2350B Edition V8.00.00b4 Gerald 73 de OE1HGA, Gerald |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
PicoMite V8.00.00b5: the fifth beta of V8 https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V8.00.00b5 Coming from b4, every build keeps everything: its options, its programs, its flash slots and its A: drive. Coming from an earlier version, see the boxes at the top of the release notes: every build reset at its first boot of b4. A CSUB that lets the threads run A CSUB is a single statement, and threads take turns between statements, so until now every other thread waited until a CSUB returned. A CSUB that runs for a long time, such as a chess program's search, stopped the program's threads for as long as it ran. A CSUB can now call CSubYield, at offset 0x1C0 in the call table (PicoCFunctions.h v2.4.0), to give the other threads their turns. It returns when this thread's turn comes round again, and does nothing in a program without threads. mmb2csub calls it for a THREAD YIELD in a routine that it converts, so the BASIC can say where: nodes = nodes + 1 If (nodes And 127) = 0 Then If Timer > stop_time Then stop_search = 1 Thread Yield ' the other threads have their turns here EndIf Each of the other threads' turns is one time slice, a millisecond by default. A thread with a burst of work to do while a CSUB runs, such as redrawing a clock, should put THREAD HOLD and THREAD RELEASE round it, to finish it in one turn. Two threads demos • Chess (Bas/threads/chess): TSCP, Tom Kerrigan's Simple Chess Program, as converted to MMBasic by Ceptimus and others, with the search in a CSUB. A chess clock below the moves list runs as a thread. The search yields every 128 nodes, so the clock never stops for more than about a quarter of a second while the computer thinks, and the search is only about 4% slower for it. The board is now redrawn after a capture of a like piece (pawn takes pawn), which used to leave the captured piece on show. It needs b5 and a VGA or HDMI build, a PicoMitePC3, or an LCD panel with FRAMEBUFFER CREATE. Note that the first run puts chesslib.bas in the library with LIBRARY LOAD "chesslib.bas", O, which replaces whatever library the board had without asking. https://github.com/UKTailwind/PicoMite/tree/PicoMite-V8.00.00b5/Bas/threads/chess • Pico Frog (Bas/threads/picofrog): Martin Herhaus' game, with later work by Thomas Williams, Volhout and harm, with its sound as two threads in place of its SETTICK routines. One plays the music, with its own place in the DATA, so loading a level no longer stops it; the other sleeps until the game asks for a jump or a death sound. The original is beside it, for comparison. It needs b4 or later and the same displays as the chess. https://github.com/UKTailwind/PicoMite/tree/PicoMite-V8.00.00b5/Bas/threads/picofrog Each folder's README describes what was changed and how to run it. What is fixed • Threads in interrupt routines (#167): THREAD EXIT, or THREAD STOP of its own thread, in an interrupt routine stopped every thread switch and interrupt for the rest of the run. Both are now "Invalid in an interrupt routine": a routine ends its thread by setting a flag that the thread's loop tests. And with a fast SETTICK in one thread beside busy ones, the main program's PAUSE could never end; the turns now go round in order, whichever thread an interrupt picks out of turn. • FILES in a thread (EXECUTE "files", for example) crashed the board. It is now "Not allowed in a thread", as LIST is; the main program can still use FILES while threads run. RAM FILE LOAD ended every thread; it is now "Not allowed while a thread is running", as SAVE CONTEXT is. • LGETSTR$ of 255 characters wrote past the end of its string (#162). • WEB CONNECT with no arguments now rejoins the network whenever the board is not joined, not only after a failed join (#163). The User Manual, the mmb2csub guide, the CallTable appendix of armcfgen.pdf and the MMBasic Threads User Manual describe CSubYield. The CallTable appendix also listed ExtCurrentConfig at 0x1C0, where no released firmware had it: it is at 0x48. This beta has been tested on the PicoComputer 3, where all 43 thread tests pass and the chess and Pico Frog run. The other builds compile cleanly, so reports from other boards are welcome. |
||||
| ville56 Guru Joined: 08/06/2022 Location: AustriaPosts: 694 |
Peter, have there been changes to the IP stack in b4 or b5? Cackground is that the connection to my Fritzbox now seems to work on every startup of the pico. Up and including b3 the connection "reliably failed" every 2nd time e.g. with "cpu restart". And there were no changes on my fritzbox firmware or config in between. Gerald 73 de OE1HGA, Gerald |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
No change, every build puts code in a slightly different place which affects caching and timing very slightly so no guarantees it won't change again |
||||
| flip Senior Member Joined: 18/07/2016 Location: AustraliaPosts: 143 |
Hi Peter, Getting carried away with these amazing threads, I've noticed I'm often running out of memory. is there a way to easily at run time identify the free memory available for a thread prior to attempting to create a thread? In creating them I know I should know how much each thread should take up - and that's absolutely fine, it's just the available space for a thread (so program can avoid a crash in advance, or choose alternative procedure to 'skin the cat'). I have an example program (Multi-tasking frames) that I'm playing with as follows: (it's by no means an exemplar of programming skill with threads)..which has a limit of 5 (MAXTHREADS) if I set to 6 it crashes when 6 are started (sometimes 5?) I will scour the manuals and answer myself if something found. 'PC3 Multi-tasking frames 8.00.00b4 Dim f% const HRES=MM.HRES\MM.FONTWIDTH Const VRES=MM.VRES\MM.FONTHEIGHT Const MAXTHREADS=5 Dim Integer nthreads Dim Integer RunStatus(8) CONST sINITIAL=0 CONST sFIRSTRUN=1 CONST sSTOPPING=2 CONST sRERUN=3 CONST sSTOPPED=4 FRAME CREATE FRAME BOX 0,0,HRES-1,VRES-1,,,RGB(CYAN) Sub ChildFrame(id As Integer) 'Static used%=0 Local i% If RunStatus(id)=sRERUN THEN FRAME CLS id+1 If RunStatus(id)=sFIRSTRUN Then Frame Overlay id+1,25,20,RGB(YELLOW) Frame Show id+1,(1+((id-1)) mod 4)*HRES\5,(1+(VRES-3)\2*((id-1)\4)) Do Inc i% Frame Print id+1,Str$(id)+":"+Str$(i%)+"...",,WRAP FRAME WRITE Pause 500+id*100 Loop Until RunStatus(id)=sSTOPPING FRAME HIDE id+1 Frame Print 1, "("+Str$(nthreads-1)+")"+Time$+": Stopped "+Str$(id)+CHR$(10),rgb(red) FRAME WRITE RunStatus(id)=sSTOPPED INC nthreads,-1 End Sub Sub Start(fr%) INC nthreads Thread Start fr% Size 8 Locals 8 Nest 4,ChildFrame,fr% Frame Print 1, "("+Str$(nthreads)+")"+Time$+": Started "+Str$(fr%)+chr$(10),rgb(green) FRAME WRITE End Sub Sub Stop(fr%) End Sub '************ MAIN LOOP ************** FRAME PRINT 1,"PRESS ANY KEY TO END"+Chr$(10),RGB(YELLOW) 'randomly start/stop tasks (limited to the number of MAXTHREADS) Do t%=1+rnd*7.5 If RunStatus(t%) MOD 2=1 Then 'running RunStatus(t%)=sSTOPPING 'Stop it Else If nthreads<MAXTHREADS Then If RunStatus(t%)=sINITIAL Then RunStatus(t%)=sFIRSTRUN Else RunStatus(t%)=sRERUN Start t% EndIf EndIf Pause 1000 Loop While Inkey$="" '************ Close all frames/tasks For f%=1 to 8 If RunStatus(f%) MOD 2=1 Then RunStatus(f%)=sSTOPPING Pause 400 EndIf Next f% 'Wait for tasks to finish do:loop while nthreads Frame Print 1,"("+Str$(nthreads)+")"+Time$+": ALL TASKS ENDED"+CHR$(10),rgb(BLUE) FRAME WRITE pause 2000 END This is just too much fun, every time I think I can start work on a serious project, a new feature blows me away. Edit: Just fixed HRES & VRES UPDATE: Tried checking the stack MM.INFO(STACK) - &H 2003f800 (as implied by manual) this gives -262k free (that's negative) so either am running in the super red-zone of stack or the manual may need an update (or I'm missing something) Edited 2026-11-28 10:09 by flip |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
Hi, Glad you're enjoying the threads. I ran your program on a PicoComputer 3 with MAXTHREADS set to 6, and the "crash" isn't memory. It stops with: [code] [38] Thread Start fr% Size 8 Locals 8 Nest 4,ChildFrame,fr% Error : Thread 5 is running [/code] That's a race in the program. When the main loop stops a thread it sets RunStatus to sSTOPPING (2), but the thread only ends after its PAUSE 500+id*100 has run out. Meanwhile RunStatus(t%) MOD 2 is 0, so the main loop thinks that thread has stopped and can start it again while it's still running, and THREAD START refuses. With 6, more threads are running at a time, so it happens sooner than with 5, but 5 can do it too. The simplest fix is to ask the firmware rather than your own flag: [code] If MM.INFO(THREAD t%) = 0 Then Start t% ' 0 = not running: it has really finished [/code] Also, in Start, move the INC nthreads after the THREAD START, so the count stays right if a start fails. On memory: a thread's stack (its SIZE) and its other data come from the SRAM part of the heap, never from PSRAM. MM.INFO(HEAP) and MEMORY count the PSRAM too, so on a PicoComputer 3 they show over 5 MB free even when the SRAM is full. Seven threads of the defaults (SIZE 8) fit, and the eighth doesn't. Today the reliable test is to try: THREAD START fails cleanly, starting nothing, with "Not enough memory for a thread" (or "Not enough local variables for a thread"), so you can catch it and do something else: [code] Sub Start(fr%) On Error Skip Thread Start fr% Size 8 Locals 8 Nest 4, ChildFrame, fr% If MM.Errno Then Frame Print 1, "Could not start " + Str$(fr%) + ": " + MM.ErrMsg$ + Chr$(10), RGB(red) Else Inc nthreads Frame Print 1, "(" + Str$(nthreads) + ")" + Time$ + ": Started " + Str$(fr%) + Chr$(10), RGB(green) EndIf FRAME WRITE End Sub [/code] The next beta (b6) adds two functions for exactly what you asked: - MM.INFO(THREAD FREE): the largest block of memory free for a new thread's stack, in bytes. THREAD START needs its SIZE (in KB) in one block, plus about 3.5 KB more for the thread's other data with the defaults on a PicoComputer 3 (more with more LOCALS or NEST). - MM.INFO(STACK FREE): the bytes of stack left before "Stack overflow", in the main program or in the thread that runs it. You were right about MM.INFO(STACK) and the manual: &H2003F800 is the RP2040's limit. On the RP2350 the main program's stack is at the top of the SRAM, and inside a thread MM.INFO(STACK) gives that thread's own stack pointer, which is in the heap. So subtracting that address tells you nothing, and inside a thread it goes negative, as you found. The manual is corrected for b6, and MM.INFO(STACK FREE) gives the real figure. For what it's worth, recursive FUNCTIONs use about 650 bytes of stack a level, and SUB calls use none. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
PicoMite V8.00.00b6: the sixth beta of V8 Beta 6 is effectively the first release candidate for V8.00.00, so reports of anything that does not work are especially welcome. It lets threads use the PSRAM, adds MM.INFO(STACK FREE) and MM.INFO(THREAD FREE), loads progressive JPEG files on the RP2350 builds, and brings three new apps for the PicoComputer 3: curl, Heretic and Hexen (described in a separate post). It fixes RAM FILE LOAD in a running program, STEPPER arcs, CHAIN with threads, FRAMEBUFFER on the I2C and monochrome displays, file names held in variables, and the faults Gerad found in his review of the V7.00.00 code. V7.00.00 stays the current release. The firmware for all 18 builds, the manuals, the release notes and the apps are on GitHub: https://github.com/UKTailwind/PicoMite/releases/tag/PicoMite-V8.00.00b6 Coming from b5, two builds reset at their first boot of b6: the PicoMiteRP2350USB's flash region has moved up 16 KB, to make room for progressive JPEG files, and the PicoMiteHDMIWEB's, for the WebMite fixes and its paths of 127 characters. Save their options first with OPTION DISK SAVE "B:/myoptions.txt" and load them again afterwards with OPTION DISK LOAD "B:/myoptions.txt". Their flash slots and program memory are cleared, and on a board with 4 MB of flash, such as a Pico 2, the A: drive too. Every other build keeps everything, and no program saved by b5 needs loading again. Threads and memory • Threads can use the PSRAM. A thread's stack and its other data come from the SRAM while it has room for them, and now from the PSRAM, where there is one, when it has not. On a PicoComputer 3 seven threads of the defaults filled the SRAM and an eighth gave "Not enough memory for a thread"; now all eight run, and so does a thread too large for the SRAM. A thread whose stack is in the PSRAM runs about a tenth slower. When such a thread writes to the flash (a file on A:, VAR SAVE, an OPTION), the firmware does the writing on the main program's stack, in the SRAM, so there is nothing for the program to do. • MM.INFO(STACK FREE) is the number of bytes of stack left before "Stack overflow", in the main program or in the thread that runs it. Close to the limit it can read up to about 1 KB below zero before the error comes, as it is measured a little deeper than the check. A FUNCTION calling another takes about 650 bytes a level with OPTION COMPILE ON, up to about 1.3 KB without it; a SUB's call takes none. • MM.INFO(THREAD FREE) is the largest block of memory free for a new thread's stack: the SRAM's, or the PSRAM's if larger. MM.INFO(HEAP) adds up every free piece, so it is not the figure to test. A program can also catch "Not enough memory for a thread" with ON ERROR SKIP. • The manual's MM.INFO(STACK) entry gave the RP2040's stack limit, which told a program nothing on the RP2350: it now describes the stack as it is and points to MM.INFO(STACK FREE). Pictures LOAD JPG loads progressive JPEG files on the RP2350 builds, with the Colour Maximite 2's decoder, and the position, crop, scale and dithering work as for a baseline file. The image's coefficients are held while it is read: 3 bytes a pixel for the usual colour subsampling, from the PSRAM if there is one: 900 KB for 640x480, while a 1920x1080 file (6.3 MB) is more than a PicoComputer 3's 5.5 MB of free PSRAM and gives "Not enough memory for this progressive JPEG". The RP2040 builds still refuse them. What is fixed • RAM FILE LOAD in a running program reset the program as RUN does, all but its variables: the SUB, FUNCTION or GOSUB it was in could not return, READ started again from the first DATA, ON ERROR, the OPTIONs and the interrupts were off, open files were closed, and its saved variables (VAR SAVE) were erased. The program now carries on exactly as it was, so a launcher can load the next program while it runs. Loading the slot the program itself runs from is refused. Found by Gerad. • STEPPER arcs (#161): a G2 or G3 arc ran faster than its feed rate wherever it was not moving along an axis, up to 1.41 times the feed. Arcs now run at their feed rate along the arc, and are held to their slowest axis's maximum speed rather than 70% of it. • CHAIN from a program whose threads were running lost their memory, about 14 KB a thread. • FRAMEBUFFER CREATE and LAYER on the I2C and monochrome displays were accepted but did nothing useful, and FRAMEBUFFER COPY or BLIT MEMORY to the screen wrote to GP0 to GP15. They are now refused, with a pointer to OPTION AUTOREFRESH OFF and REFRESH. • File names in variables: RAM FILE LOAD, LOAD, CMM2 LOAD and FILES took only a quoted name. They now take any string expression. • Gerad's review of the V7.00.00 code: the WebMite's MQTT, DNS, web server, telnet, UDP and OPTION WIFI fixes; file and directory paths checked before they are copied (127 characters on every RP2350 build); damaged WAV, FLAC, PNG, MOD and sprite files caught instead of overwriting memory; BLIT MEMORY's rows off the stack; PIO DMA counts and ring buffers checked. The release notes list them all. • LOAD JPG of a greyscale file wrote past its buffer. • mmb2csub refused every routine of a program that arms an interrupt or uses threads, THREAD YIELD included: use mmb2csub-8.00.00b6.zip, not b5's. • The apps: Doom's saved games work, and MicroPython's SQLite no longer runs out of memory on a large ORDER BY or CREATE INDEX, stops a statement at Ctrl-C, and refuses ANALYZE. Take them from PicoMite_Programs-8.00.00b6.zip. This beta has been tested on the PicoComputer 3, where the 41 thread tests pass with and without OPTION COMPILE ON, and the PIO DMA fixes on the RP2040. The other builds compile cleanly, so reports from other boards are welcome. |
||||
| JanVolk Guru Joined: 28/01/2023 Location: NetherlandsPosts: 424 |
Peter, I have loaded the latest version and encountered this. Thanks for looking into my issue with the 1.3-inch OLED display using the framebuffer. I am going to try using `OPTION AUTOREFRESH OFF` along with `REFRESH`. > option list PicoMite MMBasic RP2040 V8.00.00b6 OPTION SYSTEM I2C GP20,GP21 OPTION COLOURCODE ON OPTION HEARTBEAT OFF OPTION PICO OFF OPTION CPUSPEED (KHz) 200000 OPTION DISPLAY 50, 100 OPTION LCDPANEL SSD1306I2C, LANDSCAPE, 2 OPTION SDCARD GP19, GP10, GP11, GP12 OPTION F1 help OPTION F6 list commands OPTION F7 list functions OPTION F8 option list OPTION F9 fm > LIST SYSTEM I2C HEX 0 1 2 3 4 5 6 7 8 9 A B C D E F 00: [LIBRARY] If Touch(SYSTEM I2C)="I2C" Then I2C check _ad Else I2C2 check _ad Error : Invalid syntax Test Framebuffer: ' Create framebuffer to completely eliminate flickering FRAMEBUFFER CREATE FRAMEBUFFER WRITE F | | | | ' --- DRAW SCREEN TO FRAMEBUFFER (FLICKER-FREE) --- Sub DRAW_UI Local k, x CLS ' Header with DS3231 Time & RUN/STOP status Text 0, 0, LEFT$(Time$, 5) + " " + LEFT$(Date$, 5),,7 If RUN_MODE Then Text 92, 0, "RUN ", ,7 , , 0, 1 ' Inverted text Else ' Foreground, Background 0=black 1=white Text 92, 0, "STOP", ,7 , , 0, 1 EndIf | | | ' Copy framebuffer to OLED in one go (zero flickering!) FRAMEBUFFER COPY F, N Pause 50 End Sub > RUN [152] FRAMEBUFFER CREATE Error : Not on this display: use OPTION AUTOREFRESH OFF and REFRESH Jan. |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 6334 |
V8b6 runs on my PC3. After playing with CMM2 few weeks, I got used to F1 = FM. In V8b6 in FM it is not possible to start an app (i.e. doom.app) with F2 or <enter>. Commandline run "doom.app" is required. Heretic works fine. As Frank said, key mapping diverts from DOS version. Volhout Edited 2026-12-04 06:31 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 12322 |
This is a limitation of the way apps work compared to a normal MMbasic program You can launch with, for example, *doom.app Edited 2026-12-04 08:49 by matherp |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |