Files
STM32F4-Base/Inc
wandering1 a14011380e feat(gpio): sync CubeMX regen: 6 new KO pins + netTask stack 960
Sync CubeMX regen output for the 6 newly assigned output pins:
KO5=PC15, KO4=PF5, KO_LED1=PF2, KO_LED2=PF3, KO_LED3=PE6,
KO_24V=PF4.  All are push-pull, no-pull, low initial level in
MX_GPIO_Init.  The BSP driver does not own these pins yet; the
drivable output count stays 4 (ioboard_do_write 4-bit mask).

netTask stack reduced from 1408 to 960 words, in both .ioc
FREERTOS.Tasks01 and freertos.c generated region.  Rebuilt the
cubemx-survival baseline for the ioc-task-stacks drift (only that
one entry changed); --check now returns 0.

Keil full rebuild verified: 0 errors, 0 warnings.  Refilled the
RAM budget ledger and memory snapshot from the authoritative map
along with the trend row and size attestation; --gate and --scan
both return 0.  Regenerated the managed task tables in README and
AGENTS from freertos.c (netTask 960); task-table --check passes.
Doc sync and the 6-pin question were committed in 795ce970.
2026-11-18 12:32:10 +08:00
..

Inc/ — CubeMX 生成的头文件

⚠️ 本目录文件由 STM32CubeMX 生成(.ioc 重生成会覆盖),不是自研代码。 允许在 USER CODE BEGIN/END 标记区之间写自定义内容。

文件一览

文件 生成 作用
main.h CubeMX 主头文件:引脚宏定义(xxx_Pin / xxx_GPIO_Port)
FreeRTOSConfig.h CubeMX FreeRTOS 内核配置(堆大小、tick、优先级位数等)
stm32f4xx_hal_conf.h CubeMX HAL 模块裁剪开关(启用/禁用各外设 HAL 模块)
stm32f4xx_it.h CubeMX 中断服务函数声明
gpio.h / dma.h / spi.h / i2c.h / usart.h CubeMX 各外设初始化函数声明

⚠️ 修改约定

  • 自定义内容只写 USER CODE BEGIN xxx / USER CODE END xxx 标记区之间
  • 引脚宏(如 CH395F_CS_Pin)在 main.h 中定义,改引脚须在 CubeMX 中改后重新生成

关键配置速查

配置 值 位置
FreeRTOS 堆 configTOTAL_HEAP_SIZE(已迁 CCM) FreeRTOSConfig.h
栈溢出检查 configCHECK_FOR_STACK_OVERFLOW = 2 FreeRTOSConfig.h
HAL 时基 TIM7(HAL_TIMEBASE 覆盖) stm32f4xx_hal_conf.h + Src/
NVIC 分组 4 位优先级 CubeMX 配置

相关文档

  • 内存/堆预算:docs/内存管理/RAM使用分析与优化方案.md
  • 硬件引脚:根 README.md「外设接口」表