Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 123978

Forum Post: RE: C5535 Bootloading from SPI flash with 2 images at different sector addresses

$
0
0

[quote user="Ron"]

Basically I would be copying words from SPI flash to RAM

[/quote]

Correct.

 

[quote user="Ron"]

how do I give control to the new loaded program then ?

[/quote]

Usually this is done by the use of a function pointer in C.  You would assign the address of the entry point in your application image to the function pointer and then your secondary bootloader would then call that function pointer.  Something like the following.

static void (*appEntry)();
unsigned int entryPoint = 0;

 

<somewhere within your bootloader after copying the image to RAM and assigning the address to the variable entryPoint, you then:

/* Giving control to the application */

appEntry = (void (*)(void)) entryPoint;
(*appEntry)( );

 

 


Viewing all articles
Browse latest Browse all 123978

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>