At the bootloader, LPC1788 communicates with the bluetooth (HC05) module through UART1. After jumping to the code in the RAM, the UART1 would not work and nothing will be ready on its interrupts. My jumping code is as follows:
nand_readPartition(0, byte_wr_ptr, 29996); __disable_irq(); UART_TxCmd(UART_1, DISABLE); NVIC_DisableIRQ(UART1_IRQn); UART_DeInit(UART_1); SysTick_Config(0); //NVIC_DeInit(); //NVIC_SCBDeInit(); NVIC_SetVTOR(USER_PROGRAM_START); boot_jump(USER_PROGRAM_START);
everything is correct, i uses CAN and its interrupts. the interrupts for CAN is works fun. it means the vector interrupts remap correctly.
Best Regards, Mostafa
Thank you for your really fast reply. My entry point for both of the code (bootloader and code in the RAM) is the same:
void SystemInit (void) { #if (FLASH_SETUP == 1) /* Flash Accelerator Setup */ LPC_SC->FLASHCFG = FLASHCFG_Val|0x03A; #endif #if (CLOCK_SETUP) /* Clock Setup */ LPC_SC->SCS = SCS_Val; if (SCS_Val & (1 << 5)) { /* If Main Oscillator is enabled */ while ((LPC_SC->SCS & (1<<6)) == 0);/* Wait for Oscillator to be ready */ } LPC_SC->CLKSRCSEL = CLKSRCSEL_Val; /* Select Clock Source for sysclk/PLL0*/ #if (PLL0_SETUP) LPC_SC->PLL0CFG = PLL0CFG_Val; LPC_SC->PLL0CON = 0x01; /* PLL0 Enable */ LPC_SC->PLL0FEED = 0xAA; LPC_SC->PLL0FEED = 0x55; while (!(LPC_SC->PLL0STAT & (1<<10)));/* Wait for PLOCK0 */ #endif #if (PLL1_SETUP) LPC_SC->PLL1CFG = PLL1CFG_Val; LPC_SC->PLL1CON = 0x01; /* PLL1 Enable */ LPC_SC->PLL1FEED = 0xAA; LPC_SC->PLL1FEED = 0x55; while (!(LPC_SC->PLL1STAT & (1<<10)));/* Wait for PLOCK1 */ #endif LPC_SC->CCLKSEL = CCLKSEL_Val; /* Setup Clock Divider */ LPC_SC->USBCLKSEL = USBCLKSEL_Val; /* Setup USB Clock Divider */ LPC_SC->EMCCLKSEL = EMCCLKSEL_Val; /* EMC Clock Selection */ LPC_SC->PCLKSEL = PCLKSEL_Val; /* Peripheral Clock Selection */ LPC_SC->PCONP = PCONP_Val; /* Power Control for Peripherals */ LPC_SC->CLKOUTCFG = CLKOUTCFG_Val; /* Clock Output Configuration */ #endif LPC_SC->PBOOST |= 0x03; /* Power Boost control */ #ifdef __RAM_MODE__ SCB->VTOR = 0x10000000 & 0x3FFFFF80; #else SCB->VTOR = 0x00000000 & 0x3FFFFF80; #endif Activate_ProtocolPin(PROTOCOL_KWP_RELAY, OFF_MODE); Activate_ProtocolPin(PROTOCOL_TYPE1_RELAY, OFF_MODE); Activate_ProtocolPin(PROTOCOL_CAN_RELAY, OFF_MODE); Activate_OBDPin(1, OFF_MODE); Activate_OBDPin(2, OFF_MODE); Activate_OBDPin(3, OFF_MODE); Activate_OBDPin(6, OFF_MODE); Activate_OBDPin(7, OFF_MODE); Activate_OBDPin(8, OFF_MODE); Activate_OBDPin(9, OFF_MODE); Activate_OBDPin(10, OFF_MODE); Activate_OBDPin(11, OFF_MODE); Activate_OBDPin(12, OFF_MODE); Activate_OBDPin(13, OFF_MODE); Activate_OBDPin(14, OFF_MODE); Activate_OBDPin(15, OFF_MODE); Activate_LEDPin(LED_FAULT,OFF_MODE); Activate_LEDPin(LED_BUZZER,OFF_MODE); Activate_LEDPin(LED_CONNECT,OFF_MODE); sdram_init(); }
the code in the RAM is running correctly when i dependently program the ARM. But when i jump from bootloader, it seems all thing is correct, for example, CAN receive interrupt is working. But i do not use the CAN recieve interrupt in the bootloader!!!