cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C6 USB CDC Device Descriptor Request Failed - shared SRAM with CAN issue?

SHewi.1
Associate II

Hi,

I am at a loss as to why this is not working.

I have checked the crystal (ABM8AIG-8.000MHZ-1Z-T), wiring (1.5k resistor between D+ and 3V3, connected both before and after MX_USB_DEVICE_Init() is called), etc.

I've set the stack/heap sizes to 0x400 (not that this should matter as I'm using static allocation).

I've tried adjusting CDC_DATA_FS_MAX_PACKET_SIZE both bigger and smaller.

Stepping through code I find that the I fail at USBD_GetStatus as the req->wLength is 0.

So somewhere the data is being lost.

Any ideas?

1 REPLY 1
SHewi.1
Associate II

OK, so I found a single line in RM0008 (https://www.st.com/resource/en/reference_manual/cd00171190-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) saying that USB and CAN share a dedicated 512-byte SRAM.

I removed my CAN code, and the USB now works!

I guess my next question is, given my project was going to act as an interface between USB and CAN, how do I get CAN working too?