This is a bootloader application , when app "okays" an upgrade i want to restart the micro, this brings me back into the bootloader. So the hardware is reconfigured with same settings. This is a know issue that the micro when returning from a restart will run clow but unable reconfigure?
code //////////////////////////////////////////////// // Configure Reset Controller *AT91C_RSTC_RMR = 0xA5000201;
// Configure WDT *AT91C_WDTC_WDMR = 0x3FFFAFFF; // Disable Watchdog
// Configure EFC *AT91C_MC_FMR = 0x00480100; // FMCN=72/FWS=1/NEBP=0/PROGE=0/LOCKE=0/FRDY=0
// Configure oscillator *AT91C_PMC_MOR = 0x00000601; // Enable main oscillator (8MHz crystal) while(!(*AT91C_PMC_SR & AT91C_PMC_MOSCS)); // wait for main oscillator to stabilize
// Configure PMC *AT91C_PMC_MCKR = 0x00000007; // PRES=1/CSS=3 (MCK=48MHz) while(!(*AT91C_PMC_SR & AT91C_PMC_MCKRDY));
// Configure PLL *AT91C_PMC_PLLR = 0x10171C02; // USBDIV=1/MUL=23/OUT=0/PLLCOUNT=28/DIV=2 (8MHz crystal) while(!(*AT91C_PMC_SR & AT91C_PMC_LOCK)); // wait for pll to lock
*AT91C_PMC_SCER = 0x00000081; // Enable USB and Processor clock *AT91C_PMC_PCER = 0x000008F4; // Enable PIOA,ADC,SPI,US0,US1,USB
////////////////////////////////////////////
hope someone can help!!!
thanks John