Troubleshooting STM32F765VIT6 with 8 MHz crystal and 432 MHz PLL for QGC

hello, i have stm32f765vit6 board. The board uses an external crystal of 8mhz, I edited the bootloader configuration and qgc recognized it. However, the fw configuration step is based on fmuv5. I edited STM32_BOARD_XTAL to 8000000ul and PLL as shown

/************************************************************************************
 * Pre-processor Definitions
 ************************************************************************************/

/* Clocking *************************************************************************/
/* The flysae v2 board provides the following clock sources:
 *
 *   X301: 8 MHz crystal for HSE
 *
 * So we have these clock sources available within the STM32
 *
 *   HSI: 16 MHz RC factory-trimmed
 *   HSE: 8 MHz crystal for HSE
 */

#define STM32_BOARD_XTAL        8000000ul

#define STM32_HSI_FREQUENCY     16000000ul
#define STM32_LSI_FREQUENCY     32000
#define STM32_HSE_FREQUENCY     STM32_BOARD_XTAL
#define STM32_LSE_FREQUENCY     0

/* Main PLL Configuration.
 *
 * PLL source is HSE = 8,000,000
 *
 * PLL_VCO = (STM32_HSE_FREQUENCY / PLLM) * PLLN
 * Subject to:
 *
 *     2 <= PLLM <= 63
 *   192 <= PLLN <= 432
 *   192 MHz <= PLL_VCO <= 432MHz
 *
 * SYSCLK  = PLL_VCO / PLLP
 * Subject to
 *
 *   PLLP = {2, 4, 6, 8}
 *   SYSCLK <= 216 MHz
 *
 * USB OTG FS, SDMMC and RNG Clock = PLL_VCO / PLLQ
 * Subject to
 *   The USB OTG FS requires a 48 MHz clock to work correctly. The SDMMC
 *   and the random number generator need a frequency lower than or equal
 *   to 48 MHz to work correctly.
 *
 * 2 <= PLLQ <= 15
 */

/* Highest SYSCLK with USB OTG FS clock = 48 MHz
 *
 * PLL_VCO = (8,000,000 / 4) * 216 = 432 MHz
 * SYSCLK  = 432 MHz / 2 = 216 MHz
 * USB OTG FS, SDMMC and RNG Clock = 432 MHz / 9 = 48 MHz
 */

#define STM32_PLLCFG_PLLM       RCC_PLLCFG_PLLM(4)
#define STM32_PLLCFG_PLLN       RCC_PLLCFG_PLLN(216)
#define STM32_PLLCFG_PLLP       RCC_PLLCFG_PLLP_2
#define STM32_PLLCFG_PLLQ       RCC_PLLCFG_PLLQ(9)

#define STM32_VCO_FREQUENCY     ((STM32_HSE_FREQUENCY / 4) * 216)
#define STM32_SYSCLK_FREQUENCY  (STM32_VCO_FREQUENCY / 2)
#define STM32_OTGFS_FREQUENCY   (STM32_VCO_FREQUENCY / 9)

to ensure 48 MHz clock for OTG and 432 MHz. When connecting to qgc, I get Serial Link Error Link a: (Port: \.\COM6) A device attached to the system is not functioning. Can anyone help me?

I encountered a similar problem and fixed it by disabling all auto-connect in the COM links section. This might be due to a faulty USB port. Once you’ve disabled the COM port error, try flashing the firmware to see if you can access the setup menu. If not, it’s because Mavlink isn’t available on the USB port. You can use the telemetry port to connect and access the setup menu. I’m working on a similar board to yours and experiencing an SD card writing error. If you successfully set up and use the SD card, could you please give me some help? It would be great if we could collaborate.

If you have a telemetry port, you can manually connect using TTL to connect to that COM port, and QGC should work. I think the COM port error is most likely due to a faulty USB port that can’t transmit MavLink, preventing QGC from connecting.