USB Device Stack cache MACROs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB Device Stack cache MACROs

1,029 Views
buckfobb
Contributor II

Hi - I'm attempting to get the USB Device Stack (SDK 2.5.0), usb_device_cdc_vcom/freertos example, ported to a custom pcba/freertos application running on the IMXRT1020. This pcba is using external sdram for much of the code/data, including the usb stack.

I followed the instructions in MCUXpresso SDK USB Stack User’s Guide 2.4.4 USB Cache Related MACROs Definitions. The example usb_device_cdc_vcom/freertos does not define USB_STACK_USE_DEDICATED_RAM. I modified the linker script to place .bss.m_usb_global (the only attribute used in the compiled usb_xxx.c files I'm using) into the internal TCM memory, but I'm unable to get usb working (the "reset" event works, but the stack state machine never makes it beyond that).

However, by modifying the linker script to put all usb_xxx.c .bss into the internal TCM memory I've gotten it to work.

What is the proper configuration of MACROs (and where should the sections be placed in memory) for the USB Device Stack (SDK 2.5.0) built for IMXRT1020 when attempting to execute the code from external sdram but placing only the minimal required don't-cache data in internal TCM memory?

Thanks in advance for your help.

-Kevin

4 Replies

825 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Buck Fobb

It is not recommended to place USB code in external SDRAM, nor buffers in a cacheable memory. USB protocol is a very timing strict protocol, If you place Buffer and code in the external SDRAM, those timings would not be accomplished, this is why if you place all usb_xxx.c .bss into the internal TCM memory USB works.

Hope this could help

Regards

Jorge Alcala

0 Kudos

825 Views
buckfobb
Contributor II

Thank you for your reply.

Not an answer I was hoping for but from what you're saying it sounds like .data/.bss etc. could be internal/TCM and .text external.

Are you able to provide any specifics about which specific .data/.bss buffers are required to be non-cached?

0 Kudos

825 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Buck

You could place endpoint descriptors, transfer descriptors, and buffers data in the internal RAM and it shouldn't be problems. Another option is to use noncacheable regions for this data.

Hope this helps

Best regards

0 Kudos

825 Views
buckfobb
Contributor II

Thank you for your response. This helps.