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