Skip to content

Conversation

adam-embedded
Copy link

This pull request adds the functionality for the stm32l496ZG nucleo board. USB has been tested with all example code.

Increased the GPIO pin speeds for USB on the STM32L4 family.

@hathach hathach requested a review from Copilot September 3, 2025 10:43
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for the STM32L496ZG Nucleo board to the existing STM32L4 board support package. It includes complete board configuration files and improves USB GPIO pin speed settings for the entire STM32L4 family.

  • Added complete board support files for the STM32L496 Nucleo board
  • Updated GPIO pin speed configuration for USB pins from HIGH to VERY_HIGH speed
  • Created linker script, build configuration, and board header files

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
hw/bsp/stm32l4/family.c Updated USB GPIO pin speed to very high for better USB performance
hw/bsp/stm32l4/boards/stm32l496nucleo/board.mk Make build configuration defining compiler flags and linker files
hw/bsp/stm32l4/boards/stm32l496nucleo/board.h Board header with pin definitions, clock configuration, and initialization functions
hw/bsp/stm32l4/boards/stm32l496nucleo/board.cmake CMake build configuration with MCU variant and target definitions
hw/bsp/stm32l4/boards/stm32l496nucleo/STM32L496XX_FLASH.ld Linker script defining memory layout for the STM32L496ZG microcontroller

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


# GCC
SRC_S_GCC += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32l496xx.s
LD_FILE_GCC = $(BOARD_PATH)/STM32L496KBUx_FLASH.ld
Copy link
Preview

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linker file reference 'STM32L496KBUx_FLASH.ld' doesn't match the actual file 'STM32L496XX_FLASH.ld' in the same directory. This will cause build failures.

Suggested change
LD_FILE_GCC = $(BOARD_PATH)/STM32L496KBUx_FLASH.ld
LD_FILE_GCC = $(BOARD_PATH)/STM32L496XX_FLASH.ld

Copilot uses AI. Check for mistakes.

@@ -0,0 +1,10 @@
set(MCU_VARIANT stm32l496xx)
set(JLINK_DEVICE stm32l496kb)
Copy link
Preview

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JLINK_DEVICE is set to 'stm32l496kb' but the board is STM32L496ZG according to the URL in board.h and PR description. This should be 'stm32l496zg' to match the actual device.

Suggested change
set(JLINK_DEVICE stm32l496kb)
set(JLINK_DEVICE stm32l496zg)

Copilot uses AI. Check for mistakes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copilot is right, are we using the correct variant here ?

/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48|RCC_OSCILLATORTYPE_HSI;
Copy link
Preview

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clock configuration comment states 'System Clock source = PLL (MSI)' but the actual PLL source is configured as HSI. The comment should be updated to reflect the actual HSI-based configuration.

Copilot uses AI. Check for mistakes.

RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
Copy link
Preview

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The clock configuration comment states 'System Clock source = PLL (MSI)' but the actual PLL source is configured as HSI. The comment should be updated to reflect the actual HSI-based configuration.

Copilot uses AI. Check for mistakes.

@hathach hathach force-pushed the with-stm32l496nucleo branch from 1b7f7db to f69d894 Compare September 3, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants