USB Mass Storage example does not work

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User10696
Level 4
Level 4
First solution authored
I am trying to use the USB Mass Storage Device example supplied by Keil for the XMC4500 Relax Kit. They say the examples come from Infineon, therefore Keil cannot help me.

The problem with the example is that the processor is continuously in the USB interrupt. It is not even possible to blink a LED in the main application loop.
I have seen that the "ModeMis" interrupt is active and as this is not handled in the interrupt routine it remains active. The fact that this interrupt is active means the driver is doing something wrong.

The Infineon Support has said I should post this problem here.

I am no USB expert, but I exspect to be able to use the supplied examples.
0 Likes
4 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted
Hi @amanning,

You can find the already existing USB Mass storage code example for XMC 4500 device that comes up with DAVE here : https://www.infineon.com/cms/en/product/promopages/aim-mc/dave_downloads.html. Please search "USBH_MS_XMC45" and you can find the code example. This example demonstrates the implementation of USB host mass storage functionality. This will help you debug your application and understand the flow of code along with USB interrupts usage. Also, if you still face the issue, can you please archive and attach the example which you are following?

Best Regards,
Aashita
0 Likes
User10696
Level 4
Level 4
First solution authored
I have had a quick look at this DAVE example and it seems to use completely different code to the example supplied in the Keil pack.
Just because the DAVE example works, does not help me with the Keil example.
Have you tried running the example supplied by Infineon for Keil?
0 Likes
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted
Hi @amanning,

Can you please confirm for once that are you checking the "USB Device Mass Storage" listed over the webpage here? Could you please share the source of the code with us? This would help us proceed with a better plan of action.

Best Regards,
Aashita
0 Likes
lock attach
Attachments are accessible only for community members.
User10696
Level 4
Level 4
First solution authored
I did not download the example from the page you mentioned, I used the Keil Pack Manager program. But both seem to load the same version (2.13.0), so I guess they are the same.

I have attached my example. This is a stightly modified version of the standard example. This uses the SD card as storage. To get it to work I have added the handling of the "modemismatch" interrupt in the USB interupt handler (line 757). Without this change it may seem to be working, as windows can connect and show the content of the SD card, but the processor is continuously in the USB interrupt routine. You can see that the LED does not blink correctly.

The modemismatch interrupt is only set if the driver does an incorrect access, so it would seem there is a bug in the driver.
I am sure you will be able to reproduce the problem and hopefully correct the driver.
0 Likes