LPC54608 Board Flash Access

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC54608 Board Flash Access

跳至解决方案
1,407 次查看
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.

标签 (2)
0 项奖励
回复
1 解答
1,017 次查看
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 项奖励
回复
3 回复数
1,018 次查看
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 项奖励
回复
1,017 次查看
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 项奖励
回复
1,017 次查看
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 项奖励
回复