Arm Mbed OS support forum

Mbed support usb for STM32H743VIT6

I trie to use a non standard card with STM32H743VIT6. The profile used for Mbed is “NUCLEO_H743ZI2” and blink test works but the initialization of the USB serial does not work. The problem should be the clock source set to 25000000 and not 8000000.
I changed the following parameters in target.json as follows:

Blockquote
“NUCLEO_H743ZI2”: {


“hse_value”: {
“help”: “HSE default value is 25MHz in HAL”,
“value”: “25000000”,
“macro_name”: “HSE_VALUE”
},
“usb_speed”: {
“help”: “USE_USB_OTG_FS or USE_USB_OTG_HS or USE_USB_HS_IN_FS”,
“value”: “USE_USB_OTG_FS”
}

and the file system_clock.c

RCC_OscInitStruct.PLL.PLLM = 4;   // 2 MHz
RCC_OscInitStruct.PLL.PLLN = 400; // 800 MHz
RCC_OscInitStruct.PLL.PLLP = 2;   // PLLCLK = SYSCLK = 400 MHz
RCC_OscInitStruct.PLL.PLLQ = 80;  // PLL1Q used for FDCAN = 10 MHz
RCC_OscInitStruct.PLL.PLLR = 2;
RCC_OscInitStruct.PLL.PLLFRACN = 0;

with this parameters blink is working with no usb serial detect

This is code used for testing:

Blockquote
#include “mbed.h”
#include “USBSerial.h”
// Blinking rate in milliseconds
#define BLINKING_RATE 500ms
int main()
{
// Initialise the digital pin LED1 as an output
DigitalOut led(PA_1);
USBSerial pc(USBTX, USBRX);
pc.printf(“I am a serial port\r\n”); // 12 Mbit/s (USB full-speed)
while (true) {
led = !led;
ThisThread::sleep_for(BLINKING_RATE);
}
}

Hello,

usually is good to share with us some informations about Mbed OS version, about a tool what you use and share a link of the example what you tried.

Anyway, you probably mixed something. I see above you try to setup the USB OTG aka onchip USB interface. But the code more looks like old code for old library with UART.

BR, Jan

I have created a custom target for a Devebox Board, maybe this fits:
DEVEBOX_H743VI
There I searched long time for a bug why USB didn’t work, but at least it should work for all H743. And of course, the clock must fit your hardware. The Devebox board uses a 25 MHz crystal and the settings are for this one, but the H743 has a lot of clock options that maybe manually adjusted in system_clock.c.
Maybe this repo is outdated again, its a hard race against Jeromes work :slight_smile:

I have created a custom target for a Devebox Board, maybe this fits:

There I searched long time for a bug why USB didn’t work, but at least it should work for all H743. And of course, the clock must fit your hardware. The Devebox board uses a 25 MHz crystal and the settings are for this one, but the H743 has a lot of clock options that maybe manually adjusted in system_clock.c.
Maybe this repo is outdated again, its a hard race against Jeroumes work :slight_smile:

I’ll do some testing using the JojoS62 target version.
I forgot to inform that the test are done with the latest version of mbed 6.0
thank you for the replies