Loading...
 

STM32MP1 support available in SW4STM32

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4; you can download a short video showcasing this on the ac6-tools website (registration required).

System Workbench for STM32


STM32H7 USB HS CDC Device Issues

I am trying to set up my STM32H753 to use the USB HS CDC controller. Its a custom board using the USB3300 as the external PHY.

My intended use case is to be able to transfer bulk data between my PC and the MCU. I am not trying to implement a virtual com port, the UART/USART devices that are being used are being used for a separate purpose and are not being used as part of the USB interface. Currently, I have one USART port active that I am using as a debug port so I print some useful state and event messages.

I ticked all the necessary boxes in CubeMX to generate code for a USB HS device using an external PHY using the CDC middleware. I have also implemented all the functions (CDC_Init_HS, CDC_DeInit_HS, CDC_Control_HS, CDC_Receive_HS, and CDC_Transmist_HS) in usb_cdc_if.c. All of these, apart from CDC_Receive_HS have been left at their defaults (not really sure what to do with them to be honest). In CDC_Receive_HS I copy the received data into a more accessible buffer, but otherwise the function is the same as its default. I have also added some print statements (using the USART) in some useful places so I can I keep track of what the MCU is doing.

The MCU is set up so that once every millisecond it will write data to the USB port, and every time it receives data on the USB port it will write a message to the USART saying that it received data.

I have also set up a small program on the PC using libusb to perform bulk transfer. Its a simple write some data, read some data in an infinite loop with some print statements to track progress.

What I am finding is that I can use libusb to connect to the USB HS CDC device reliably and usually the initial write command from the PC says it is successful, but this is the extent of my success. I get no print statements on the USART saying that the device received any data. Sometimes the PC will receive some data, but the next write command from the PC will always hang.

I suspect that I am not setting up something correctly, but I am struggling to find any useful documentation that will actually tell me how to use the HAL functions from the CubeMX generated code and what I actually need to do to set up the CDC interface properly.

Has anyone had any success using this device and this middleware?

Thanks in advance,
Bidski

 

Newest Forum Posts

  1. Build fails when running through command line by rangpava, 2019-05-17 19:29
  2. SWD option gone by dangermouse, 2019-05-17 17:22
  3. syscalls and STM32CubeMX by CHAABANI Ameny, 2019-05-17 17:11
  4. Problem verifing and downloading code by elvarliiv, 2019-05-17 12:05
  5. Problem verifing and downloading code by asierdo, 2019-05-17 11:50
  6. STM32 System Workbench File Opening as Text File. by ArjunSingh, 2019-05-17 08:02
  7. Issue snprintf floats by ArminOonk, 2019-05-16 16:15
  8. Issue snprintf floats by ArminOonk, 2019-05-16 16:01
  9. Adding new Include files by Mohd Tanveer, 2019-05-16 07:51
  10. UNPLUGGED TARGET DURING DEBUG SESSION , ERROR IN FINAL LAUNCH SEQUENCE by dbdb, 2019-05-16 06:44

Last-Modified Blogs