LPC54608 Board Flash Access

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

LPC54608 Board Flash Access

Jump to solution
1,370 Views
ruiwangm
Contributor II

I am working on a emwin project, to display some images on the lcd, at the beginning, I put the image data in the internal flash, it works good. As I need to use many pictures in the project, later I move the image data to external  board flash, with this statement:

#include <cr_section_macros.h>

__RODATA(BOARD_FLASH) const U8 _acImage_0[5862] = {.....};

but the screen is all black, I debuged the programm, found the address of &_acImage_0[0] is at 0x10000000, which is the start of the BOARD_FLASH (Flash2), but the content of it is all zero, and another finding is, the two satement get different result:

1, 

const U8* pData =&_acImage_0[0];

printf("%x\n", *pData);

2, 

printf("%x\n", _acImage_0[0]);

the first statment gets 0, but the second gets the correct value.

what's the difference between these two methods? in my emwin function, I have to pass the _acImage_0 address as a pointer, so this may be the point.

Labels (2)
0 Kudos
Reply
1 Solution
980 Views
ruiwangm
Contributor II

Now the issue is resolved, it's caused by the un-initialize of the spifi driver, so any data access to the spi flash will return 0.

for the details of initializing the SPIFI driver, please refer to the sample project of  spifi_polling_transfer.

View solution in original post

0 Kudos
Reply
3 Replies
981 Views
ruiwangm
Contributor II

Now the issue is resolved, it's caused by the un-initialize of the spifi driver, so any data access to the spi flash will return 0.

for the details of initializing the SPIFI driver, please refer to the sample project of  spifi_polling_transfer.

0 Kudos
Reply
980 Views
ruiwangm
Contributor II

I can guess the reason why the second sentence gets correct data, maybe because of the compiler refines the procedure, just assign _acImage_0[0] to the printf input, because it can be determined at compile time. right? now I tried many methods, all get zero while reading the content of the board flash.

0 Kudos
Reply
980 Views
jeremyzhou
NXP Employee
NXP Employee

Hi rui wang

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
Please giving a try the following code:
U8* const pData =&_acImage_0[0];
printf("%x\n", *pData);‍‍

Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 Kudos
Reply