Trying to build freertos/virtual_com with USB_STACK_USE_DEDICATED_RAM...

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

Trying to build freertos/virtual_com with USB_STACK_USE_DEDICATED_RAM...

Jump to solution
242 Views
EdSutter
Senior Contributor II

I'm working with a FreeRTOS and USB.  When I build the application to run out of internal ram (the default memory map) it runs as expected; however, as soon as I try to put portions of the map into SPI-based ram it gets wonky. I realize that certain memory blocks of USB need to be in DTCM, and after a lot of digging I found that I needed to set two macros in CFLAGS...

-DDATA_SECTION_IS_CACHEABLE=1 -DUSB_STACK_USE_DEDICATED_RAM=1

with that; however, the compile fails because  middleware/usb/device/usb_device_ehci.c checks for USB_STACK_USE_DEDICATED_RAM and fails.  I commented out the error and started down the road of trying to get this to work with a slightly more complicated memory map, but have not had any luck.

What is the reason for erroring out if USB_STACK_USE_DEDICATED_RAM is set?

Note: I am running with SDK2.14.0, running with evkmimxrt1060.  Example code: SDK_2.14.0_EVK-MIMXRT1060/boards/evkmimxrt1060/usb_examples/usb_device_cdc_vcom/freertos) 

0 Kudos
1 Solution
229 Views
EdSutter
Senior Contributor II
Ok, nevermind... my bad.
I was actually using the USB task stack (which is allocated from the heap) to push a character out...

View solution in original post

0 Kudos
2 Replies
233 Views
EdSutter
Senior Contributor II
Update: What I'm seeing as I play around with the memory map is that the heap_4.o bss space must be in DTCM for USB VCOM to work. If I move it to external PSRAM things get messed up.
Is the USB driver allocating memory somewhere?
0 Kudos
230 Views
EdSutter
Senior Contributor II
Ok, nevermind... my bad.
I was actually using the USB task stack (which is allocated from the heap) to push a character out...
0 Kudos