Help with load & Executing Code into Stm32 mcu Ram
I have both STM32F1038T6 and STM32F401CC. I have been trying to get a code to run from ram for days now.
Im using arduino ide with stm32duino.
i first create a buffer in ram with malloc then copy the code to the buffer using memcpy. The code is in byte array inside a include file.
Like for example
RamAddr is a byte pointer. Also the above code is in a method function that is called in Arduinos' loop()
The code is copied properly. When functionPtr() is called the Program counter loads the Address of the function (Which is the start of the code) and I can see it when debugging it. However the pc increments normally but nothing happens and if left to run it ends up in WWDG_IRQHandler as pointer by Program counter. The mCode code just blinks PC13 on and off and was built from Stm32CubeIde. I tried the blink program by flashing it directly to mcu and it works.
So am i doing something wrong or missing something? If so how can it be done with examples. Because i want to be able to load code from spi flash or memory card
