Low Memory Available with PLC IDE

Why might the Portenta Machine Control be limited to 8KB of code memory? Its specs indicate that it ships with 8MB of SDRAM.

Is there a way to make more available to the runtime? I'm building a framework with libraries for the platform and have barely begun to scratch the surface of code to write.

8KB is a very low limit for code.
16KB is also a low allowance for data, but I'm nowhere near reaching it due to the former.

When I go to compile I get the following error:
error A4104: Code space exhausted

When I take away some ladder block calls, I can compile and it generates these diagnostics:

Used code size: 15ACh ( 5 KByte)
Free code space: A54h ( 2 KByte)
Total code space: 2000h ( 8 KByte)

Used data space: C8h ( 0 KByte)
Free data space: 3F38h ( 15 KByte)
Total data space: 4000h ( 16 KByte)

Used retain data space: 0h ( 0 KByte)
Free retain data space: 400h ( 1 KByte)
Total retain data space: 400h ( 1 KByte)

I was able to modify the projectName.imgx file's description for this region of memory and adjust the code memory available to 32KB. This file is found in the same location as the projectName.plcprj file and appears to be an xml definition for a flat 32-bit memory layout that includes the embedded IEC functions' addresses, so care must be taken to avoid overlapping into another region. I am also unsure what the attribute addrArea2 means in this context.

Original values (8KB):

<codeArea address="0x38000400" size="0x2000" addrArea1="0x38002400" addrArea2="0x38000400"/>

New values (32KB):

<codeArea address="0x38000400" size="0x8000" addrArea1="0x38008400" addrArea2="0x38000400"/>

Compiler diagnostic output:

Used code size: 15BCh ( 5 KByte)
Free code space: 6A44h ( 26 KByte)
Total code space: 8000h ( 32 KByte)

Used data space: C4h ( 0 KByte)
Free data space: 3F3Ch ( 15 KByte)
Total data space: 4000h ( 16 KByte)

Used retain data space: 0h ( 0 KByte)
Free retain data space: 400h ( 1 KByte)
Total retain data space: 400h ( 1 KByte)

No idea what happened to my account so here I am continuing the thread.

Hi @jeremym1987. It looks like the account that created this topic was "anonymized". I believe the forum software does this automatically when you delete your arduino.cc account via this page:

hello @jeremym1987
we are investigating the cause of the misalignment of your setup.

would you mind to double check the IDE Tools downloaded? it should be 0.28
then create a new project and the correct map should be:

Code Space: 121 Kbyte
Data Space: 127 Kbyte
Retain space: 1 Kbyte

thanks

Thank you for the response, Andrea.

I re-downloaded the IDE Tools 0.28, removed the previous install (not repair), re-installed and created a new project.

Results:

Used code size:	    ACCh (    2 KByte)
Free code space:	  1D934h (  118 KByte)
Total code space:	  1E400h (  121 KByte)

Used data space:	     14h (    0 KByte)
Free data space:	  1FBECh (  126 KByte)
Total data space:	  1FC00h (  127 KByte)

Used retain data space:	      0h (     0 KByte)
Free retain data space:	    400h (     1 KByte)
Total retain data space:    400h (     1 KByte)

Far better.

I think the default memory should be higher or adjustable somehow in the IDE, but this is promising.

Thanks pert. I had performed a delete and signed up with this account on the .cc page. I guess the forum purge and re-link took a few days, but this is my desired username. So all is well going forward.

Weird. When doing an online change and downloading, the memory counts revert to the low end:

Used code size:	   1820h (    6 KByte)
Free code space:	    7E0h (    1 KByte)
Total code space:	   2000h (    8 KByte)

Used data space:	     C8h (    0 KByte)
Free data space:	   3F38h (   15 KByte)
Total data space:	   4000h (   16 KByte)

Used retain data space:	      0h (     0 KByte)
Free retain data space:	    400h (     1 KByte)
Total retain data space:    400h (     1 KByte)