Skip to content

NUCLEO-U575ZI-Q memory size incorrect in Arduino IDE showing 256 kbytes should be 786 kbytes #1827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Captainslarty opened this issue Sep 9, 2022 · 11 comments · Fixed by #1836
Labels
bug 🐛 Something isn't working
Milestone

Comments

@Captainslarty
Copy link

Incorrect dynamic memory size being used by Arduino IDE for board Using NUCLEO-U575ZI-Q
IDE is showing - Maximum as 256 kbytes where device actually has 786 Kbytes of SRAM

Using NUCLEO-U575ZI-Q
Arduino IDE 1.8.19
Core 2.3.0

example report from 'blink' sketch

Sketch uses 19820 bytes (0%) of program storage space. Maximum is 2097152 bytes.
Global variables use 1016 bytes (0%) of dynamic memory, leaving 261128 bytes for local variables. Maximum is 262144 bytes.

thank you
Joe

@fpistm fpistm added the bug 🐛 Something isn't working label Sep 9, 2022
@fpistm
Copy link
Member

fpistm commented Sep 9, 2022

Hi @Captainslarty
Thanks to report this.
You're right, this mcu got up to 756Kb.
To define boards we generate several files automatically using the STM32_open_pin_data database. This is the same than the one used by STM32CubeMx tools.
The xml describing the STM32U575ZITxQ give 256Kb ram: https://github.com/STMicroelectronics/STM32_open_pin_data/blob/ae7fb660038b0bd9a2d50f0fa443dc024b15a4c9/mcu/STM32U575ZITxQ.xml#L13

Anyway the STM32CubeMx tools show the correct size. I have to investigate why/how and then probably update our scripts.
image

As a workaround you can edit the boards.txt and change the value:
https://github.com/stm32duino/Arduino_Core_STM32/blob/main/boards.txt#L200

@Captainslarty
Copy link
Author

Hi and thank you for the very prompt response. Much appreciated.
Please can I confirm with you the exact values that should be entered in these two lines ?

Nucleo_144.menu.pnum.NUCLEO_U575ZI_Q.upload.maximum_size=2097152 Nucleo_144.menu.pnum.NUCLEO_U575ZI_Q.upload.maximum_data_size=262144

@fpistm
Copy link
Member

fpistm commented Sep 9, 2022

here is the ram size entry:
Nucleo_144.menu.pnum.NUCLEO_U575ZI_Q.upload.maximum_data_size=786432

--> (192 + 64 + 512) * 1024

Anyway, I didn't check if you can use all the RAM. There is 4 SRAM + 1 bck SRAM:
image

That's why I set only SRAM1/SRAM2/SRAM3.

@Captainslarty
Copy link
Author

Understood, Thank you.
Joe

@fpistm
Copy link
Member

fpistm commented Sep 9, 2022

This would be fine to see if all RAM are contiguous else there will be an issue. 😉 In a general way this core simply manage maximum contiguous RAM without ECC for more complex RAM configuration some extra config are required and custom linker script have to be used.

@Captainslarty
Copy link
Author

That is really appreciated. Fortunately or unfortunately ;) my level of knowledge is such that I will be highly unlikely to attempt more complex ram configurations :). I have made the changes and all appears well.
I know this next bit is going off topic slightly but please can I just enquire as to how I may get the NUCLEO-H7A3ZI-Q added to the Arduino core ? . I am not knowledgeable enough to produce a variant. Thanks again. Amazing support. Joe

@fpistm fpistm mentioned this issue Sep 9, 2022
84 tasks
@fpistm
Copy link
Member

fpistm commented Sep 9, 2022

I think it is OK anyway I would prefer warn you 😉
About the Nucleo H7 it is already in the request variant list: #722
I've reference your comment too.

@Captainslarty
Copy link
Author

Thank you ever so much for all your kind help Frederic.
Regards,
Joe

@fpistm fpistm added this to the 2.4.0 milestone Sep 9, 2022
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Sep 28, 2022
The xml describing those mcu give 256Kb ram.
Issue raised internally to fix this then it will be corrected
in generated files.

Fixes stm32duino#1827

Signed-off-by: Frederic Pillon <[email protected]>
@fpistm
Copy link
Member

fpistm commented Sep 28, 2022

Hi @Captainslarty

issue confirmed internally and xml files will be corrected. I made a patch to fix them in the core.
About the size, We only set 768K as the SRAM4 is not consecutive:
image

@Captainslarty
Copy link
Author

Thank you again for you very hind help and response. Very much appreciated.
Joe

fpistm added a commit that referenced this issue Sep 28, 2022
The xml describing those mcu give 256Kb ram.
Issue raised internally to fix this then it will be corrected
in generated files.

Fixes #1827

Signed-off-by: Frederic Pillon <[email protected]>
cparata pushed a commit to cparata/Arduino_Core_STM32 that referenced this issue Jan 31, 2023
The xml describing those mcu give 256Kb ram.
Issue raised internally to fix this then it will be corrected
in generated files.

Fixes stm32duino#1827

Signed-off-by: Frederic Pillon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants