Firmware Upgrade over Web

Technical questions regarding the XTC tools and programming with XMOS.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Firmware Upgrade over Web

Post by DemoniacMilk »

I am not sure how this might be possible, but I'd like to provide a web interface that allows to upload binary files and store them to flash for firmware updates (xcore firmware and additionally DSP/FPGA firmware/configs). The file size might exceed several Mbit, so I cannot buffer the whole file and write it to flash, but I also dont know how i might send the file in chunks (maybe there is a way to use js for this?)
Any ideas are very welcome!
User avatar
Ross
Verified
XCore Legend
Posts: 1195
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

On the xcore side of things, you just write to an "upgrade image" as you receive it. The CRC and validity checking in the boot-code will deal with failed upgrades (and revert to the factory image). This avoids the requirement to buffer the whole image for checking.
User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

FPGA/DSP images will go into data partition, so you can write them in chunks by passing chunks into fl_writeData

If xCORE images are for the device that is writing them and so they should go into boot partition, you can write chunks by doing fl_startImageAdd, then repeat fl_writeImagePage and finally fl_writeImageEnd
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Post by DemoniacMilk »

Okay thanks, I got how to store the data received.

But I am still confused how the xcore may receive the data. Will have to check, how file transfers work (maybe they are sent a seperate port?) and if those packets need to be managed manually or if they will go through the xtcp stack. Also, i need to write to flash (what takes quite some time) before I may accept the next packet, what ethernet/XTCP cant know (except if i manually delay the ACK: .. might result in a retransmit?).