Skip to content

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

@Captainslarty

Description

@Captainslarty

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

Activity

fpistm

fpistm commented on Sep 9, 2022

@fpistm
Member

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

Captainslarty commented on Sep 9, 2022

@Captainslarty
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

fpistm commented on Sep 9, 2022

@fpistm
Member

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

Captainslarty commented on Sep 9, 2022

@Captainslarty
Author

Understood, Thank you.
Joe

fpistm

fpistm commented on Sep 9, 2022

@fpistm
Member

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

Captainslarty commented on Sep 9, 2022

@Captainslarty
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 commented on Sep 9, 2022

@fpistm
Member

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

Captainslarty commented on Sep 9, 2022

@Captainslarty
Author

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

added this to the 2.4.0 milestone on Sep 9, 2022
added a commit that references this issue on Sep 28, 2022
e3afef0
fpistm

fpistm commented on Sep 28, 2022

@fpistm
Member

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

Captainslarty commented on Sep 28, 2022

@Captainslarty
Author

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

added a commit that references this issue on Sep 28, 2022
5818d75
added a commit that references this issue on Jan 31, 2023
7cd6cd4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @fpistm@Captainslarty

      Issue actions

        NUCLEO-U575ZI-Q memory size incorrect in Arduino IDE showing 256 kbytes should be 786 kbytes · Issue #1827 · stm32duino/Arduino_Core_STM32