Skip to main content
TNaum
Associate III
Jan 13, 2021 6:40 PM UTC
Question

Memory Information for stm32l452ccux is wrong in Keil.STM32L4xx_DFP.2.5.0.pack

In Keil.STM32L4xx_DFP.2.5.0.pack, which can be downloaded at https://www.keil.com/dd2/pack, the memory information for stm32l452 says that the ram size is 0x00020000 = 128kB, but it actually is 0x00028000 = 160kB (SRAM1 + SRAM2).

Using this file for my tooling, gdb is unable to read the values from the stack so I would like to see this fixed. Is this here a good place to report this issue? If not, where should I report it?

This topic has been closed for replies.

7 replies

Piranha
Principal III
Jan 13, 2021 7:23 PM UTC
TNaum
TNaumAuthor
Associate III
Jan 14, 2021 8:11 AM UTC

Thanks. Does this mean that those ST-related DFP packs are managed by Keil/ARM instead of ST itself?

ST Technical Moderator
Jan 20, 2021 3:11 PM UTC

Hello @TNaum​ ,

I have passed your reported issue along to our tools team for review and fix.

Thanks for your contribution.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
TNaum
TNaumAuthor
Associate III
Jan 22, 2021 9:34 AM UTC

So things turned out to be a little bit more complicated:

The DFP/PDSC contains memory information for the whole subfamily:

<subFamily DsubFamily="STM32L452">
 
...
 
<!-- correct memory layout
 <memory name="SRAM1" access="rwx" start="0x20000000" size="0x00020000" default="1" init="0"/>
 <memory name="SRAM2" access="rwx" start="0x20020000" size="0x00008000" default="1" init="0"/>
 <memory name="SRAM2alias" access="rwx" start="0x10000000" size="0x00008000" default="0" alias="SRAM2"/>
 -->
 
 <memory id="IRAM1" start="0x20000000" size="0x00020000" init="0" default="1"/>
 <memory id="IRAM2" start="0x10000000" size="0x00008000" init="0" default="0"/>
 

It even contains the full information (SRAM2 is aliased at a different address, too) as a commented-out block.

The issues arise when I create a Makefile project with CubeMX. It generates the following line in the linker script:

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 160K

So, depending on the perspective, both the pdsc and the linker script are correct. But in the current state, they are a little bit incompatible: I am using the gdbserver shipped with pyocd which extracts the memory information from the pdsc file so gdb does not let me read addresses above 0x20020000. Unfortunately, that's where the stack ends up using the linker script generated from CubeMX.

I know how to fix those issues for me but it would be nice if those two tools would be more interoperable. Maybe, you can find a way to make this work?

ST Technical Moderator
Jan 28, 2021 8:36 AM UTC

Hi @TNaum​ ,

Thank you for your feedback.

I will raise your reported issue to CubeMx team for review and treat accordingly to the priority.

@Nawres GHARBI​ , @Houda GHABRI​ ​Could you please check the issue related to CubeMX.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
TNaum
TNaumAuthor
Associate III
Jan 28, 2021 9:36 AM UTC

Hi and thanks for your efforts. I'll await your response and the outcome of this issue.

Houda GHABRI
ST Employee
Feb 2, 2021 1:59 PM UTC

Hi @TNaum​ ,

Sorry for the delay.

The issue is reproduced and reported internally to be fixed.

Thanks for raising this issue,

Houda