Robert Bailey

Going to try writing a USB Bootloader for JM60

Discussion created by Robert Bailey on Jan 31, 2009
Latest reply on Feb 9, 2009 by Robert Bailey
Well, I'm going to try to create one.  The only issue that has me worried is USB interrupts while in boot mode.

I have 2 ideas: 

The first is to build the bootloader with the complete USB stack built in,  and not put the stack in the app.  The app would call the functions in the boot sector.  An array of function pointers in a known spot will take care of the ap being able to find the functions to call.  Then the bootloader would forward all interrupts based on a relocated vector table similar to the AN2295 implementation for the HC08AP. 

The PC side would relocate the vectors before sending the file to the device.   Or the bootloader could handle it. 

The second idea would be to use the standard JM60 vector relocation feature,  build the USB stack into the bootloader, but also the app (space is not an issue).  Then when boot mode is triggered, re-write the vectors to point the USB interupt into the bootloader.  Then after loading,  reset the vectors to run the ap.

I have the HID mode of the CMX stack working reasonably,  so I will be using that mode.

Any feedback?


(note, most of these ideas came out of various conversations and threads on this board, and with board members.  It is not my intention to take any credit.  I plan to post the code when done)