Esempio n. 1
0
int main (void)
{
  int err_code = 0;

  // UART init
  UartStdOutInit();

  // Test banner message and revision number
  puts("\nCortex Microcontroller System Design Kit");
  puts(" - Simple memory test - revision $Revision: 243193 $\n");

  temp_data=0;
  hardfault_occurred = 0;
  hardfault_expected = 0;

  if (sram_test()     !=0) err_code |= 1<< 0;
  if (rom_test()      !=0) err_code |= 1<< 1;
  if (boot_rom_test() !=0) err_code |= 1<< 2;
  if (apb_io_test()   !=0) err_code |= 1<< 3;
  if (ahb_io_test()   !=0) err_code |= 1<< 4;


  /* Generate test pass/fail and return value */
  if (err_code==0) {
    printf ("\n** TEST PASSED **\n");
  } else {
    printf ("\n** TEST FAILED **, Error code = (0x%x)\n", err_code);
  }
  UartEndSimulation();
  return 0;
}
Esempio n. 2
0
//int main(void) {
////main function
int main (void) {
  u32 waitForCard = 0;

  // set up avr32 hardware and peripherals
  init_avr32();

 
  print_dbg("\r\n SRAM size: 0x");
  print_dbg_hex(smc_get_cs_size(1));


  cpu_irq_disable();
  /// test the SRAM
  sram_test();

  cpu_irq_enable();

  //memory manager
  init_mem();
  print_dbg("\r\n init_mem");

  // wait for sdcard
  
    print_dbg("\r\n SD check... ");
    while (!sd_mmc_spi_mem_check()) {
      waitForCard++;
    }
    print_dbg("\r\nfound SD card. ");


    // intialize the FAT filesystem
    print_dbg("\r\n init fat");
    fat_init();
    // setup control logic
    print_dbg("\r\n init ctl");
    init_ctl();
  
    /* // initialize the application */
    /* app_init(); */
    /* print_dbg("\r\n init app"); */

    // initialize flash:
    firstrun = init_flash();
    print_dbg("r\n init flash, firstrun: ");
    print_dbg_ulong(firstrun);

    screen_startup();

    // find and load dsp from sdcard
    files_search_dsp();


    print_dbg("\r\n starting event loop.\r\n");

    // dont do startup
    startup = 0;

    while(1) {
      check_events();
    }
}