Need help with MQX USB bootloader

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

Need help with MQX USB bootloader

2,554 Views
Byra
Contributor I

I am trying to develop a USB bootloader to use with my MQX project on a 52259. I have checked out the AN3927 app note and also the projects I found here by David Seymour and Derek Snell, but I still dont quite get it.

 

What do I need to do to add a bootloader to my project? With the project by David Seymour, I was able to get the bootloader to run and it seemed to flash my 52259 ("success.txt"), but when rebooted, it doesnt run my application. I'm sure its because it cant find the user entry vector, but I cant figure out how to add that to my project. Do I need to add all of the files from David's project to mine? I tried that and it wouldnt compile.

 

Thanks for any help.

 

--Byra

0 Kudos
Reply
4 Replies

1,356 Views
DavidS
NXP Employee
NXP Employee

Hi Byra,

Did you get both ZIP files from the "USB Bootloader sample and MQX RTCS Template" post?

Note certain this link will work but here goes:

https://community.freescale.com/message/65391#65391

After you get the success, can you use the debugger to look at the memory space?  Do you see "nop" and "jsr" at 0x4000?

The 32-bit address after the "jsr" is the __boot: address of your FSLMQX application.

You should try to use the debugger to set the PC to this address and start stepping to see what is executing.

Alternatively please try the attached S19 example and see if it works on your system.

Regards,

David

0 Kudos
Reply

1,356 Views
EPLa
Contributor I

HELLO EVERYONE,

I also encountered problems with David's files. after I load into flash on my M52259 DemoKit board(David's example is

M52259EVB),the LED4 will blink, but after I  press SW1 and RESET buttons, release RESET while still pressing SW1,

the LED4 still blink, it doesn't turn into bootloader mode.

 

I wondered that if anyone encounter similar problems, and please tell me how should I do.

(I am trying to write program with MQX by using bootloader.)

 

Thx!

 

0 Kudos
Reply

1,356 Views
Byra
Contributor I

Hi David,

 

Thanks for your help. I have been running it today using the debugger. It does jump to the MQX code correctly and executes code fine until there is an interrupt. Then it dies, because it seems like its jumping to an interrupt vector table that isnt there. So the problem must be with how the interrupt table is getting set up.

 

In your code, you set  #define MQX_ROM_VECTORS 0. Somehow the VBR must get updated with the new vector table address, right? Is MQX supposed to do that or do I need to add code for that? In your sysinit.c file, you copy the vector table to ram and update the vbr. I dont see that happening anywhere in my project. Could this be the problem?

 

My project is based on the twr52259 bsp if that helps any.

 

Thanks,

 

Byra

0 Kudos
Reply

1,356 Views
Byra
Contributor I

Ok,

 

Its now working. The code in the PSP that loads the vector table into ram was not working. It was set up as a compiler option with MXQ_ROM_VECTORS as the control variable. Even though it was set to 0, the code wasnt executing. I took out the option to force it and it is now working correctly.

 

The problem I'm having now is that when I drop the new s19 file into the MSD folder, it only works about 1 in 5 times. Windows returns the error "The parameter is incorrect" when it doesnt work. Is there something I need to tweak in the bootloader to fix this?

 

Thanks,

 

Byra

0 Kudos
Reply