Hi jeremyzhou<https://community.nxp.com/people/jeremyzhou?et=notification.mention>,
thank you for your support.
1) For the idea of delaying RESETN we plan to test with a reset controller with adjustable delay. In the recent layout we do use a MCP130 with fix delay of about 350ms. I will tell about the results when available.
2) Another and preferred approach is to find a software solution. My hope is based on the observation that after a successful call to spifi_init() the start succeeds always in the following reboots (both cold and warm reset).
For a successful reboot the used sequence is:
- Set device into LPC boot mode
- Load binaries (boot loader and application) using LPCScrypt (v2.0) into FLASH (internal and SPIFI)
- Connect Debugger (w/o device reset)
- Start device (booting from FLASH)
- STOP application using debugger --> while(1) loop after spifi_init() failed [[-- without further actions every other reboot ends here]]
- RESTART application and use debugger to break just before call to spifi_init()
- Step into spifi_init() and through the whole function
- After spifi_init() run free [[--> application start succeeds]]
The init sequence is as follows:
; startup_LPC18xx.s::Reset Handler
Reset_Handler PROC
EXPORT Reset_Handler
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
void SystemInit (void) {
uint32_t *MAM,t;
MAM = (uint32_t *)(LPC_CREG_BASE + 0x120);
t=*MAM;
t &= ~(0xF<<12);
*MAM = t | (FLASH_ACCELERATOR_SPEED<<12);
MAM = (uint32_t *)(LPC_CREG_BASE + 0x124);
t=*MAM;
t &= ~(0xF<<12);
*MAM = t | (FLASH_ACCELERATOR_SPEED<<12);
__disable_irq();
SystemInit_PortPins();
SystemInit_Core();
SystemInit_Clock();
SystemInit_ExtMemCtl ();
SystemInit_SPIFI();
SystemInit_LCD();
SCT_Init();
}
void SystemInit_SPIFI(void) {
EMCClk = CGU_GetPCLKFrequency(CGU_PERIPHERAL_M3CORE)/2;
if (spifi_init(&sobj, 9, S_RCVCLK | S_FULLCLK, EMCClk/1000000)) {
if (spifi_init(&sobj, 9, S_RCVCLK | S_FULLCLK, EMCClk/1000000)) {
while(1);
}
}
}
My attempts to delay the spifi_init() sequence by using loops or timer delays haven’t been successfully yet.
The source code of spifi_init() is not available for me.
I ‘d like any ideas how to proceed. Thank you.
Kind regards
Mathias Monse