Chip_IAP_SetBootFlashBank

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Chip_IAP_SetBootFlashBank

652 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danny_com on Wed Jan 13 04:29:56 MST 2016
Hi,

I have a problem when I am traing to change from my application the boot to second flash bank.
I made a simple application which is loaded in both flash banks of a LPC4357. The application is first running from bank A and when I send a command it execute the Chip_IAP_SetBootFlashBank(IAP_FLASH_BANK_B) and reset the LPC4357. After reste the LPC4357 runs the application from falsh bank B. However, next time I whant to change the boot from flash bank A, executing in this application the Chip_IAP_SetBootFlashBank(IAP_FLASH_BANK_B) and reset the LPC4357, this change is not happening, and the boot remains in flash bank B.

Thanks
Labels (1)
0 Kudos
3 Replies

509 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danny_com on Thu Jan 14 09:22:48 MST 2016
Thank you!

Yes this was the problem!
0 Kudos

509 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by michele sponchiado on Thu Jan 14 07:33:39 MST 2016
Hi, I was using this sequence too, and this is the code which works for me:
void set_bootable_bankA(void)
{
unsigned int retcode;
Chip_IAP_Init();
console_uart_log(enum_console_log_info,__func__,"set bank A bootable");
TIM_Waitms(300);
__disable_irq();
retcode = Chip_IAP_SetBootFlashBank(0);
if (retcode != IAP_CMD_SUCCESS) {
console_uart_log(enum_console_log_error,__func__,"Command Chip_IAP_SetBootFlashBank failed to execute, return code is: %x", retcode);
}
TIM_Waitms(300);
__enable_irq();
}


If I wasn't calling the Chip_IAP_Init(), sometimes the setboot... won't succeed, maybe this is the point?

BTW, right now, I use no more the switch between bank A and bank B via Chip_IAP_SetBootFlashBank because I have managed to have a fixed boot bank, from where my application always boots, and an application bank where I switch to after the boot has done his checks.
0 Kudos

509 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danny_com on Wed Jan 13 04:36:10 MST 2016
In the first post I put: However, next time I whant to change the boot from flash bank A, executing in this application the Chip_IAP_SetBootFlashBank(IAP_FLASH_BANK_B) and reset the LPC4357, this change is not happening, and the boot remains in flash bank B.
but it is: However, next time I whant to change the boot from flash bank A, executing in this application the Chip_IAP_SetBootFlashBank(IAP_FLASH_BANK_A) and reset the LPC4357, this change is not happening, and the boot remains in flash bank B.
0 Kudos