cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f4 Discovery - run CODE from USBFS without O/S?

angus
Associate
Posted on August 16, 2013 at 16:06

Hi all,

Simple question, I hope.. I understand how to read raw data from a USBFS device on the 2nd USB port, however is it possible to load + run code from a USBFS device connected to the port? I understand that the bootloader will run from Flash first, that's fine, what I'm thinking about is something analogous to the dynamic-loader present in every OS (dylibs on linux, DLLs on Windows etc..), so the bootloader would look for a binary file on the USB device, load it in to memory & then run the code - is it as simple as loading suitable binary code from USBFS in to system memory & issuing a suitable CALL or JMP machine instruction, or is there more to it than that?

Thanks,

     Angus.
1 REPLY 1
Posted on August 16, 2013 at 19:36

It's certainly possible to load code into RAM and execute it. If your linker has generated fixed address binary code, then you'll need to agree on the addresses, both of the code, and available memory it might want to use. To dynamically load code you'll need a loader which is familiar with ELF, or the object/executable format of your choice.

You could also pass in parameters, and call from C. Look at some IAP examples

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..