MKE06 BootLoader and MKE16F512BootLoader

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

MKE06 BootLoader and MKE16F512BootLoader

1,417 Views
ahjg_xu
Contributor II

I use MKE06 debug bootloader ,please sent to me some files about it,best chinese files,

thank you !!!

Tags (1)
0 Kudos
10 Replies

1,408 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi ahjg_xu,

There are several bootloader projects you can use. Which one do you use? KE06 need Flash base bootloader and KE16F has ROM bootloader.

 

Regards,

Jing

0 Kudos

1,393 Views
ahjg_xu
Contributor II

Hello!
Thank you for your feedback,
Now, I use the mke06z128xxx4 chip, debug the bootloader.
My design is to use the first 50K flash for bootdemo, and then (128k-50k) for appdemo. The bootdemo is the bootloader.
I think we should change "mke06z4_ Project_ c_ Debug.ld ”File, and redefine interrupt vector table, but I changed several versions of the program, failed.
Please give me some advice.
My current compiler is mcuxpresso 11. thank you !

0 Kudos

1,367 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Before you jump to App, you should set SP pointer and PC pointer. If the App start address is 0xb000, the SP pointer initial address is 0xb000 and PC pointer initial address is 0xb004.

Please refer to below code.

appEntry =(*(unsigned int*)0xb0004);
appStack = (*(unsigned int*)0xb0000);
static void (*farewellBootloader)(void) = 0;
farewellBootloader = (void (*)(void))appEntry ;

// Set the VTOR to the application vector table address.
SCB->VTOR = 0xb000;

// Set stack pointers to the application stack pointer.
__set_MSP(appStack );
__set_PSP(appStack );

// Jump to the application.
farewellBootloader();

 

Regards,

Jing

 

0 Kudos

1,359 Views
ahjg_xu
Contributor II

Thank you very much for your help.
MKE06 bootLoader is ready to use.
Without your help, I don't know how longTime to debug.
Now,I have a question about setting "MCUXpresso IDE". How to output the.S19 file and how to set the output length of each line of the file?

0 Kudos

1,351 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

You can generate .s19 file in MCUXpresso directly. Right click the .axf file ->Binary Utilities->Create S-record. But it can't set output length of each line.

 

Regards,

Jing

0 Kudos

1,348 Views
ErichStyger
Senior Contributor V

But it can't set output length of each line.

Actually this is possible, see https://mcuoneclipse.com/2017/03/29/mcuxpresso-ide-s-record-intel-hex-and-binary-files/, there is an option page for the command in the workspace settings.

You can simply add --srec-len (see  https://mcuoneclipse.com/2013/10/29/s-record-manipulation-with-gnu-objcopy-and-burner-utility/) to the options.

I hope this helps,

Erich

0 Kudos

1,334 Views
ahjg_xu
Contributor II
Hello! Your screenshot link should be "CodeWarrior ide", which can change ". 19" file. There is no place to set the length of each line of ". 19" file in "mcuxpress ide"
0 Kudos

1,328 Views
ErichStyger
Senior Contributor V
0 Kudos

1,383 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Which bootloader do you use? What problem you are facing? Can't jump to application? In MCUXpresso, you needn't change the .ld file manually. Just let flash start from 50k. The compiler will put vector table at the head of 0xc800. The bootloader should know it and get Reset_handler address and SP address from there.

 

Regards,

Jing

0 Kudos

1,375 Views
ahjg_xu
Contributor II
Hello, thank you for your reply. The address of the. LD file of "bootloader" is "0x0 - 0xa000"; The address of the. LD file of "appdemo" is 0xb000 - 0x15000 Now, I have two problems here Question 1 "============== When "bootloader" Jmp to "AppDemo" " // unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08; // *pSCB_VTOR = (unsigned int) 0X0000B000; // (* (void (*) ()) (0x0000B410 + 4)) (); 0x0000B410 is the "AppDemo" main () entry address. " The Debug result was unsuccessful. Question 2 "=============== I thought there might be a problem with the jump address, and I added some demo in "main" of "BootLoader" " // unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08; // *pSCB_VTOR = (unsigned int) 0X00000000; // (* (void (*) ()) (0x00000410 + 4)) (); 0x00000410 is the "BootLoader" main () entry address. " When I single step through with Jlink, the program "BootLoader" can jump normally, every time. But when I debug continuously, "MCUXpressoIDE" reports "HardFault" and "IPSR = 0X00000003" Is there a problem with my jump function? Why ? Thank you very much for your help!
0 Kudos