Problem about bootloader on kds(processor expert), the application code didn't run.

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

Problem about bootloader on kds(processor expert), the application code didn't run.

666 Views
rjchang0518
Contributor II

Hi all, 

I need to develop my own bootloader program to update my application code. After reading lots of articles on the internet, the following are my developing setup and environment, 

MCU: MKE06Z128VLD4 (Flash 128K, RAM 16K)

IDE: KDS 3.2.0 with Processor Expert. 

Bootloader program  addr: 0x0

Applicaion program addr: 0x5000

Bootloader program:

There are a few example of bootloader on KDS with Processor expert, however, i found some and the following is the bootloader to jump to application code(0x5000).

pastedImage_14.png

(btw, i don't think it's correct to define SCB_VTOR in this way.)

pastedImage_2.png

Application program:

In my application program, i setup the linker files as below,

MEMORY {
m_interrupts (RX) : ORIGIN = 0x00005000, LENGTH = 0x000000C0
m_text (RX) : ORIGIN = 0x00005410, LENGTH = 0x0001A000
m_data (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000
NVM_data (RWX) : ORIGIN = 0x0001F800, LENGTH = 0x00000800
m_cfmprotrom (RX) : ORIGIN = 0x00005400, LENGTH = 0x00000010
}

Result:

After all those setting up, it works to jump from bootloader to application code!

However after jump to 0x5000, some of my application project run correctly, but some of application project didn't run.

I found out that the size of "bss" of application code will decide my application code run or fail,

pastedImage_3.png 

If the "bss" size is less than 5K, then the application code run, if "bss" is larger the application will fail. This mcu has 16K for RAM.

My problem is why "bss" size affects my application code to run or fail? Is the bootloader code wrong? How do I fix it?

Most example of bootloader on the internet is developed on IAR or Keil, but I need to develop it on KDS(Processor Expert).

0 Kudos
1 Reply

552 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Roger Chang,

‘bss’ is for the uninitialized data in RAM,  with data in RAM and bootloader use some RAM,

maybe more than 16K.


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