How to write (sector 0 to sector 15) internal flash in LPC1768.?

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

How to write (sector 0 to sector 15) internal flash in LPC1768.?

1,916 Views
md712538
Contributor II

I want to write code area of internal flash i am using lpc1768 mcu. I trying to write sector 0 of internal flash by using IAP command but return error number 9 failed to prepare sector.

So please help me how can i write sector 0 to sector 15 by using IAP command.

Thanks in advance.

Labels (1)
10 Replies

1,403 Views
MarceloMelo
Contributor I

Hello!! 

I'm trying to do this on LPC1766, do you have any news about this?

Best Regards

0 Kudos

1,711 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
I'm afraid it's impossible to write or erase the first few sectors like sector 0,1, etc, as these sectors are already occupied by the codes.
The IAP command is available to write and erase the sectors that are away from the location of the codes.
Hope this is clear.

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

1,711 Views
md712538
Contributor II

Hello Sir,

First of all thanks you for immediate response.

Sir i want to update my firmware (over the air) so please give me any idea

to write sector 0 to sector 15.

Sector 0 to 15 can be write any how??

If this is possible any how so please tell me how can i write?

If this is not possible so please tell me but why?

Thanks in advance.

0 Kudos

1,711 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Regarding your application, it needs to remap the code to RAM from the flash at first, then calls the IAP commands to update the content of the flash, just as Con Verse said.

Hope this is clear.

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.
-------------------------------------------------------------------------------

1,711 Views
md712538
Contributor II

Hello Sir,

Thank you for your reply.

How can i map code flash to ram?

How can i run code from ram?

Please provide me any code in which copy code in ram to flash.

Thanks.

0 Kudos

1,711 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

Thanks for your reply.
Please refer to the post to learn how to relocate code from flash to RAM.

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

1,711 Views
converse
Senior Contributor V

Which tools ? AN10866 describes how to do it for Keil. For mcuxpresso see https://community.nxp.com/thread/475381 

1,711 Views
md712538
Contributor II

I am using MCU xpresso.

Please provide me any demo code for how to copy the code from flash to ram?

And then how can i run the code from ram?

Thank you for your support.

0 Kudos

1,711 Views
converse
Senior Contributor V

You can use IAP to write to any flash sector. This is described in the chip User Manual and AN10866. There is also lots of info about IAP on this forum. Remember you need to run the code from RAM.

1,711 Views
md712538
Contributor II

I already use iap cmd and successfully read write erase sector 16 to 29 .

But how can i run the code from ram?

Thanks

0 Kudos