Тёмный

STM32 USB CDC (Virtual Com Port) with CubeMX HAL in 6 minutes 

chiptron
Подписаться 1 тыс.
Просмотров 55 тыс.
50% 1

Create a project with USB CDC (Virtual Com Port, VCP) with STM32 microcontroller in CubeMX (HAL) and SystemWorkbench for STM32 in 6 minutes.

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 32   
@mirao-u9p
@mirao-u9p 5 лет назад
Thanks for this wizard. This is exactly what I was looking - simply how to print from STM32F4 Discovery to serial console over Micro USB. I'm using PlatformIO (with serial monitor) in VSCode IDE.
@jwiegley
@jwiegley 4 года назад
Pretty unhelpful for anything serious. 1) you need to check to make sure the CDC isn't busy transmitting oo it will simply ignore your transmit. 2) Most CDC devices are going to need to receive data and there is nothing here about how to accomplish that or process the incoming data. This is a 6 minute video about configuring a project in CubeMX and 5 seconds of including a CDC_Transmit_FS() function call.
@daavidaviid
@daavidaviid 4 года назад
How would one check if the CDC isn't busy transmitting ?
@ameyerbr
@ameyerbr 4 года назад
Check this video, from official ST channel: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ft8LXVcYFRg.html
@brentalanmiller
@brentalanmiller 4 года назад
Very helpful! Thanks for taking the time to put this together!
@tehnocmaster8732
@tehnocmaster8732 Год назад
Thanks boss! Got me pointed in a direction.
@jorgemendieta4686
@jorgemendieta4686 5 лет назад
Excellent video, just what i needed, thank you !
@carlosfreitas1836
@carlosfreitas1836 3 года назад
Very usefull!!!!!!! Thank you.
@DD4DA
@DD4DA 4 года назад
The main problem is, that this demo is not representativ because ST often update the MXCube, CubeIDE and the HAL library. If you ever looked into the HAL, you get shocked how bad the coding qualtity could be. Similar mention, if you look into the sources of freeRTOS. The demonstrated demo works ,if you use the HAL V1.1.2 from 23.sep.2016 and you advise the CubeMX using this old HAL. Any HAL Versions later, this does not works. I am not know why this happens, because the generated Code looks similar. But the windows system device manager could not start the registered cdc device. I had regenerate a final working version and migrate the ioc-file generated from an older version into the regular offered version of MXCube and regenerate the code for KeilMDK again. The result was similar - the new code looks very similar, but does'nt work. As a cross check, i had recompiled the old project, where the ioc.file was picked from and this works pretty nice. Well, i like the concept of the HAL- and the CMSIS libs to get the start up from scratch easiers. But teh code quality is very bad und looks that none of ST has ever heard from a common coding style. A debugging session of an unknown code with a soucre code style like freertos or HAL, is a horror task.
@sadeghmoradi80
@sadeghmoradi80 2 года назад
Thank you!
@simonemoretti803
@simonemoretti803 4 года назад
Great!!! Thank you!!!
@nozsavsev2442
@nozsavsev2442 4 года назад
so good. Withot some useLess information just howto exelent!
@vishweshgm
@vishweshgm Год назад
Hi why the baudrate set to 9600?
@bnwlf
@bnwlf 4 года назад
Thanks a lot for this video! I am moving from simpler MCUs (like C51, ARM7) where i was able to know all the internal registers and its meanings. And now I am getting messy about all this stuff in STM32. Actually, is there any simple way for to check (get noticed) about awaiting incoming character(s) on RX? And get know when TXbuffer is empty or send it byte per byte? Usualy I am using the serial while doing few other thinks. I cannot stand still until the message is sent,. My usual way was checking serial (in main while loop) like this. void Send232_2(void) { if (plssend232_2 == 0) plssend232_2 = RS232TXLENGTH; } void Serve232_2 (void) { unsigned char i=0; unsigned char c = 0x00; if (plssend232_2 > 0) { if ((COM1STA0 & BIT6) == BIT6) //if TX empty { i = RS232TXLENGTH - plssend232_2; c = strts232_2[i]; if (c != 0) { COM1TX = c; plssend232_2--; } else plssend232_2 = 0; }// eof if buffempty } //eof if plssend }
@TheChrisey
@TheChrisey 4 года назад
Tap into CDC_Receive_FS. It gets called whenever you receive data. Use this to check whether the TX is ready or not; USBD_CDC_HandleTypeDef *hcdc = (USBD_CDC_HandleTypeDef*)hUsbDeviceFS.pClassData; if (hcdc->TxState != 0){ return USBD_BUSY; }
@aderoxie6665
@aderoxie6665 4 года назад
i want to send sensor data through USB which contain INT data type, any idea ? cause I've facing some problem sending INT data types
@chiptronWzCz
@chiptronWzCz 4 года назад
you have to convert int to string - check ITOA function
@caubeconan3843
@caubeconan3843 4 года назад
Is this possible to use USB CDC class for both WinUSB and VCP at the same time? Thanks!
@chiptronWzCz
@chiptronWzCz 4 года назад
no, it can be initialized as only one type of USB connection
@jwiegley
@jwiegley 4 года назад
@@chiptronWzCz But you can use the USB peripheral to create a composite device (multiple USB endpoints). You just can't do it with the code created by CubeMX/CubeIDE. You'll have to create the structures/code/initialization manually.
@Kefford666
@Kefford666 4 года назад
Or you can just #include "usbd_cdc_if.h" in your main and then anything else you add there gets included too. SW4STM32 looks nicer than I remember! Keil is meant to be good but I'm finding it kinda clunky tbh...
@myvin2887
@myvin2887 3 года назад
Do you hear anything?
@mirax777
@mirax777 3 года назад
Yeah, the cooler.
@sezaacar7209
@sezaacar7209 4 года назад
i have stm32L476RG i am trying to get 3 cdc port , i am getting some problems . if someone help me i would give more detail to solve it . Thank you , helpfull video
@tanjaberisavljevic3900
@tanjaberisavljevic3900 4 года назад
zer gud
@stefans2143
@stefans2143 2 года назад
Yet another video that should have been a website. Also, adds zero explanation to using the wizzard. Who exactly needs that?
@chiptronWzCz
@chiptronWzCz 2 года назад
See the comments below... A few people appreciated this video
@luisantoniovieiravital5292
@luisantoniovieiravital5292 4 года назад
Hi! thanks for this tutorial. How can i increase the speed receiving data from the pc? I need about 8Mbps using STM32F103, but I can only get half that speed!
@chiptronWzCz
@chiptronWzCz 4 года назад
8Mbps for USB CDC is not supported. You have to use different communication standard of USB
@luisantoniovieiravital5292
@luisantoniovieiravital5292 4 года назад
Really? How can I do to receive data from PC over virtual com port? I reach 9Mbps over USB CDC using Atmega32U4. Like STM32, AVR USB works at full-speed (12Mbps).@@chiptronWzCz
@coderhex1675
@coderhex1675 3 года назад
@@chiptronWzCz using seperate ULPI module connecting it to board with Externel Phy option in CubeMX? Does this configuration allow us to reach 480mbps?
@ianabercrombie7943
@ianabercrombie7943 Год назад
Another video with no audio. Makes it impossible to follw and pretty well useless. In addition, it is now too out of date since the interface has changed.
Далее
🍏 Устарели ОФИЦИАЛЬНО! 🤡
00:32
ГИГАЧАД МЭЙКЕР В PLANTS VS ZOMBIES 2!
00:49
STM32 as HID device - Keyboard | Video 22
24:59
Просмотров 25 тыс.
Can Jewel Bearings Be Pressed In The Home Shop?
17:37
Просмотров 142 тыс.
STM32 USB training - 09.3 USB CDC libusb device lab
16:27
How does USB device discovery work?
36:15
Просмотров 303 тыс.
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 73 тыс.