on
2018-07-23
04:56 AM
- edited on
2023-12-07
05:56 AM
by
Laurids_PETERSE
When using the HAL libraries, the source of this problem can be a too small heap configured in the project. The solution is to either increase the heap size, or configure the USB library to use static allocation.
The heap configuration depends on the used IDE/Toolchain:
The USB library configuration requires enough space to allocate the structure related to the implemented USB class (e.g. USBD_CDC_HandleTypeDef in case of CDC class implementation). A value of 0x1000 should be enough for most cases, but it might also depends on other software components used in the project.
If you want to use static allocation, you can rewrite the USBD_malloc and USBD_free macros in the usbd_conf.h file. The USBD_malloc is called only once when the USB class is initialized. The static variant can return always the same pointer to static allocated memory, and USBD_free can be left empty. The size of the static allocated memory will depend on the used class (e.g. size of USBD_CDC_HandleTypeDef).
Hi
I am beginner. I want to use USB_CDC_ACM
My MCU module is stm32f207vc and customized board
I have a question about detection of usb
1. USBH_CDC_ACM_GetDeviceStatus function does not detect when usb insert
2. And Is this necessary ? I only use USB port
//////////////////////////
extern ARM_DRIVER_USART Driver_USART9;
#define ptrUART_USB (&Driver_USART9)
////////////////////////
And usart9 is not in stm32f207vc
//////////////////////////////////////////////////
I succeeded make program via cubemx
custom A board cdc-host,
custom B board cdc-device,
connect A and B board via USB port
Succeed test data send, and receive
///////////////////////////////////////////
My USBH_CDC_ACM_GetDeviceStatus problem's program configure
In keil's "manage run time environment" set
CMSIS : core
RTOS : Keil RTX
CMSIS Driver : USART(API) : CDC, USART
USB Host(API) : Full Speed
Device : CStartup, classic
Device : common,Cortex,DMA,GPIO,RCC
USB : Host :CDC
////////////////////////////////////////////
Thank's
I have this exact problem with my stm32wb5m discovery board
increasing heap size to 0x1000 or 0x2000 didnt fix it
Hi,
If anyone searches this page again,
If I'm not mistaken, for the Host to recognize the Device, it is necessary to have the pull-up or pull-down resistor, as the case may be. I already had a problem with Bluepill, due to the incorrect value of the resistor.
See: https://www.beyondlogic.org/usbnutshell/usb2.shtml
"High speed devices will start by connecting as a full speed device (1.5k to 3.3V). Once it has been attached, it will do a high speed chirp during reset and establish a high speed connection if the hub supports it. If the device operates in high speed mode, then the pull up resistor is removed to balance the line"
A lot of good ideas above but the newer ST micros don't require the 1.5K ohm external resistor because they have a built in Pull Up implementation, check your micro's reference manual.
I am using the STM32G0B1RET and I was having a similar issue.
What really solved my issue was the article below that pointed me in the right direction, bottom line is CubeMX is not generating a complete code for the CDC handling, specially enabling the interrupts, It had the clock initialization correctly setup by it but I had to implement the interrupt handling.
https://community.st.com/t5/stm32cubemx-mcus/usb-stm32g0b1kct6-not-working/td-p/75116
I will share my USB schematic with you, I guarantee you this works after fixing the interrupt handler!
My USB lines connect directly to pins PA11 (USBD-) and PA12 (USBD+)
I hope this helps you!
Good Luck!
Hello Members, I am facing problem in using FATFS and USB_MSC together in the same board. I'm reaching out to seek your assistance with a challenge I'm currently facing.
I'm involved in a project that involves the transfer of files, typically text or binary data files with sizes ranging from 100 MB to 600 MB. To facilitate this process, I'm working on integrating USB functionality. The objective is to copy these files directly from an SD card to my computer using USB. The USB functionality works as intended when FATFS is not enabled.
However, the complication arises when I enable FATFS (which is a mandatory component for the project). Enabling FATFS prevents the USB functionality from working, and it no longer detects the USB after enabling FATFS. This issue has been a roadblock for me, since in a single board I am not able to use USB and FATFS I thought to use 2 STM32 micro controllers but still its not working please help me resolving this issue:
https://community.st.com/t5/stm32-mcus-boards-and-hardware/facing-issue-in-transfering-sdcard-file-by-uart-usb/m-p/616003#M16108
Hi,
in my case the problem was that windows used the wrong/previous driver:
At the beginning i created the usb cdc (communication device class) for testing. This works fine. Then i used the same project and same processor and selected the adc (audio device class). After i download and start the stm32f103 i get the "error 10".
So i had to open "device manager" of windows, select the device with the problem. Rightclick and select properties. Then select driver->driver update. Then press "search on my computer for driver", "select driver from list" and change to the other shown driver.