![]() |
Forum Index : Microcontroller and PC projects : PicoMite V6.00.02 betas
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 220 |
Peter, basically the SEEK now works on A:, but the time required for I/O is a bit strange: drive a: drive b: seek 0.2 mSec 1.1 mSec print 36 mSec 0.2 mSec input 0.3 mSec 0.2 mSec flush 65 - 200 mSec 3.7 mSec i would expect drive A: to be faster than drive B: but it's just the other way round and I/O on A: is incredible slow. I will later make some experiments with sequential reads/writes. But thank you for bringing the SEEK/write I/O functionality to drive A:, maybe the time behavior can be adjusted as well. Gerald P.S. added input (read) times Edited 2025-03-06 23:31 by ville56 73 de OE1HGA, Gerald |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 220 |
tested now plain sequential writes/flushes ... performance is about same as with random writes and flushes. Gerald 73 de OE1HGA, Gerald |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
Peter, I have no idea what you fixed, but the 2040 VGA version b16 does not run any programs. A variety of errors. If-then statements that complain, no "then" (which is clearly there) A single "Do" on a line gives a syntax error. Try Geoff's "Blocks", or "Circle" , "FM" (filemanager), or Petscii Robots, or... just any program. I am back at b14 Volhout Edited 2025-03-07 00:38 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
You need to think about how flash memory works. Erasing flash sets it to all ones. Writing sets the relevant bits from 1 to 0. Flash memory has a 4Kbyte page size. So to overwrite a single zero to a one it needs to read 4K, erase the 4k, and then write the 4K back with the changed data. Now, your use of seek, as Tom indicates, sets NULL (zero) to bytes before the new position. This means to overwrite you need to erase for every write. I suspect LittleFS isn't clever enough to compare the stored data with your write to see if it needs to erase. See the chip timing below for more info - in particular look at the sector erase time and the page (256 bytes) write times ![]() |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
Works for me testing petrobot/solar_eclipse. Suggest you clear flash or load a different firmware variant and try again. As always without a list of options set there is little more I can add Edited 2025-03-07 00:50 by matherp |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
Hi Peter, I cleared the system, VGA design 2. The problem is different now, but related to the latest filemanager from twofingers (fm01998) that I use to browse b: drive and start programs. This filemanagers is stored in a flash slot and started from commandline (F9). When I run programs from this filemanager is causes problems (actually I cannot even select a folder anymore now, it does not accept <enter>). When I use javavi's latest filemanager (fm123) it still works (from a flash slot). So this may partly be an issue of the filemanager coding. But fact is that this filemanager fm01998 worked correct on b14 (used it for 2 days). Something has changed. I will report to twofingers. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
If anything is loaded in a flash slot you may need to reload it from source as tokens may have changed Edited 2025-03-07 01:13 by matherp |
||||
ville56 Senior Member ![]() Joined: 08/06/2022 Location: AustriaPosts: 220 |
OK Peter, I understand, it is the erase time. I have completely underestimated this. Buffred writes are still fast, so what I've intentionally tested with constant flushing was the worst case of course. But it is good to be reminded again that writing to flash is really slow. Gerald 73 de OE1HGA, Gerald |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
@Peter, I have no knowledge of the core of the filemanager. So I am guessing.. Could this have a relation to the new END function (perform some tasks when program ends). Anyway, b16 is not working with the filemanager fm01998 in flash. And b14 is. Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
b16 updated 15:47 UTC to fix possible issue |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
Peter, EDIT Running out of time now, but my diagnosis so far is that blocks with sound is causing the issue. It is playing a very large WAV file, sampled from a game boy. When started from the file manager, The wav file plays at normal speed first, then slows down (half speed ?), then the mmbasic program crashes. Typically before the wrap around. The WAV file is on SD card. And when it crashes the system, you get all kinds of problems, that are only solved with a re-boot. I had also problems with other programs, but only after blocks was played, and that was on the top of the lies (tried first). So b16 could be valid, only the sound in blocks (and I wrote those 4 lines of code) are the problem. EDIT Volhout Edited 2025-03-07 02:54 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
bfwolf Regular Member ![]() Joined: 03/01/2025 Location: GermanyPosts: 75 |
LittleFs generally has a relatively poor performance when writing. This is due to the design! LittleFs is designed to survive power cuts and crashes without errors. This is why it works with transactions. If a new empty flash block is needed for writing, the next invalid block found is only deleted immediately before writing. In addition, when writing in the middle of an existing file, all existing data behind the current position up to the end of the file is rewritten during a "commit" (e.g. by flushing) to ensure that the file is in a valid state again. LittleFs does not perform garbage collection in the background by itself! This can be added, but this means programming effort. If you have use cases such as a circular buffer, LittleFs is certainly not the first choice. SPIFFS, for example, is suitable for this. However, you can also distribute the circular buffer across several shorter files of a fixed size to achieve something like this. E.g. "values.1.dat", "values.2.dat", "values.3.dat", ... @Peter: I'm sure, i didn't tell you something new? ![]() bfwolf |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1556 |
@Harm Have you tried reducing the number of files that can be loaded - setting it back to 200 (from RMax=300)? You could also change the execution mechanism for running programs. Edited 2025-03-07 03:00 by twofingers causality ≠ correlation ≠ coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
Based on a very quick scan I would try replacing the RUN command with EXECUTE "RUN |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1556 |
Or End "run "+chr$(34)+TEMP$+chr$(34) ?? Edited 2025-03-07 03:13 by twofingers causality ≠ correlation ≠ coincidence |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
Peter, Look at previous post, It is related to PLAY WAV from SD card. Is it related to the recent heap increase for 2040. Volhout Edited 2025-03-07 04:45 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
I thought you said it was broken on b14 as well just a different symptom? |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5001 |
B14 has different symptoms, but also fails after running initially. B14 crashes after running for 30 seconds or so. B16 returns with an error, returns to commandline, and appears to work, but errors on every successive program. Until a cpu restart. The B14 I used is the one that has heap of 100k, I do not have a prior version with heap 96k. Volhout Edited 2025-03-07 05:34 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
have you tried the different approaches to RUN? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10170 |
Have you tried just using ON ERROR SKIP before the DIM statement? In general you shouldn't DIM variables in subroutines precisely because of this issue. |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |