[NUCLEO_F413ZH] - Use FS on USB OTG

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
User avatar
srednax
Posts: 2
Joined: Mon Apr 20, 2020 9:03 am
Contact:

[NUCLEO_F413ZH] - Use FS on USB OTG

Post by srednax » Mon Apr 20, 2020 9:13 am

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!

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Post by jimmo » Mon Apr 20, 2020 12:32 pm

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

User avatar
srednax
Posts: 2
Joined: Mon Apr 20, 2020 9:03 am
Contact:

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Post by srednax » 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.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: [NUCLEO_F413ZH] - Use FS on USB OTG

Post by jimmo » Mon Apr 20, 2020 12:46 pm

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.

Post Reply