Bare metal USB MSD FATFS example

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Bare metal USB MSD FATFS example

ソリューションへジャンプ
1,344件の閲覧回数
burhanhagi
Contributor IV

I am trying to mount USB flash disk to my custom IMXRT1176 board. I aim to list all .mp3 binary files in USB stick and later then try to play those files randomly. 

I found only one example in SDK named "evkmimxrt1170_host_msd_fatfs_bm_cm7" related with FATFS MSC. However, in above example there is a simple OS used for it, named OSA. But I do not want to use operating system. I need the same example but using only with bare metal. 

Is it possible to share with me one example .zip file?

Below is the screenshot of USB folder in MCUXpresso IDE for IMXRT1166;

burhanh_0-1683902821673.png

Below is the screenshot of USB folder in SW4STM32 IDE for STM32F769;

burhanh_2-1683903025164.png

As per my understanding, usb folder in MCUXPresso IDE is based on running over Operating System. But as you see, in STM32F769, USB folder is based on bare metal, no OS.

I tried to download USB and FATFS stack from online SDK Builder. But every time I download it, it is with OAS coded. I could not find bare metal FATFS USB MSC Class folder in Middleware Section. 

 

 

タグ(3)
0 件の賞賛
返信
1 解決策
1,262件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @burhanhagi ,

 USBHostTaskFn is used to receive interrupt message. When interrupt comes, it register a message to OSA. USBHostTaskFn check this message and parse the incoming command. If you don't like this mechanism you just make your own massage channel.

 

Regards,

Jing

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,284件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @burhanhagi ,

OSA is not a operation system. It is a middle level between OS and baremetal software. With this level, the baremetal example can port to OS easily.

 

Regards,

Jing

0 件の賞賛
返信
1,277件の閲覧回数
burhanhagi
Contributor IV

Hi @jingpan, There is 2 functions in the main function. USB_HostMsdTask(g_MsdFatfsInstance) function is the one what I want to add. However, the first function USBHostTaskFn(g_HostHandle) is related with OSA. See the below please;

burhanh_0-1684134510153.png

USBHostTaskFn(g_HostHandle) inside;

burhanh_1-1684134713943.png

 

burhanh_3-1684134803193.png

As you see above, that function calls OSA_EventWait(...). 

When I comment out the USBHostTaskFn(g_HostHandle) function in the main while loop, the code does nothing.I need the program to execute with only USB_HostMsdTask(g_MsdFatfsInstance). However, without USBHostTaskFn(g_HostHandle) function, I could not achieve it. What could I do? How could I weed out the unwanted OSA lines? Because all usb->host->class->.. files was constructed based on this.

burhanh_4-1684134901421.png

 

 

 

0 件の賞賛
返信
1,263件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi @burhanhagi ,

 USBHostTaskFn is used to receive interrupt message. When interrupt comes, it register a message to OSA. USBHostTaskFn check this message and parse the incoming command. If you don't like this mechanism you just make your own massage channel.

 

Regards,

Jing

0 件の賞賛
返信
1,248件の閲覧回数
burhanhagi
Contributor IV

Thank you @jingpan 

0 件の賞賛
返信