AN4379 rewritten to provide SREC file USB bootloader

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

AN4379 rewritten to provide SREC file USB bootloader

1,845 Views
iancull
Contributor III

For a new company project, one requirement was a bootloader that allowed USB connection with drag/drop of a text file (easy to transfer by email/etc); I found AN4379 but that seemed to be quite old and not suitable for the K22F Kinetis processor we had chosen.

I therefore wrote my own, slightly based on / inspired by AN4379; I started from the MSD RAMDISK example to give a USB framework, and then integrated code to provide the USB drag/drop feature.

I have an "archive" zip file but I'm not sure if it's ok to submit the finished code here ... I've attached one file which is the "heart" of the code, that processes incoming USB data packets to parse the S19 file and write it to processor flash memory.

0 Kudos
3 Replies

1,829 Views
iancull
Contributor III

But does that bootloader support SREC files? The one I looked at only supported BIN files, which are often blocked by company websites as "unsafe"

0 Kudos

1,824 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

USB MSC download only supports SB file drag-and-drop. You can use ELFTOSB tool to convert SREC file to .sb file.

https://www.nxp.com/docs/en/user-guide/MBOOTELFTOSBUG.pdf

https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf

 

Regards,

Jing

0 Kudos

1,836 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi iancull,

Yes, AN4379 is old. But you needn't do it by yourself. The bootloader project in FRDM-K22F SDK v2.9.0 support USB-MSC function. You can enable it by change BL_CONFIG_USB_MSC definition to 1 in bootloader_config.h.

 

Regards,

Jing

0 Kudos