I have a running application on the Embedded Artists LPC4088 board, which uses the SPIFI FLASH from Winbond.
This works fine.
We have then made our own custom board with a new SPIFI FLASH: SST26VF032 from Microchip.
This is on the supported list in the user manual.
We have also changed the MCU to LPC4076, but this should not have anything to say.
The problem is that when we try to initialize the SPIFI FLASH, the call to the ROM function spifi_init() returns an error 0x2000A.
We have tried different settings for the SPIFI, but it just keeps returning 0x2000A.
And we can not find any manual/API description for the ROM API, so we have no clue what the error code tries to tell us...
So, the questions are:
- What does the 0x2000A mean?
- Where can I find the SPIFI ROM API description?
- Any good ideas of why it fails with the new SPIFI device?
Below is the init code, which calls the spifi_init().
ret = 0x2000A after the call.
Thanks in advance for any help !
/* Initialise SPIFI */
LPC_SC->PCONP |= ( 1UL << 16 ); /* enable SPIFI power/clock */
LPC_IOCON->P2_7 &= ~( 7UL << 0 );
LPC_IOCON->P2_7 |= ( 5UL << 0 ); /* SPIFI_CSN = P2.7 (FUNC 5) */
LPC_IOCON->P0_22 &= ~( 7UL << 0 );
LPC_IOCON->P0_22 |= ( 5UL << 0 ); /* SPIFI_CLK = P0.22 (FUNC 5) */
LPC_IOCON->P0_15 &= ~( 7UL << 0 );
LPC_IOCON->P0_15 |= ( 5UL << 0 ); /* SPIFI_IO2 = P0.15 (FUNC 5) */
LPC_IOCON->P0_16 &= ~( 7UL << 0 );
LPC_IOCON->P0_16 |= ( 5UL << 0 ); /* SPIFI_IO3 = P0.16 (FUNC 5) */
LPC_IOCON->P0_17 &= ~( 7UL << 0 );
LPC_IOCON->P0_17 |= ( 5UL << 0 ); /* SPIFI_IO1 = P0.17 (FUNC 5) */
LPC_IOCON->P0_18 &= ~( 7UL << 0 );
LPC_IOCON->P0_18 |= ( 5UL << 0 ); /* SPIFI_IO0 = P0.18 (FUNC 5) */
g_spifi_mem_base = (uint32_t)p_flash_base;
/* get SPIFI API table pointer */
g_spifi = ROM_DRIVERS_PTR->pSPIFID;
// ret = g_spifi->spifi_init( &g_spifi_obj, 4, S_FULLCLK + S_RCVCLK, 80 );
ret = g_spifi->spifi_init( &g_spifi_obj, 0, S_HALFCLK + S_RCVCLK, 24 );