Hello, I like messing around with some of the odder parts of mbed (mostly because I like messing around with my only ARM processor :) ). Anyway, one of the things I tried doing is loading a file from LocalFileSystem into RAM and then using a function pointer like so:
uint8_t *ram=malloc(filesize);
//load file into ram
void (*MyFunction)(void);
MyFunction=ram;
MyFunction();
However, it seems to just crash after executing MyFunction. I'm not experienced in ARM assembly, but I understand assembly in general(I'd consider myself an expert with x86 assembly). Anyway, I'm not sure what kind of crt0 is put in by the online compiler, but basically what I am doing is making loader.bin that does this and then example.bin that is just a test program that blinks LEDs.
Has anyone done this before and know what else is required to get this to work and for it to return to the "loader.bin" code?
Hello, I like messing around with some of the odder parts of mbed (mostly because I like messing around with my only ARM processor :) ). Anyway, one of the things I tried doing is loading a file from LocalFileSystem into RAM and then using a function pointer like so:
However, it seems to just crash after executing MyFunction. I'm not experienced in ARM assembly, but I understand assembly in general(I'd consider myself an expert with x86 assembly). Anyway, I'm not sure what kind of crt0 is put in by the online compiler, but basically what I am doing is making loader.bin that does this and then example.bin that is just a test program that blinks LEDs.
Has anyone done this before and know what else is required to get this to work and for it to return to the "loader.bin" code?