[Bug] STM32CubeMX: SMBus configuration parameters missing and initialization code not generated for STM32F1

Đang mở
#76 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@KRASTM đang làm issue này rồi.

Từ ngày 13/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug cube mx i2c internal bug tracker smbus
Bug Summary

When configuring I2C as an SMBus-two-wire-Interface for STM32F1 series in STM32CubeMX, the GUI hides all essential SMBus configuration parameters and completely fails to generate the initialization code (MX_I2Cx_SMBUS_Init). This leaves the hardware uninitialized and forces developers to write the setup code manually.

Detailed Description

When configuring the I2C peripheral in SMBus-two-wire-Interface mode for STM32F1 series microcontrollers in STM32CubeMX, the GUI fails to display the standard SMBus parameters (such as I2C Speed Mode, PEC Mode, Clock No Stretch Mode, etc.). It only displays "Primary slave address" under the Parameter Settings tab.

More critically, when clicking "Generate Code", STM32CubeMX completely ignores the SMBus setup. It fails to generate any initialization code for the peripheral (e.g., MX_I2C1_SMBUS_Init() is available from main.c, but it's none of those), leaving the hardware uninitialized.

Steps To Reproduce

Open STM32CubeMX and create a new project for an STM32F1 series MCU (e.g., STM32F103C8Tx).

Go to Connectivity -> I2C1 (or I2C2).

Select SMBus-two-wire-Interface from the Mode dropdown menu.

Go to the Configuration -> Parameter Settings tab.(Notice that only "Primary slave address" is visible, and all other standard SMBus configurations are missing).

Go to the NVIC Settings tab.(Notice that I2C event/error interrupts are either hidden or forcibly grayed out).

Click Generate Code.

Open the generated main.c file.(Note that MX_I2C1_SMBUS_Init() is declared, but the function is empty.)

Expected behavior

The Parameter Settings tab should display all relevant SMBus configurations (Speed mode, PEC enabled/disabled, Clock Stretch, etc.), similar to how it behaves for STM32F0 or F4 series.

The GUI should allow the user to enable I2C Event and Error interrupts.

The code generator must output the initialization function (e.g., MX_I2C1_SMBUS_Init()) using the HAL SMBus driver and call it inside main().

Screenshots:
Screenshot 2026-11-07 154619 Screenshot 2026-11-07 161203 Screenshot 2026-11-11 111233
Environment:

Target MCU: STM32F103C8T6

STM32CubeMX Version: [6.12.0/6.17.0/6.18.1]

STM32Cube MCU Package for STM32F1: V1.8.0/V1.8.5]

Operating System: [Windows 11]

Severity

Critical

Ngôn ngữ chính
HTML
Star
752
Fork
206
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.