Advertisement
hak8or

AT91 Bootstrap modifications

Feb 25th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.91 KB | None | 0 0
  1.     // Put me in display banner!
  2.     char *version = "AT91Bootstrap";
  3.     char *ver_num = " "AT91BOOTSTRAP_VERSION" ("COMPILE_TIME")";
  4.  
  5.     usart_puts(version);
  6.     usart_puts(ver_num);
  7.     usart_puts("\nEdited by hak8or!\n");
  8.     usart_puts("Yey custom code execution and toolchain verification! :D\n");
  9.     usart_puts("======--======--======--======\n");
  10.  
  11.  
  12.  
  13.     // ==============================================
  14.     // Used to see contents of data at address.
  15.     int* data = JUMP_ADDR;
  16.     int* DRAM_top = 0x24000000;
  17.  
  18.     dbg_info("Doing a quick memory test (SAM-BA says all is ok but just incase) ... \n");
  19.  
  20.     dbg_info("Contents at %d : %d \n", JUMP_ADDR, *data);
  21.     dbg_info("Contents at %d : %d \n", JUMP_ADDR + 4, *(data + 1));
  22.     dbg_info("Contents at %d : %d \n", JUMP_ADDR + 8, *(data + 2));
  23.     dbg_info("Contents at %d : %d \n", DRAM_top - 2, *(DRAM_top - 2));
  24.     dbg_info("Contents at %d : %d \n", DRAM_top - 1, *(DRAM_top - 1));
  25.  
  26.     dbg_info("Writing 0xF0F0F0FA, 0xB1B2B3B4, and 0xB1B2B3B4 to JUMP_ADDR.\n");
  27.     dbg_info("Writing 0x01234567 to last two words in DRAM..\n");
  28.  
  29.     *data = 0xF0F0F0FA;
  30.     *(data + 1) = 0xB1B2B3B4;
  31.     *(data + 2) = 0xB1B2B3B4;
  32.     *(DRAM_top - 2) = 0x01234567;
  33.     *(DRAM_top - 1) = 0x01234567;
  34.  
  35.     dbg_info("Contents at %d : %d \n", JUMP_ADDR, *data);
  36.     dbg_info("Contents at %d : %d \n", JUMP_ADDR + 4, *(data + 1));
  37.     dbg_info("Contents at %d : %d \n", JUMP_ADDR + 8, *(data + 2));
  38.     dbg_info("Contents at %d : %d \n", DRAM_top - 2, *(DRAM_top - 2));
  39.     dbg_info("Contents at %d : %d \n", DRAM_top - 1, *(DRAM_top - 1));
  40.  
  41.     if ( *data != 0xF0F0F0FA || *(data + 1) != 0xB1B2B3B4 || *(data + 2) != 0xB1B2B3B4 || *(DRAM_top - 2) != 0x01234567 || *(DRAM_top - 1) != 0x01234567)
  42.         dbg_info("         --- MEMORY TEST FAILED! D: \n");
  43.     else
  44.         dbg_info("         --- MEMORY TEST SUCCEDED! :D \n");
  45.  
  46.     dbg_info("---^^^^^^--- done with mem test\n");
  47.     // Put me right before init_loadfunction();
  48.     // ==============================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement