Is the stack executable on the STM32F4 MCU? I want to do this:
unsigned int buffer[3];
buffer[0] = 0x10000FA5; //Address: 0x10000FA0
buffer[1] = 0xA0E1; //Address: 0x10000FA4 NOP
buffer[2] = 0xA0E1; //Address> 0x10000FA8 NOP
__asm __volatile__
(
"movw R1, #0x0fa0\n"
"movt R1, #0x1000\n"
"ldr pc, [r1, #0]\n"
);
In the assembly code, I fetch the content at address 0x10000fa0 (buffer[0]) to get my new program counter. The new program counter is 0x10000FA5, which is the address of the content of buffer[1]. In buffer[1] there is now an instruction (NOP) saved. Is this possible to execute?
Edit: I tried it out with GDB but I am getting following exception: prvGetRegistersFromStack (pulFaultStackAddress=0x10000f78 ) from FreeRTOS