![]() |
Forum Index : Microcontroller and PC projects : PicoMite V6.00.02 betas
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
javavi has created an edge case where there is just enough memory to allocate for the variable storage but not enough to complete the creation which would include some temporary memory usage. I don't intend to try an fix this as doing so would slow down all variable creation. In all versions memory is partitioned between heap where strings and arrays are stored (amongst other things) and the hash table for simple variables and variable headers for strings and arrays. This is why there will typically be free memory showing even after the heap is full |
||||
javavi![]() Guru ![]() Joined: 01/10/2023 Location: UkrainePosts: 436 |
The same bug also appears with an integer array if the HEAP SIZE is slightly exceeded when creating it. If the Heap size is exceeded by 256 bytes when creating an array, the array will be created and can be cleared. If the Heap size is exceeded by 256 bytes + 1 array element when creating an array, the volume will go to the general one when clearing and will not be cleared. > ? MM.Info(HEAP) 97792 > Dim d(12223) 'Array 12224 integers * 8 byte = 97792 > ? MM.Info(HEAP) 0 > clear > ? MM.Info(HEAP) 97792 'OK > Dim d(12223+32+1) 'Array 12224+32+1 integers = 97792+256+8 byte > ? MM.Info(HEAP) Error : Not enough Heap memory > clear > memory RAM: 0K ( 0%) 0 Var 96K (77%) General 28K (23%) Free If you use the ERASE d command instead of the CLEAN command, the array is deleted normally and the Heap is cleared. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10067 |
As I said I don't intend to look at this as fixing it would have significant performance implications. Also, if the memory is so full then it is guaranteed that the program would fail as soon as you try and do anything else. You have demonstrated a edge case artifact which has no general relevance. Edited 2025-02-23 20:22 by matherp |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7504 |
You're trying to break it. You naughty person. ;) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 529 |
You are right, I think the same, but maybe it would be good to mention this in the manual? Greetings Daniel |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7504 |
Nah... If your program is that big the last thing you will be bothered about is the last bit of memory. It's not going to run, or even if it does manage to start the chances are that something will crash it unpredictably. Using the last bit of memory is something you do in assembler, not in a high level language where things are constantly changing. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4854 |
Kong also ran into it. I think the difference with earlier releases is that there simply is less memory. I feel with larger programs memory is a primary task, and use of libray and flash slots should be planned from the start. . . Edited 2025-02-24 02:59 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
@Peter, Can I propose that OPTION LIST returns the list sorted alphabetically so that it makes it easier to find a specific option when the list becomes lengthy. Even though the list currently seems to be sorted in a consistent sequence between PicoMites, having it sorted alphabetically would definitely help the end user. I am not in front of any PicoMite, but from memory I think that HEARTBEAT isn’t showing in the list (b11 2350B). Will confirm later when back home…. |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
@Peter, @all I'm not sure if I'm misunderstanding something. I tried this code: Print "Start of the program." End Sub MM.END Print "This is the END." End Sub I would have expected mm.end to be executed, i.e. Print "This is the END". But it doesn't. ![]() > option list PicoMiteHDMI MMBasic USB RP2350A Edition V6.00.02b11 OPTION SERIAL CONSOLE COM2,GP8,GP9 OPTION SYSTEM I2C GP20,GP21 OPTION FLASH SIZE 4194304 OPTION COLOURCODE ON OPTION KEYBOARD GR OPTION CPUSPEED (KHz) 315000 OPTION SDCARD GP22, GP26, GP27, GP28 OPTION RTC AUTO ENABLE OPTION F9 FLASH RUN 2 OPTION PLATFORM HDMIUSB Kind regards Michael causality ≠ correlation ≠ coincidence |
||||
Amnesie Guru ![]() Joined: 30/06/2020 Location: GermanyPosts: 529 |
But why should the interpreter jump to the mm.end subroutine if you tell him to END before, since this is a statement. ?? I think this is correct behavior. Greetings Daniel |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7504 |
MM.END isn't documented in a manual yet AFAIK. See the matherp posts from this point onward: https://www.thebackshed.com/forum/ViewTopic.php?TID=17283&PID=229949#229949#229949 Anything after an END statement is ignored. The SUB MM.END must occur before the END statement or it won't be detected. . Edited 2025-02-25 05:20 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
MMBasic manual p18: (2025-01-25_063652_PicoMite_User_Manual) causality ≠ correlation ≠ coincidence |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
@Mick Thanks, that helps! I will try that! Regards Michael This doesn't work either: Sub MM.END Print "This is the END." End Sub Print "Start of the program." End Edited 2025-02-25 05:26 by twofingers causality ≠ correlation ≠ coincidence |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
@Daniel: Because the manual says so? (p18+p108) ![]() Kind regards Michael END [noend] or END cmd$ End the running program and return to the command prompt. If a subroutine named MM.END exists in the program it will be executed whenever the program ends with an actual or implied END command. It is not executed if the program ends with the break character (ie, Ctrl-C). The optional parameter ‘noend’ can be used to block execution of the MM.END subroutine eg, “END noend” if 'cmd$' is specified then it will be executed as though at the command prompt after the program finishes. Note: if "END cmd$" is used but a subroutine MM.END exists it will be executed and cmd$ ignored. causality ≠ correlation ≠ coincidence |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
> list Print "Start of the program." End > RUN Start of the program. > library list Sub MM.END Print "This is the END." End Sub I don't understand it ![]() causality ≠ correlation ≠ coincidence |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2927 |
I am seeing the same here on several Pico’s I have under test (i.e not running the code within the mm.end sub). All my Pico’s have b11 HDMI USB |
||||
twofingers Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1526 |
@WW Thanks for the cross-check! Michael causality ≠ correlation ≠ coincidence |
||||
dddns Senior Member ![]() Joined: 20/09/2024 Location: GermanyPosts: 259 |
both on b11 usb: I am not able to read an ADC value constantly, neither on a 2040 nor a 2350B: do:? pin(gp27):pause 100:loop 2.334444444 2.334041514 0.3886935287 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 -0.0008058608059 .... After that has happend, none of the ADC inputs can be read anymore and all showing this number. |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 3998 |
Do you need a SETPIN or such? John |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1193 |
Am I the only one who can not download the Beta? (HTTP ERROR 418) Link Edited 2025-02-26 20:28 by Martin H. 'no comment |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |