XMC4500. Transmit Flash->DMA->USB - impossible?

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

cross mob
rst
Level 3
Level 3
First solution authored Welcome!
I am trying to transmit data from internal flash-memory (of XMC4500) to USB (device-mode). Data transmits to IN-endpoint. USB works in DMA mode.
But this doesn't work: I immediately get an "AHB Error" interrupt on the first transmitted address.
I tried to specify the address or in the cached range (0x08000000 ... 0x080FFFFF) or in the uncached range (0x0C000000 ... 0x0C0FFFFF) - the result is same.
I also tried disabling MPU - this does not help me either.
The source data (in Flash) is 4-bytes aligned.

Do I understand correctly that USB DMA can only read from RAM and cannot read from FLASH?
I looked through the entire reference manual in search of a description of the possible causes of issue, but did not find anything. Maybe I missed something?
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,


The USB bus master interface has only access to DSRAM1 or DSRAM2.
4030.attach


Regards,
Jesus
0 Likes
rst
Level 3
Level 3
First solution authored Welcome!
Thanks for your reply! Now everything is clear to me. 😞
0 Likes
rst
Level 3
Level 3
First solution authored Welcome!
When I studied the low-level driver (xmc_usbd.c) from "XMClib v2.1.6 - XMC Peripheral Driver Library", I found certain bug:
The XMC_USBD_EP_t :: outInUse flag is reset (set to "0") in many places source, but it is not set to "1" anywhere. It is always == 0.
0 Likes