Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

SDK • Re: Flashing Partial Image

$
0
0
I did some adventuring in having 'overlays' which could be loaded separately to the main code which is very similar to what you are looking for.

The main problem I found when building those overlays as Pico SDK projects was that builds may cause the destination of calls to SDK and utility functions to be different to where the original main code has them so uploading just the overlay results in a crash when executed.

You need to figure out how to have the overlay compilation use the addresses of where things are in the original main or have some jump vector table in main so you can call known locations. Both should be possible but I never progressed to doing that.

A jump table is likely easier to implement but adds some execution time and space overhead. Having direct calls from the overlay into main requires determining the location of where things are in main. The '.dis' file of the main build can help with that, You could also possibly use the '.elf' file. Knowledge of Python or other scripting language will likely be useful here.

One issue which caught me out is you need to ensure the compilation of main includes, and doesn't optimise away and remove, functions which may get called by a future overlay. Obvious with hindsight but a D'Oh! moment at the time.

Statistics: Posted by hippy — Sat Apr 19, 2025 6:51 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles