Page 1 of 1

[NUCLEO_F413ZH] - Use FS on USB OTG

Posted: Mon Apr 20, 2020 9:13 am
by srednax
Hi there,

I recently purchased a NUCLEO_F413ZH, which has a user USB port on one end of the board. Does the current release version of µPython support loading scripts from a connected USB stick through an OTG adapter? If so, what filesystem should it be formatted to?
I tried connecting a 32GB USB stick to it, which is FAT32 formatted. I tried with something like

Code: Select all

os.listdir("/")
but that only showed me

Code: Select all

['Flash']
and no additional file systems present.

Is there a way to make this work?

TIA!

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Posted: Mon Apr 20, 2020 12:32 pm
by jimmo
srednax wrote:
Mon Apr 20, 2020 9:13 am
Is there a way to make this work?
Unfortunately no, sorry. Although the hardware supports it, there's currently no support in MicroPython for USB host mode (or OTG), only device mode.

I believe some work was done a long time ago, but the most recent mention I can find is: https://github.com/micropython/micropyt ... -503102537

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Posted: Mon Apr 20, 2020 12:43 pm
by srednax
Thank you. That is a shame. I wonder how hard it would be to add it. I may look into it.

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Posted: Mon Apr 20, 2020 12:46 pm
by jimmo
srednax wrote:
Mon Apr 20, 2020 12:43 pm
Thank you. That is a shame. I wonder how hard it would be to add it. I may look into it.
There's been occasional discussion of moving the STM32 port over to use TinyUSB instead of the current implementation based loosely on the STM HAL. This would certainly make adding host support easier.