LPC1768 Flash limitation

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

LPC1768 Flash limitation

748 Views
ReneB
Contributor II

Hello,

I'm using LPC1768 with LPCXpresso 8.1.4.

There is a bootloader on the low flash 0x -0x10000 (64kB).

So the size of the main code is limited to 448kB. The memory is declared in MCU Settings (Project properties) :

ReneB_0-1695391701593.png

 

and the linkscripts for memory is the following:

ReneB_1-1695387041056.png

 

After build with Size optimization option (-s), the code size is 413404bytes (90.11% out of 448kB). so there is is almost 10% free space. the image is running as desired.

ReneB_0-1695391349341.png

 

After adding some extra code, the size goes up to 415204bytes (90.507% out of 448kb). At this moment the code image is not running anymore. If I keep the new extra code in place and comment some other lines of code to reduce the size back close to 90%, it runs again. I made several tests to confirm that the issue is not with the latest added code but with the size of the image.

The flash memory declaration looks correct to me.
What could be wrong ?
Nb: still with LPCXpresso V8.1.4 because i'm using a library which doesn't work properly with MCUXpresso, no time to search why yet...

Thank's for your help!

0 Kudos
3 Replies

679 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @ReneB 

How about debug to check where is the issue?

To do this, edit the launch configuration (by double clicking on the .launch file that will have been created in your project) and change the "reset handling" option to "SOFT", refer to:

https://community.nxp.com/t5/LPC-Microcontrollers/Lpc845-app-code-can-t-debug-after-bootloader/m-p/8...

 

BR

Alice

0 Kudos

615 Views
ReneB
Contributor II

Thank's Alice.

I don't have any issue in Debug, only in Release.

To debug I set the Flash start address at 0x00000 and size to 0x80000 (512kB). Optimization is -Og.

For release, the flash starts at 0x10000 and size is 0x70000 (448kb). 64kb are reserved for bootloader. Optimization is -Os.

I didn't find a way to tell the debugger that application starts at 0x10000, so I can't debug the "Release" version. Maybe there is a way ?

By the way, here are the options for debugging:

ReneB_0-1696232213990.png

no "SOFT" option...

Best regards

0 Kudos

546 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @ReneB 

How about use MCUXpresso IDE?

If still can not work, send your two project to me.

 

 

BR

Alice

0 Kudos