Rev 1298 Rev 1300
1 /*------------------- DUMMY BOOT LOADER --------------------------------------------*/ 1 /*------------------- DUMMY BOOT LOADER --------------------------------------------*/
2 #define FLASH_BLOCK_SIZE 32 2 #define FLASH_BLOCK_SIZE 32
3 #define LOADER_RESERVED getenv("PROGRAM_MEMORY")-26*FLASH_BLOCK_SIZE 3 #define LOADER_RESERVED getenv("PROGRAM_MEMORY")-26*FLASH_BLOCK_SIZE
4 #define BUFFER_LEN_LOD 46 4 #define BUFFER_LEN_LOD 46
5 #if FLASH_BLOCK_SIZE != getenv("FLASH_ERASE_SIZE")/2 5 #if FLASH_BLOCK_SIZE != getenv("FLASH_ERASE_SIZE")/2
6 #error Wrong length of the Flash Block Size. getenv("FLASH_ERASE_SIZE")/getenv("FLASH_WRITE_SIZE") 6 #error Wrong length of the Flash Block Size. getenv("FLASH_ERASE_SIZE")/getenv("FLASH_WRITE_SIZE")
7 #endif 7 #endif
8   8  
9   9  
10 #BUILD(INTERRUPT=FLASH_BLOCK_SIZE) // Redirect Interrupt routine above first flash block 10 #BUILD(INTERRUPT=FLASH_BLOCK_SIZE) // Redirect Interrupt routine above first flash block
11 #ORG 4,5 11 #ORG 4,5
12 void JumpToTheInterrupt() // Jump to the Interrupt Handler 12 void JumpToTheInterrupt() // Jump to the Interrupt Handler
13 { #asm GOTO FLASH_BLOCK_SIZE #endasm } 13 { #asm GOTO FLASH_BLOCK_SIZE #endasm }
14 #ORG 6,FLASH_BLOCK_SIZE-1 {} // First Flash block is reserved 14 #ORG 6,FLASH_BLOCK_SIZE-1 {} // First Flash block is reserved
15   15  
16   16  
17 #ORG LOADER_RESERVED,getenv("PROGRAM_MEMORY")-12 auto=0 17 #ORG LOADER_RESERVED,getenv("PROGRAM_MEMORY")-1 auto=0
18 #SEPARATE 18 #SEPARATE
19 void dummy_main() // Main on the fix position 19 void dummy_main() // Main on the fix position
20 { 20 {
21 reset_cpu(); 21 reset_cpu();
22 } 22 }
23   -