Skip to content

STM32L4 Stack and Heap overlap problem #1348

Closed
@helmut64

Description

@helmut64

For the new STM32L4 I found out a major problem, the first 4k of the heap overlap with the stack!
More details here: https://developer.mbed.org/questions/60933/STM32L4-Stack-and-Heap-overlap-Disco/

I believe the problem is in startup_stm32l476xx.s (Disco & Nucleo)

The following line must be inserted/changed: (TOOLCHAIN_ARM_STD + TOOLCHAIN_ARM_MIKRO) initial_sp EQU 0x20018000 ; Top of RAM1 96k

This would at least enable the 96k of RAM1, however there is another 32k SRAM2 at 0x10000000-0x10008000. My preference would be use the SRAM2 for the stack and HEAP, and add the SRAM1 for additional HEAP.
Regards Helmut

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions