2020-12-15 03:35 AM
Hello
i want to update the firmware with a USB Device Mass Storage Class.
Like the STLink (on the nucleo board) the .bin file should be transfer per drag and drop from the pc.
But I don't want to use another additional controller.
How can i handle that?
The file that comes from the pc is in the fatfs format but i only need the content.
I think i must save them on the ram or sdram and read them with the stm32 fatfs library to save into the flash.
But the sdram solution is expensive and the ram solution is limited to the ram size.
A application note from nxp uses a pseudo fatfs and an parser to handle this.
https://www.nxp.com/docs/en/application-note/AN4379.pdf
How can I best implement this?
Are there any examples?
2020-12-15 04:07 AM
> The file that comes from the pc is in the fatfs format but i only need the content.
No. The MCU fakes having implemented a FAT filesystem on the MSC "drive". The PC knows about FAT but will read and write blocks (SCSI commands). It will read the FAT control blocks first and, when you drag a fiel onto the drive try to update the control blocks and fill the date blocks with the file content.
If you restrict the download to .bin files with a fixed starting address, you don't need a parser. but, you can offer more flexibility like .hex files etc. later on.
hth
KnarfB