We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi I'm trying to create some code that needs rwx, but only about 8 bytes. Is there any way to do this and how Thanks
We don't even know what processor you have - if there are any memory protection involved.
But you can normally place code in RAM. Both automatically using the linker configuration, or manually by writing instructions to an array and then cast the address of this array as a function pointer - the important thing with casting is to consider ARM or thumb instructions, based on alignment.
The processor is Cortex-M3, I've tried copying code instructions to 0x20000000 but when jumping to that address it throws a error,access violation of execute/read. In the linker option tried setting -rw-base 0x20000000 to -rwx-base 0x20000000 but it doesn't understand "x" or "e".
On the memory map address 0x184-0x383 is rwx but can't copy, does it need to be in supervisor mode. Thanks