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”
}
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);
}
}
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.
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
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
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