2013-08-16 07:06 AM
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.2013-08-16 10:36 AM
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