Hello,
I'm currently working on a project where I need to store data in Flash so I need to configure the clock for the Serial Peripheral Interface Flash Interface (SPIFI) on an NXP microcontroller. I'm using LPC54S018-EVK board. However, when I added the clock configuration code, the microcontroller started hanging or crashing.
Here's the code snippet that causes the issue:
CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, 0U, true); /*!< Reset SPIFICLKDIV divider counter and halt it */
CLOCK_SetClkDiv(kCLOCK_DivSpifiClk, 1U, false); /*!< Set SPIFICLKDIV divider to value 1 */
Has anyone encountered a similar issue when configuring the clock for the SPIFI interface? How can I properly configure the clock without causing the microcontroller to hang or crash?
From my understanding, it's essential to enable SPIFI peripherals in the clock configuration before utilizing them. However, considering that my binary is also uploaded to the SPI Flash memory, I'm unsure whether resetting this clock configuration could pose a problem. Is it possible that resetting the clock configuration for SPIFI peripherals could disrupt the operation of my uploaded binary (I can see XIP_IMAGE flag in my preprocessor configuration)?
Hi bzdan,
There is spifi demo code spifi_polling_transfer under SDK package which includes spifi interface clock configuration. Please take look at it.
The default SPIFI clock speed is 24MHz. I can use below code to change SPIFI clock to 96MHz without issue
Here SPIFI clock source is FRO96, clock divider is 1. In debugger we can see SPIFI clock speed 96MHz
Hope this helps,
Jun Zhang