The USB port handles the port by using an IRQ and their ISR. You need to have an ringbuffer for incomming and outgoing characters. Generaly, you need to declare a routines for HS or FS USB. I had added some comments in german to explain the functionality. The speed setting of the PC program, who open the virtual serial port, is unimportant - i usualy uses 115KBit/s. If everythings is working fine, a COM device must be available in teh device manager of Windows 10, without installing a driver. This shoudl explain how the interface needs to be handled. The packed source files are snipps - this is not an entire project. I assume this could be used on the other F7 Nucleos too, but i had not done them as now. It uses the HS-USB port of the STM32F7 Disco board. The attached File SRC.ZIP are the main fsource files that requires the both source codes from st. You need to download the “STM32_USB_Device_Library” sources and enable the HAL support for the USB.īoth are available by CubeMX and could be preconfigured for just a test. This project is more complex, but i assume that you know how the USB-Support routines needs to be handled. Well, i had found an example for an USB-CDC HAL based upon STm32F746 Disco board. A good way to understand how the IF is required to be programmed is watching the source code. This is more a quick reference as a documentation and also unhelpfully. The older stdlib handling of cdc that regulary used by the F1,3,4 Series, is quite different and not helpful to solve. In several weeks i had attempt to find a vaild example or a more detaild description about the HAL support of the CDC class, i was unsuccessful. I had used this as a trigger to start an rtos thread to support the routines for rx and tx. In addition, their is also a callback available who signalize the application if the usb plug is removed or plugged in. You need to define a ring-buffer for rx and tx, a handler routine for outgoing and incomming data and a control handler who signalize in case of an received and the send request. Different as is assumed, the HAL support routines works quite similar as a regular RS232 interface. The main problem of the HAL USB.CDC support was the understanding of the callback routine. In the mean time, i had selled the entire project to customer. My solution don’t requires any thirdparty driver - just the regular CDC interface of Windows 10 is used. The CDC support realized with HAL instead the obsolete and unavailable support of stdlib in STM32F7 and newer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |