Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature] Support STM32F103C6 (32KB Flash, 10KB RAM) on stm32f103-blue-pill

オープン
#11,854 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
c
領域
embedded-iot

調査の方向性

The issue names bsp/stm32/stm32f103-blue-pill, including board.h, link.lds, rtconfig.py, board/Kconfig, README.md, and README_zh.md. Start by reviewing PR #11850, which the issue says already implements and verifies the proposed solution. Check its changes and validation against the C6 memory and peripheral constraints; the work is done when C6 builds fit its memory limits while the default C8 remains compatible.

索引モデルが issue の本文から書いたものです。

説明

Arch: ARM/AArch64 BSP BSP: STM32 enhancement
Affected area

Board Support Package (BSP)

Hardware/BSP vendor

STM32

Architecture

ARM / AArch64

Describe problem solved by the proposed feature

Currently, bsp/stm32/stm32f103-blue-pill only supports the STM32F103C8 chip (64KB/128KB Flash, 20KB RAM).
However, many widely available Blue Pill development boards on the market come populated with the lower-cost, pin-compatible STM32F103C6T6 (32KB Flash, 10KB RAM).

Attempting to run the existing BSP on an STM32F103C6 board causes several issues:

  1. Flash Overflow: The default firmware image exceeds 32KB, failing to fit or link for the C6 flash boundary.
  2. RAM Corruption: board.h and the linker script assume 20KB SRAM (HEAP_END at 0x20005000), whereas C6 has only 10KB SRAM (HEAP_END at 0x20002800). Any heap allocation past 10KB causes silent memory corruption or HardFault.
  3. Peripheral Differences: STM32F103C6 silicon physically lacks USART3 and SPI2.
Describe your preferred solution

Add support for the STM32F103C6 variant to bsp/stm32/stm32f103-blue-pill while keeping 100% backward compatibility for the default STM32F103C8:

  1. Kconfig Chip Choice:

    • Add a choice between SOC_STM32F103C8 (default) and SOC_STM32F103C6.
    • When C6 is selected, automatically select RT_USING_SMALL_MEM, RT_USING_SMALL_MEM_AS_HEAP, and RT_KLIBC_USING_LIBC_VSSCANF.
  2. Accurate Memory Boundaries (board.h & link.lds):

    • Dynamically define STM32_FLASH_SIZE (32KB) and STM32_SRAM_SIZE (10KB) under SOC_STM32F103C6 so HEAP_END is strictly bounded at 0x20002800.
    • Update link.lds with dynamic _ROM_SIZE and _RAM_SIZE symbols.
    • Pass -Os and --defsym=_ROM_SIZE=32k,--defsym=_RAM_SIZE=10k in rtconfig.py for C6 builds.
  3. Peripheral Constraints (board/Kconfig):

    • Guard USART3, SPI2, and RTduino with depends on !SOC_STM32F103C6.
    • Add BSP_USING_SPI1 option (supported on C6).
  4. Flash Optimization Guide:

    • Document optimization steps in README.md and README_zh.md (disabling serial DMA, FinSH symbol descriptions, and reducing shell stack to 2048) to fit standard RT-Thread with interactive FinSH (msh >) within 32KB.
Describe possible alternatives

I have already implemented and verified this solution in the PR #11850

主要言語
C
スター
12.3k
フォーク
5.5k
平均マージ
3日 8時間
マージ済み PR(30日)
27

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RT-Thread/rt-thread のほかの issue

RT-Thread/rt-thread の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。