microsoft / uf2

UF2 file format specification
Other
849 stars 164 forks source link

feature request: allow file downloads #62

Closed sslupsky closed 2 years ago

sslupsky commented 2 years ago

I have a use case where I would like to download a file from a UF2 enabled board. The use case involves logging data to memory of a board (MCU flash, SPI nor or nand flash, etc) and facilitating a way for the end user to easily download the data from the device. Thus, I was curious if any thought had been given to providing a mechanism where data moves from the board to the host? For instance, a "file" appears in the UF2 volume that could be copied to the host? For instance, when the copy begins, UF2 uses some sort of file system or application API to retrieve the data from the board memory.

mmoskal commented 2 years ago

See current.uf2 file description here: https://github.com/microsoft/uf2/blob/master/README.md#files-exposed-by-bootloaders

sslupsky commented 2 years ago

@mmoskal I do not think that will work for sending a file from the board to the host. For instance, my embedded device generates a log file. The log file is stored into an nand SPI device attached to an mcu on the board. What I would like to do is be able to attach the board to a host PC using USB and then have a file appear on the usb volume that I can then copy from the board to the host using the host PC OS. Kind of like a memory stick but I want to be able to go from the board back to the host.

So, to my understanding, there needs to be some sort of API to interface the UF2 boot loader with the board mcu application so that the application can transfer the memory from the attached memory device to the host PC using the UF2 usb connection. Or, perhaps some way to attach drivers to the UF2 boot loader that will read from attached memory devices.

mmoskal commented 2 years ago

I think in this case you just need to implement MSC in your application...