Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:19 22 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: Array of structure, not enough memory

Author Message
Nordhesse
Newbie

Joined: 18/11/2026
Location: Germany
Posts: 3
Posted: 08:54pm 19 Nov 2026
Copy link to clipboard 
Print this post

Hello forum
i am new here and i am new with PicoMite. I have started my first project and was stopped when i used an array of structures. If the size of the array exceeds 256 bytes the error „Not enough memory“ appears.

Target: Pico RP2040, PicoMite V6.03

My code

TYPE StructRolllade
 AufZeit AS INTEGER
 AbZeit  AS INTEGER
 Ort     AS STRING LENGTH 19
END TYPE

DIM Rolllade(9) AS StructRolllade


I hope someone can help me
Guido
 
AlbertR
Senior Member

Joined: 29/05/2025
Location: Germany
Posts: 114
Posted: 09:41pm 19 Nov 2026
Copy link to clipboard 
Print this post

Hi Guido,
welcome to the BackShed.

Is that really the entire program, and is that the exact error message?
Arrays use heap memory, so the message should be
"Not enough Heap memory"

from the manual
  Quote  
MM.INFO(HEAP)
Returns the amount of MMbasic Heap memory free. MMBasic heap is used
for strings, arrays and various other temporary and permanent buffers (eg,
audio)


check the heap before the declaration with

print MM.INFO(HEAP)

Regards
Albert
Edited 2026-11-20 07:42 by AlbertR
 
Nordhesse
Newbie

Joined: 18/11/2026
Location: Germany
Posts: 3
Posted: 10:22pm 19 Nov 2026
Copy link to clipboard 
Print this post

Hi Albert,

thank you for your help.
But, my problem disappeared.
What did I do?
I've disabled all other code and there was no error.
Then I deleted some not used code.
And then i actived the other disabled code step by step.
The error did not reappear.

I think the "not used code" was the problem.
Unfortunately, I can no longer reproduce the error.

Anyway, thanks again.
Guido
 
AlbertR
Senior Member

Joined: 29/05/2025
Location: Germany
Posts: 114
Posted: 05:47am 20 Nov 2026
Copy link to clipboard 
Print this post

Ah,

glad it's working now—or maybe not. It actually always drives me crazy when I can't reproduce these problems, just so I can figure out what caused them. On the one hand, if it was my mistake, I want to avoid making the same one again; on the other hand, I want to be able to give Peter a clear description of the problem.

And we got one with the V6.03!
With the program

Type struct rolllade
AufZeit As integer
AbZeit  As integer
ort     As integer
End Type

Dim rolllade(5050) As Struct rolllade

this produces endless "Not enough Heap memory"  but it's fixed in version 7.00

Albert
 
karlelch

Guru

Joined: 30/10/2014
Location: Germany
Posts: 375
Posted: 10:04am 20 Nov 2026
Copy link to clipboard 
Print this post

Hi AlbertR,

there should not be a space between "struct" and "rolllade"
Type StructRolllade
 AufZeit As integer
 AbZeit  As integer
 ort     As integer
End Type

Dim rolllade(5050) As StructRolllade

That a structure is defined, is here implicit by "Type"

Best
Thomas
 
AlbertR
Senior Member

Joined: 29/05/2025
Location: Germany
Posts: 114
Posted: 12:15pm 20 Nov 2026
Copy link to clipboard 
Print this post

You're absolutely right.
I guess my mind was still half on C (typedef struct).  But it had worked, so I didn't notice it during that quick test.
Thanks again for pointing that out.

Greetings
Albert
 
Nordhesse
Newbie

Joined: 18/11/2026
Location: Germany
Posts: 3
Posted: 02:23pm 20 Nov 2026
Copy link to clipboard 
Print this post

Hi Albert, hi Karlelch,

I reconstructed the faulty version again.
Here you get the „not enough nemory“ error.


TYPE StructRolllade
 AufZeit AS INTEGER
 AbZeit  AS INTEGER
 Ort     AS STRING LENGTH 19
END TYPE

DIM Rolllade(9) AS StructRolllade = (21, 20, "Buero", 32, 31, "Schlafzimmer, Sued", 32, 31, "Schlafzimmer, West", 32, 31, "Kueche, Tuer", 23, 22, "Kueche, Fenster", 32, 31, "Wohnzimmer, Tuer", 33, 31, "Wohnzimmer, Sued", 31, 30, "Wohnzimmer, West", 35, 31, "Kinderzimmer, Sued", 23, 23, "Kinderzimmer, West")



In this way, It's probably not possible to transfer such a large amount of data.
Now I use READ and DATA to fill the structures.

Thank you for your hint to V5.3. Even though I only need an array of 10 structures, I will change to V7.0.
Guido
 
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