Hello,
I'm working with the AT91SAM9361 controller. Moreover I installed a nor flash (where the real program is stored) and a small data flash (where a small bootloader is stored. Among other things, the bootloader should check if the arm vectors (at the beginning of each code) are valid). If this code is valid the program stored in the nor flash should be executed.
I want to use two seperate memories, so that everyone is able to load a new update of the real program via the bootloader in the dataflash in the nor flash.
How is it possible to start the application from the bootloader in the nor flash? Do I have to set the PC to the beginning of the nor flash? Which are the steps to execute this programm?
I'm not working with an operating system.
best regards Hans
ok the bootloader in the data flash works.
But could you tell me the way I have to write the jump instruction?
I copy the first 32Bytes (arm vectors) to 0x00000000 with memcpy()
int main(void) { void (*functionptr)( void ) = 0x0; //... //copy the arm vectors memcpy((char *)0x00000000, (char *)(0x10000000), 32); //generate jump instruction to 0x10000000???? //jump to 0x00000000 functionptr(); return 0; }
The problem is that I have to place the jump instruction behind the last arm vector and I don't know how to do that...
__asm { //JMP 0x10000000 }