Ported CubeIDE project misses access to certain memory areas
- April 23, 2021
- 3 replies
- 1542 views
Have a project that has been proted from CubeIDE to a more standalone project structure. This because I am requierd to have the project run from other IDEs like C:b or even from a comandline environment only. The project is based on the STM32H743
Porting the project was ok, using the same arm-noen-eabi as cubeIDE do and by using the compiler flags and linker flags as CubeIDE have, and by using the startup and memory map as generated by cubeMX.
The project compiles fine and I am able to run the debugger with c:b and stlink/v2, but for some reason there are memory areas that no longer is accessible.
I am able to start the debugger and most of the code runs just fine, and dissasembly shows that the two setups generates approximatly the same code, but accessing certain memory areas throws a hardfault.
The code is simple enough, copy to local variable whatever the pointer points to.
Both projects generates the very same code as seen below
c = *pC;
ldr r3, [r7, #32]
ldrb r3, [r3, #0]
strb r3, [r7, #22]the initial value for r7 = 0x2407ff18 for both projects, i.e. when running the CodeIDE project or the ported one. But when running line 4 above, "load to r3 what r3 points to" the ported project always ends up in the hardfault handler, but the Cube based project passes
I believe it must be related to the linker setup somehow, but I cant figure out what. Ore I have missed some security flags for the STM32H7 core, whatever that may be. The thing is, I am to dumb to understand whats going on :\ So some suggestions for where to look or which more info you guys need would be appreciated,
Thanks in advance
EDIT.:
Added the makefile for refference
Youst be aware that there are a few things in the makefile which is leftowers from previous projects, so don't judge me to hard. It is the compiler/linker flags that is of most interest, I need to do a cleanup sooner or later
