A fault is generated when I try to change a IOCON settings of following pins:
Below you can see the part of the code that generate an error, or sometimes also a stuck.
void main(void) {
uint32_t regValue;
/* Init board hardware. */
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
/* Init FSL debug console. */
BOARD_InitDebugConsole();
#endif
IOCON->PIO[0][23] = 256;
IOCON->PIO[0][24] = 256;
IOCON->PIO[0][25] = 256;
IOCON->PIO[0][26] = 256;
IOCON->PIO[0][27] = 256;
IOCON->PIO[0][28] = 256;
gpio_pin_config_t DUT_SYNCDAC_config = {
.pinDirection = kGPIO_DigitalOutput,
.outputLogic = 0U
};
/* Initialize GPIO functionality on pin PIO0_28 (pin M9) */
GPIO_PinInit(GPIO, 0U , 28U, &DUT_SYNCDAC_config);
This error doesn't appear and all the FW works if select Link Applciation to RAM and run the code in debug mode. Why?
解決済! 解決策の投稿を見る。
Hi,
This is spifi flash hardware circuit.
As you can see that P0_23, P0_24, P0_25, P0_26, P0_27, P0_28 pins function as SPIFI module pins, the LPC54018 does not have on-chip flash, for each instruction, it reads code from the spifi flash via above pins and execute. When you configure above pins in GPIO or whatever, the binary code reading from spifi flash is incorrect, when the wrong binary code is executed, a hardware fault will happen.
In conclusion, you can not configure the P0_23, P0_24, P0_25, P0_26, P0_27, P0_28 pins in application code.
Hope it can help you
BR
XiangJun Rong
Hi,
Thanks for the answer, I already know the architecture of LPC54S018. But It's still strange to me.
The Flash is used to store the binary FW, but at the boot of MCU the binary should be loaded on the MCU RAM and at the end of the boot the microcontroller should release the FLASH
Am I wrong?
Thank you!
Resolved! In this way!
Plain load image is the solution to release the external FLASH.