LPC4370 SPIFI initializing fail (boot from SPIFI)

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

LPC4370 SPIFI initializing fail (boot from SPIFI)

1,063 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by datdds on Thu Mar 17 05:58:35 MST 2016
Sorry my English is not good.
I'm using LPCLINK2 as LPC4370 evaluation board.
I try to rewrite SPI Flash memory ,after boot from SPIFI.

Debugging below code, LPCSPIFILIB library use model example



(main() located on SRAM.)
int main(void)
{
SystemCoreClockUpdate();
Board_Init();

// spifi initialize
/* Initialize LPCSPIFILIB library, reset the interface */

spifiInit(LPC_SPIFI_BASE, true);

/* Register the family for the device */
spifiRegisterFamily(spifi_REG_FAMILY_CommonCommandSet);

/* Return the number of devices this library supports */
int idx = spifiGetSuppFamilyCount();

/* Get required memory for detected device, this may vary per device family */
uint32_t memSize = spifiGetHandleMemSize(LPC_SPIFI_BASE);
if (memSize == 0) {
    /* No device detected, error */
}

uint32_t *lmem = malloc(memSize);

/* Initialize and detect a device and get device context */
SPIFI_HANDLE_T * pSpifi = spifiInitDevice(&lmem, sizeof(lmem), LPC_SPIFI_BASE, SPIFLASH_BASE_ADDRESS);
if (pSpifi == NULL) {
    /* Error initializing device */
-->while(1);
}




It has entered the while(1); loop. Why?
In addition.Oddly all memory looks as 0x2000c000

Original Attachment has been moved to: memory_test.zip

Labels (1)
0 Kudos
4 Replies

609 Views
lpcxpresso_supp
NXP Employee
NXP Employee

There is another thread running on this issue at the moment in the LPCXpresso IDE forum : https://community.nxp.com/thread/434100 

0 Kudos

609 Views
chrisbelsky
Contributor I

Hello,

Did you ever find a solution to this problem?  If so, could you please update this post?  

Thanks,

0 Kudos

609 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos

609 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bavarian on Thu Apr 07 08:17:41 MST 2016
Can you debug this project?
Then it would be good to step into the function spifiInitDevice() and find out where it fails. There are several action which can return an error.
The map file of your project looks rather ok, it seems that all relevant objects are in RAM.

I don't know what you mean with "all memory looks as 0x2000c000".

Regards,
NXP Support Team
0 Kudos