Fastest way to load a program to an MCU (RISCV)

Yes, all code is written and available on a master flash memory (or other storage medium)

But I want to load the code and execute on a real time MCU, along with tuning parameters calculated on the fly.

The master storage device has way more code that the real time MCU board has on board. So I can’t just save all the code on the real time board itself. What I wanted therefore is the master SBC, which “launches” the proper routine on the MCU (and also manages communication with ground, navigation, swarm rules etc)

So basically, if it detect a storm wind suddenly appearing, it will then tell the flight MCU (slave MCU)to load the new “storm flight routine”, possibly from a storage managed by the Master SBC, and that once the current loop of the current flight rule ends, go to storm flight routine.

e.g.

Slave MCU is currently running normal flight loop: move 1 meter north, check gps, loop

Master sbc will load new loop: detect wind speed, calculate correction to fly north, run motors at 40% pwm duty cycle, ………. many other things … loop

This loading may finish, while, for example, say the slave sbc was in the normal loop, flying 1 meter north. it still has to check gps to finish current loop. Once that is down, instead of returning to the loop, it will go to detecting wind speed of the updated loop and keep doing that loop.

The idea is, that the slave sbc should be able to do this mechanism, without ever knowing that such an updated loop existed. To do a hyperbole that illustrates my point, if aliens from mars somehow beamed a new loop, then the slave sbc should be able to follow it. dont worry about security implication.
How can I achieve that?

Read more here: Source link