Is the stack executable on the STM32F4 MCU? I want to do this:
unsigned int buffer; buffer = 0x10000FA5; //Address: 0x10000FA0 buffer = 0xA0E1; //Address: 0x10000FA4 NOP buffer = 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) to get my new program counter. The new program counter is 0x10000FA5, which is the address of the content of buffer. In buffer 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