2023-12-22 09:21 PM
Good Morning,
when I use the following short function for initialisation - no VCP is detected under Linux:
void USART2_Init(void){
RCC->APB1ENR|=RCC_APB1ENR_USART2EN;
RCC->AHB1ENR|=RCC_AHB1ENR_GPIOAEN;
... ?!?!
GPIOA->AFR[0]=0x0700;
GPIOA->MODER|=(1<<5);
GPIOA->MODER&=~(1<<4);
USART2->BRR = 0x0681;
USART2->CR1 |=0x2008;
}
Is it a RCC reset register issue?
Best regards
TIMBO
2023-12-23 12:45 AM
VCP is a function on an USB device, so which device you use to do this ?
+
Just enabling an uart on a cpu : where you connected the uart lines rx/tx to ?
2023-12-23 04:13 AM
USB
+
Which uart I must enable in look to
USART2->CR1 |=0x2008;
, too?
2023-12-23 04:22 AM
You giving no information - so what kind of help you expect ?
F411 ...
- what board ?
- USB device, so which device you use ?
- where you connected the uart lines rx/tx to ?
2023-12-23 04:27 AM
VCP was not recognized - I must enable tx line - but how can I reach further informations regarding it?
2023-12-23 04:33 AM
Should I set a flag?
2023-12-23 04:41 AM
SR or CR1?
2023-12-23 04:44 AM
What board are you using, provide link to vendor website or picture.
There's a USB connector on this board?
UARTs don't magically provide USB or VCP connections by themselves.
For a standalone chip you'd need to code a USB Device using the CDC/VCP Class to be recognized.
For a NUCLEO or DISCO board the ST-LINK might provide a VCP for the target STM32
2023-12-23 04:47 AM
WeAct Black Pill V3.0
I thought it must be only a flag setting contextual...
2023-12-23 04:59 AM
The USB here connects directly to the STM32F411. To have it appear as a VCP you will need software on it that presents as a USB CDC Class Device.
Simply enabling a UART doesn't do that. That will provide pin level serial output, that's all.