Assuming you are able to compile and link it as you want, then you can use OpenOCD/GDB to load the program (e.g. to SPIFlash, to scratchpad memory, to DDR-backed memory) just as you can with the SiFive embedded systems. However you have a lot more decisions to make regarding where the code will reside, how caching will interact with your bare metal program, when the caches will be enabled, etc (these are tasks which are, in the standard flow, handled by the different boot stages).
To load a program in general is simply a matter of connecting OpenOCD using the
.cfg script provided in
freedom-u-sdk, launching gdb pointing to your compiled
.elf file, and doing
load. Depending on where you have linked your code sections you will have more or less success,. We aren’t currently providing baremetal support in the SDK for this because there are so many possible variations.
Note that if you overwrite your SPIFlash you’ll interfere with the usual Linux boot flow so you probably want to understand how to restore that before doing so.