[Feature] Support STM32F103C6 (32KB Flash, 10KB RAM) on stm32f103-blue-pill
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 20/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Estagnada
- Stack de tecnologia
- c
- Domínio
- embedded-iot
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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:
- Flash Overflow: The default firmware image exceeds 32KB, failing to fit or link for the C6 flash boundary.
- RAM Corruption:
board.hand the linker script assume 20KB SRAM (HEAP_ENDat0x20005000), whereas C6 has only 10KB SRAM (HEAP_ENDat0x20002800). Any heap allocation past 10KB causes silent memory corruption or HardFault. - 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:
-
Kconfig Chip Choice:
- Add a
choicebetweenSOC_STM32F103C8(default) andSOC_STM32F103C6. - When C6 is selected, automatically select
RT_USING_SMALL_MEM,RT_USING_SMALL_MEM_AS_HEAP, andRT_KLIBC_USING_LIBC_VSSCANF.
- Add a
-
Accurate Memory Boundaries (
board.h&link.lds):- Dynamically define
STM32_FLASH_SIZE(32KB) andSTM32_SRAM_SIZE(10KB) underSOC_STM32F103C6soHEAP_ENDis strictly bounded at0x20002800. - Update
link.ldswith dynamic_ROM_SIZEand_RAM_SIZEsymbols. - Pass
-Osand--defsym=_ROM_SIZE=32k,--defsym=_RAM_SIZE=10kinrtconfig.pyfor C6 builds.
- Dynamically define
-
Peripheral Constraints (
board/Kconfig):- Guard USART3, SPI2, and RTduino with
depends on !SOC_STM32F103C6. - Add
BSP_USING_SPI1option (supported on C6).
- Guard USART3, SPI2, and RTduino with
-
Flash Optimization Guide:
- Document optimization steps in
README.mdandREADME_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.
- Document optimization steps in
Describe possible alternatives
I have already implemented and verified this solution in the PR #11850
- Linguagem predominante
- C
- Estrelas
- 12.3k
- Forks
- 5.5k
- Merge médio
- 6d 32min
- PRs com merge (30d)
- 24
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de RT-Thread/rt-thread
-
[Bug] [libc] timer_gettime 拆秒前将总纳秒截断为 uint32_t,剩余时间查询错误Talvez já em andamento @Yunlk assumiu há 3 dias. Abertain progress
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
RT-Thread/rt-thread#11924 · 6 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
bug Component component: net
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
RT-Thread/rt-thread#11913 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[Bug] dfs_v2 tmpfs: ftruncate(fd, 0) frees the file buffer but reports success — use-after-free read/write and double free from a legal POSIX callTalvez já em andamento @remukisama assumiu há 7 dias. Abertain progress
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
RT-Thread/rt-thread#11902 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
[bsp][stm32][bluepill] README「快速上手」缺少重新生成 MDK 工程这一步,按文档操作无法编译通过Talvez já em andamento @moment-NEW assumiu há 24 dias. Abertain progress
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
RT-Thread/rt-thread#11818 · 4 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
BSP BSP: Loongson bug RT-Smart
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
RT-Thread/rt-thread#11717 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de RT-Thread/rt-thread
Issues semelhantes
-
enhancement ui
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
ChupathingyCE/chupathingyce#485 ·
Mantenedores costumam responder em até 1 dia
-
Need to correct all URLsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
JustAResearcher/gpu-unlock-ada#98 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
FujiNetWIFI/fujinet-firmware#2216 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 2 dias