Rev 2804 Rev 2805
1 /*------------------- DUMMY BOOT LOADER --------------------------------------------*/ 1 /*------------------- DUMMY BOOT LOADER --------------------------------------------*/
2 #define FLASH_BLOCK_SIZE getenv("FLASH_ERASE_SIZE")/2 // Minimal length of Flash Block Size 2 #define FLASH_BLOCK_SIZE getenv("FLASH_ERASE_SIZE")/2 // Minimal length of Flash Block Size
3 #define RESERVED_BLOCKS 53 // Number of reserved flash blocks for BootLoader 3 #define RESERVED_BLOCKS 53 // Number of reserved flash blocks for BootLoader
4 #define LOADER_RESERVED (getenv("PROGRAM_MEMORY")-(RESERVED_BLOCKS*FLASH_BLOCK_SIZE)) // begining of BootLoader 4 #define LOADER_RESERVED (getenv("PROGRAM_MEMORY")-(RESERVED_BLOCKS*FLASH_BLOCK_SIZE)) // begining of BootLoader
5   5  
6 #BUILD(INTERRUPT=FLASH_BLOCK_SIZE) // Redirect Interrupt routine above first flash block 6 #BUILD(INTERRUPT=FLASH_BLOCK_SIZE) // Redirect Interrupt routine above first flash block
7 #ORG 4,5 7 #ORG 4,5
8 void JumpToTheInterrupt() // Jump to the Interrupt Handler 8 void JumpToTheInterrupt() // Jump to the Interrupt Handler
9 { #asm GOTO FLASH_BLOCK_SIZE #endasm } 9 { #asm GOTO FLASH_BLOCK_SIZE #endasm }
10 #ORG 6,FLASH_BLOCK_SIZE-1 {} // First Flash block is reserved 10 #ORG 6,FLASH_BLOCK_SIZE-1 {} // First Flash block is reserved
11   11  
12 #ORG LOADER_RESERVED,getenv("PROGRAM_MEMORY")-1 auto=0 12 #ORG LOADER_RESERVED,getenv("PROGRAM_MEMORY")-1 auto=0
13 #SEPARATE 13 #SEPARATE
14 void dummy_main() // Main on the fix position 14 void dummy_main() // Main on the fix position
15 { 15 {
16 reset_cpu(); 16 reset_cpu();
17 } 17 }