cancel
Showing results for 
Search instead for 
Did you mean: 

UCB CVP won't work in STM32F412RG

SMaes.3
Associate

I'm struggling already many days getting the most simple VCP functionality working in my application.

I tried implementing the UM1021 usb OTG lib provide as extension on the STD peripheral library from ST, but without succes. After that I tried the simplified lib from https://stm32f4-discovery.net/2014/08/library-24-virtual-com-port-vcp-stm32f4xx/ which seems to be using the same STD lib but without support for OTG and usb HOST.

Also this wont work.

The propblem is that I get no USB enumeration on my PC at all. Also not whith the message of an unknown or not working usb device.

Actually I don't know what I can check where the problem is.

I only connected D- and D+ pins and the usb connection is powering my micro with an external voltage regulator. ID pin and VUSB is not connected to anything.

I saw that the libraries are mostly tested on STM's that run on 168Mhz. My STMF32F412 can only run at 100Mhz, but I've set my PLL values in a way that PLLQ is stil 48Mhz

(HSE =25Mhz,PLLM=15, N = 144, P=4 and Q=5, which results in a SysClk of 60Mhz and a PLLQ of 48Mhz) Should I adapt the lib for that?

There is a delay function:

void USB_OTG_BSP_uDelay (const uint32_t usec) {
	uint32_t count = 0;
	const uint32_t utime = (120 * usec / 7);
	
	do
	{
		if ( ++count > utime ) {
			return ;
		}
	} while (1);
}

I expect this is only making a microSecond delay at a fixed given MCU speed?

Can anybody help me?

I cannopt use CubeMx and have to use the Std peripheral lib from ST because I'm makeing a library which should use an external HAL (which is the STD one)

0 REPLIES 0