Trying to build freertos/virtual_com with USB_STACK_USE_DEDICATED_RAM...

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Trying to build freertos/virtual_com with USB_STACK_USE_DEDICATED_RAM...

跳至解决方案
264 次查看
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 项奖励
1 解答
251 次查看
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 项奖励
2 回复数
255 次查看
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 项奖励
252 次查看
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 项奖励