This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot init heap using scatter file and C++ startup (Cortex-M4)

Hello,

I need help with heap initialization using scatter file and C++ startup.

MCU is STM32F407VGT6 (Cortex-M4).

Compiler is ARM Compiler 6.7, C++14.

The problem is that all variables which I create dinamically on the heap have wrong addresses. My HEAP locates in CCM (starts from 0x10000000) but those variables have address from 0x08000000. And it is a FLASH memory! And I don't understand how it is happened. While initialization of stack performs in correct way... Below are my C++ startup and scatter file.

As you see - these files use the same logic like in standart startup_stm32f407xx.s.But standart file works and my - no...

I also want to note that if I eneble MICROLIB in settings of Keil, add ARM_LIB_STACK and ARM_LIB_HEAP to scatter file, my implementation begins to work correctly.

But I want to do my startup without MICROLIB.

If you know where I am wrong in my code, please help.

Best regards, Andrey.

0