[SOLVED] hal.initialize() causes hard fault. -- actually __libc_init_array() not called.
- November 28, 2019
- 10 replies
- 3387 views
I'm porting toughgfx button example to rt-thread. I tested the environment with led blinking.
My environment is as below.
tool chains: scons + gas/gcc/g++
debugging : openocd + gdb
flash program : STM32CubeProgrammer with openjdk and openjfx
RTOS: rt-thread
Board: stm32f746g-disco
I merged the touchgfx button example into rt-thread. And then I began to experience a hard fault. It starts with touchgfx::touchgfx_init(). I checked that I have no problem with cpp codes, such as new operator and STL.
at touchgfx-button/Middlewares/ST/TouchGFX/touchgfx/framework/include/common/TouchGFXInit.hpp:86
86 HAL& hal = getHAL<HALType>(dma, display, tc, width, height);
at touchgfx-button/Middlewares/ST/TouchGFX/touchgfx/framework/include/common/TouchGFXInit.hpp:87
87 hal.initialize();
void OSWrappers::initialize()
0801c9a0 <_ZN8touchgfx3HAL10initializeEv>:
801c9a0: b510 push {r4, lr}
801c9a2: 4604 mov r4, r0
801c9a4: f7f2 f986 bl 800ecb4 <_ZN8touchgfx10OSWrappers10initializeEv>
801c9a8: 6860 ldr r0, [r4, #4]
801c9aa: 6803 ldr r3, [r0, #0]
801c9ac: 68db ldr r3, [r3, #12]
801c9ae: 4798 blx r3
After the call to OSWrappers::initialize(), r3 was 0x9db545a1.
801c9ae: 4798 blx 0x9db545a1
For your information, my lds file is...
================= lds file =================
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
QUADSPI (r) : ORIGIN = 0x90000000, LENGTH = 16M
}
There should be no codes in QUADSPI area. But I don't know what that code is. Would you please advise me with my lds file?
I've enclosed the linker script file.
