Baremetal program loading

Is it possible to create a baremetal application to run on the unleashed ?
The documentation describes how to load linux and get that running on the 4 cores

Suppose I am writing an RTOS which is MP aware, how would I go about implementing this, loading into the platform, and having the ability to debug code running on all 4 cores - in addition to the monitor core


yes, i would like to know this also…dd

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.

ok, thanks. this helps.
i assume u work for si5.
i am curious why the sdk does not have describe a way
to bare-metal boot. to be sure, the subject is a pandora’s box.
but we must move in this direction.
the nsa financed linux kernel development, so nothing is safe
in that os or any other monolithic kernel.
no os is the way to go.
with the risc system-on-a-chip being much cleaner,
bare-metal becomes do-able. and the h/w becomes
accessible to the programmer.
honestly, no chip is open with linux on top.
linux is much more complicated and unstable than the
chip it is running on!
the community can work on better alternatives…dd