2025-03-11 2:26 AM
Hi, I'm creating Boot sw & App sw in one board. which means, 2 independent STM32 Proj. runs in same Flash / RAM.
There is an issue when HAL_RCC_GetSysClockFreq() has been called. The first called sw, boot sw, doesn't make any trouble. but the second one, app sw which is jumped in by boot sw, make trouble when do [vmov s15, r3] assembly code. I've already checked Memory Map, Flash.ld, Vector ... etc. So obviously, there is no problem until [vmov s15, r3] will be done by app sw.
the first call of [vmov s15, r3] is triggered by [main()] - [SystemClock_Config()] - [HAL_RCC_GetSysClockFreq()]
fracn1 = (float_t)(uint32_t)(pllfracen * ((RCC->PLL1FRACR & RCC_PLL1FRACR_PLL1FRACN) >> \ RCC_PLL1FRACR_PLL1FRACN_Pos));
As result of [vmov s15, r3], MSP has been corrupted. Red box is the Stack Pointer, and Blue box is MSP. So blue box area should not be changed by [vmov s15, r3]. But as you can see, the Return Address has been corrupted after [vmov s15, r3] has been runned.
Any Possible Suggestion will be welcomed. Thank you.