TheTimBrick
Member
Hello all! I am currently working on a project where I would like to have different 'applications' to choose from and load them from from say an SD card into an array and execute it. I found this neat thread https://forum.pjrc.com/threads/24302-How-to-execute-code-in-SRAM-(Teensy-3) which shows how to execute Thumb-2 Instructions from RAM. The problem is I would like to be able to program the 'application' in C++, compile it, then upload it to the SD card and load it into ram and execute instead of writing the machine code / assembly and assembling it myself. The main problem I am facing, well, not really a problem but what I have came up with is that the Teensy will jump to an address similar to 0x80000000 and then start executing from there. I don't know for sure but I believe that what the compiler outputs is the full program aligned to fit within that range (I could be completely wrong). What I want to eventually get to is just a bin file that has the main app function in it (e.g. int app() ) and just copy that to an array and execute it, and then when app() returns it hands control back to the 'App loader' I have most knowledge in software instead of hardware and architecture so any help would be appreciated!