Custom bootloader memory config issue

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

Custom bootloader memory config issue

1,021 次查看
BerkantCiftci2001
Contributor II

Hi all,

I am a student Embedded systems and I am trying to make a small custom bootloader work on my LPC1758. What I am trying to do is flash my bootloader between 0x0000 and 0x8000. My next step (for testing purposes) is to flash my application after 0x8000. However, when I let the program run, It will crash when it jumps to the application address. (see image below.)

address.jpg

I had the feeling that I had to change my project memory settings. After some research and trials, I could't work it out. (first one is bootloader, second one is application)

memory config bootloader.jpg

Memory config application.jpg

 

 

 

 

 

 

 

 

Does anyone have an idea how I should set this up correctly?

Kind regards.

 

Update: This is what I get back.

error.jpg

标签 (2)
标记 (3)
0 项奖励
5 回复数

974 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @BerkantCiftci2001 

1) First please confirm the application can work well without bootloader.

2)Confirm bootloader program application image correctly.

3) Confirm bootloader can jump to application.

4) There is USB secondary bootloader for lpc1700, you can refer to the jump code :

https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mc...  

5) And there is debug application with MCUXpresso IDE method:

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

 

BR

Alice

 

 

 

0 项奖励

962 次查看
BerkantCiftci2001
Contributor II

Hi @Alice_Yang , Thanks for your reply! I would like to know more about the memory mapping. Should the application have a seperate size too? What I am trying is the following:

  1. flash bootloader.
  2. flash my application second with second MCUXpresso instance.
  3. let the bootloader code run through the jumping process. 

This works good. But when I try to flash my application with my custom software, the bootloader gives me UNDEFINED INSTRUCTION. I checked the .hex file and this is written correctly into the memory.

0 项奖励

942 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @BerkantCiftci2001 

 

The flash size of application should 0x80000 - 0x8000, because the total size of flash is 0x80000 (512k),

bootloader uses 0x8000.

 

BR

Alice

0 项奖励

937 次查看
BerkantCiftci2001
Contributor II

Hi @Alice_Yang ,

 

I have seperated the Flash size for bootloader and application.

Should this also be done for the RAM?

So:

  • bootloader start 0x10000000, size 0x2000
  • application start 0x10002000 size 0x6000

I still get this error at jump while debugging bootloader :

image.png

0 项奖励

919 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @BerkantCiftci2001 

1) From your screenshot, it application size still 0x80000:

Alice_Yang_0-1670223699441.png

 

2) RAM needn't.

 

BR

Alice

0 项奖励