Bootloader

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

Bootloader

2,858 Views
huyrua291996
Contributor I

Hi,

I try to use bootloader as AN4767 in my processor MKE02Z16VLC4 (40MHz)

After program bootloader to my processor, I use win_hc08sprg.exe to flash Blink app to my processor

and I get the result

194148_194148.PNGCapture.PNG

After that, I use S-recoder tool to convert source address range of my Blink.srec, i get a new result

194149_194149.PNGCapture1.PNG

So it still not work. How should I do now

My project is written by Codewarrior

Original Attachment has been moved to: Blink.srec.zip

Original Attachment has been moved to: Bootloader.zip

0 Kudos
Reply
11 Replies

2,185 Views
huyrua291996
Contributor I

Sorry for my late reply, I tried to debug and fixed this problem. Just because of  some mistakes in uart

0 Kudos
Reply

2,185 Views
huyrua291996
Contributor I

Hi Alice,

I've fixed some mistake about my UART and when I debug, the address, length and the data is right.

But after Flash_EraseSector, I got the problem

2017-09-25.png

And I dont know why this error is occurred. The Flash_EraseSector function work fine in my simple project (only write 'a' in address 0x00001410).

Can you help me. My code write for KE02 40MHz and can you use FRDM-KE02 (40MHz) debug for me

0 Kudos
Reply

2,185 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi,

Please step into Flash_EraseSector to check when run which code, it crash.

BR

Alice

0 Kudos
Reply

2,185 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello

I recommend you first creating a simple  project  to download, if still can't work,

please send your application project to me .

BR

Alice

0 Kudos
Reply

2,185 Views
huyrua291996
Contributor I

Hi Alice,

I have already created a blink project to download but it still cant work

The bootloader project I have attached in the question.

Can you check what's wrong in my bootloader code?

0 Kudos
Reply

2,185 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Huy,

Please pay attention that, the flash size of your chip MKE02Z16VLC4 is 16K 0x0000 - 0x3FFF,

so you can't put the new vector table(APP vector ) into 0x4000 .

pastedImage_5.png

Also please refer to AN4767->2.4 User code to configure your APP.

If still have problem, I recommend you open the bootloader GUI win_hc08sprg(it under AN2295 ) project to debug ,

the information from GUI view can find in the GUI project source.

Hope it helps


Have a great day,
TIC

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

0 Kudos
Reply

2,185 Views
huyrua291996
Contributor I

Hi Alice,

I've changed in FC_Protocol.h and I also change the linker file in my application code

Can you review for me both project in CW

I also use AN2295 GUI and it 's seem wrong

Capture.PNG

Capture1.PNG

It's wrong in Memory Block. In the Identification it's Block 1 and when erase and write it's Block 0

What should I do

0 Kudos
Reply

2,185 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Huy,

I haven't the board about your chip, so I can't debug it on my side.

From the message , it seems erasing failed, please set a breakpoint in your erasing code,

then click "Erase" button, when it run to breakpiont, debug step by step check whether it erased

successfully , or why it failed.

BR

Alice

0 Kudos
Reply

2,185 Views
huyrua291996
Contributor I

Hi Alice,

I set breakpoint in the code that contain ERASE code and use the GUI to debug. In the first press button Erase in the app, it doesnt break. But the second time it breaks. So may be it wrong with my UART code, can you review for me.

And can you also send me an bootloader code that it works well on KE02Z board. I can also compare to my code. My email is huyrua291996@gmail.com. Thanks!

0 Kudos
Reply

2,185 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi,

The AN4767 sw is the bootloader for FRDM-KE02. You can refer to the Reference manual of your chip

to change the bootloader. Sorry I haven't the bootloader for this chip.

When it break, then what happened ? When it run to erase code, check whether  it can erase successful.

You can check the UART data to see whether your UART code is wrong.

BR

Alice

0 Kudos
Reply

2,185 Views
huyrua291996
Contributor I

Hi Alice, 

Now I get a FRDM-KE02 board. But the AN4767sw is code for IAR

Can you give me source code for CW or KDS

And I have an issue about my UART, I set interrupt mode and I set only UART_C2_RIE_MASK, and it work right with another project. Can you give me some advice about it?

0 Kudos
Reply