LPC55S69 : flash_iap example on A2 board

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

LPC55S69 : flash_iap example on A2 board

845 Views
EugeneHiihtaja
Senior Contributor I

Hello !

Does flash_iap1 example should work on EVK  A2 revision ?

I have read community and see this example might corrupt FPR and I have changed

erase/write address :

//destAdrss = pflashBlockBase + (pflashTotalSize - (PAGE_INDEX_FROM_END * PflashPageSize));
destAdrss = 0x2C000;
//destAdrss = 0x98000; // OR

PRINTF("\r\nCalling FLASH_Erase( 0x%x ) API...\r\n",  destAdrss);

And I have activated hardfault and it hapens immideatelly:

Initializing flash driver...
Flash init successfull!!. Halting...

PFlash Example Start
kFLASH_PropertyPflashBlockBaseAddr = 0x0
kFLASH_PropertyPflashSectorSize = 32768
kFLASH_PropertyPflashTotalSize = 655360
kFLASH_PropertyPflashPageSize = 0x200

Calling FLASH_Erase( 0x2c000 ) API... // Added address print

Entering HardFault interrupt!

Does this example should work with A2 and can flash API even to be used on nonsecure world ?

Regards,

Eugene

Labels (1)
0 Kudos
9 Replies

637 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eugene Hiihtaja

Thank you for your interest in NXP Semiconductor products and
the opportunity to serve you.
To provide the fastest possible support I want to point you to a
similar question that has been answered on our NXP community.
Please refer to https://community.nxp.com/thread/521240
to view the details.

Have a great day,
TIC

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

637 Views
EugeneHiihtaja
Senior Contributor I

Hi jeremyzhou‌ !

Thank you !

Do you know any other fsl_drivers or other SDK2.7.0 components what have any type of errors ?

I would like to replace all of them already.

Regards,

Eugene

0 Kudos

637 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eugene Hiihtaja,

Until now, I only have the driver file for the flash_iap.

Have a great day,
TIC

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

637 Views
EugeneHiihtaja
Senior Contributor I

Hi jeremyzhou !

Could you also comment what kind of addresses  should be used if Flash API is used on Secure side ?

Should the be like 0x2C000 or 0x1002C000 ?

Looks like pointer to Flash API is from Secure address space, it means Flash API can be used on Secure side only.

I have problem to use Flash API on secure side and due multiple Hardfaults and study all preconditions for Flash APIs.

Adsress spaces range, disable interrupts,disable flash prefetch and acceleration.

Execute those with secure nonprivileged righs.

Secure settings for Bootroam areas e.g Secure provileged or not and etc.

If you have detail info about those topics, share to me as well.

Regards,

Eugene

0 Kudos

637 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eugene Hiihtaja,

Thanks for your reply.
1) Should be used if Flash API is used on the Secure side?
-- In my opinion, it's determined by the secure attribute of the target memory range.

Have a great day,
TIC

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

637 Views
EugeneHiihtaja
Senior Contributor I

Hi jeremyzhou‌ !

But in flash_iap SDK example , what is running in secure mode , use nonsecure addresses for Erase/Program operations.

I have tried 0x1002C000 address for Erase and it returns error.

Regards,

Eugene

0 Kudos

637 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Eugene Hiihtaja,

I don't think the Flash_IAP demo from the SDK library would run in the secure condition actually, so it will receive an error response after calling Flash ROM API for the target area in the secure memory range.

Have a great day,
TIC

 

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

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

637 Views
EugeneHiihtaja
Senior Contributor I

Hi jeremyzhou‌ !

But what about other conditions ?

Should I disable all interrupts when call FLASH_Erase/Program/Verify commands ?

During erase/program flash memory is not accessible and it shouldn't be any ISR code what is running from flash memory .

Or flash API should be called in privileged mode and it disable interrupts itself ?

Flash API should wait in RAM loop end of flash operation and where it is located ? I should know and reserve/not use this memory area.

Regards,

Eugene

0 Kudos

637 Views
EugeneHiihtaja
Senior Contributor I

Hi !

API returns error 102 e.g address out of range

FLASH_Program ( 102 ) at 0x1002C000 of 512 bytes failed!

102 Unknown status

So we should use nonsecure address range.

Is this so ?

Regards,

Eugene

0 Kudos