cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f411c - No VCP-acceptance - usart2 initialisation under linux ...

timbo2023
Associate III

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

9 REPLIES 9
AScha.3
Chief II

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 ?

If you feel a post has answered your question, please click "Accept as Solution".
timbo2023
Associate III

USB

+

Which uart I must enable in look to

USART2->CR1 |=0x2008;

, too?

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 ?

If you feel a post has answered your question, please click "Accept as Solution".
timbo2023
Associate III

VCP was not recognized - I must enable tx line - but how can I reach further informations regarding it?

timbo2023
Associate III

Should I set a flag?

timbo2023
Associate III

SR or CR1?

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
timbo2023
Associate III

WeAct Black Pill V3.0

 

I thought it must be only a flag setting contextual...

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..