STM32 项目迁移与 NuttX 说明
前面使用了 STM32F407 实现了一个类似 UART hub 的项目,最近接手了一个 STM32F205 的项目。由于 AI 对 Linux 应用编程十分强大,并且该项目对实时性的要求不是很高,我们希望将 NuttX 操作系统 引入到项目中,以简化开发流程。
但是,关于 STM32F205,在官方对 NuttX 的支持上存在一些问题。据我了解,官方支持最完善的是 STM32F103 和 STM32F407,因此以后如果大家打算使用 NuttX 做项目,尽量优先选择这两个主芯片,这样驱动、调试会更顺利。
目前 NuttX 对 STM32F205 的支持还存在较多问题,不过这也正好可以锻炼自己的调试能力。因此我仍然决定不遗余力地在 STM32F205 上尝试 NuttX。
当前进展
首先要解决的是两个核心问题:
- 建立项目(project setup);
- 编译(build)。
这两部分与之前在 F407 上的流程类似,这里不再赘述。
在此补充说明一下我们的平台信息:我们使用的是 STM32F205VET6。在 NuttX 源代码目录下搜索 STM32F205 输出如下:
kelland@HP-Desktop-PC:~/nuttx_new_stm32f205/nuttx$ grep "STM32F205" -r ./
./arch/arm/include/stm32/chip.h:#elif defined(CONFIG_ARCH_CHIP_STM32F205RG) /* UFBGA-176 1024Kb FLASH 128Kb SRAM */
./arch/arm/src/stm32/Kconfig:config ARCH_CHIP_STM32F205RG
./arch/arm/src/stm32/Kconfig: bool "STM32F205RG"
./arch/arm/src/stm32/Kconfig: select STM32_STM32F205
./arch/arm/src/stm32/Kconfig:config STM32_STM32F205
./Documentation/platforms/arm/stm32l4/boards/b-l475e-iot01a/index.rst: compliant), which consists of BCM43362 and STM32F205 host processor
./Documentation/platforms/arm/stm32l4/boards/b-l475e-iot01a/index.rst: tcp/ip stack is built-in STM32F205 in Wi-Fi® module.
./Documentation/platforms/arm/stm32f2/boards/emw3162/index.rst:STM32F205RG MCU and Broadcom BCM43362KUBG Wi-Fi chip.
./Documentation/platforms/arm/stm32f2/boards/emw3162/index.rst:The STM32F205RG is a 120 MHz Cortex-M3 operation with 1MB Flash
./Documentation/platforms/arm/stm32f2/boards/photon/index.rst:Particle.io Photon board featuring the STM32F205RG MCU.
./Documentation/platforms/arm/stm32f2/boards/photon/index.rst:The STM32F205RG is a 120 MHz Cortex-M3 operation with 1MB Flash
./Documentation/ReleaseNotes/NuttX-7.21:Piriou. The Photon board is based on a STM32F205G MCU with and on-
./Documentation/ReleaseNotes/NuttX-7.10:- STM32F205RG: Add basic support for the STM32F205RG. From SourceForge
./boards/arm/stm32/emw3162/scripts/ld.script:/* The STM32F205RG has 1024Kb of FLASH beginning at address 0x0800:0000 and
./boards/arm/stm32/emw3162/configs/nsh/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/emw3162/configs/wlan/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/scripts/photon_jtag.ld:/* The STM32F205RG has 1024Kb of FLASH beginning at address 0x0800:0000 and
./boards/arm/stm32/photon/scripts/photon_dfu.ld:/* The STM32F205RG has 1024Kb of FLASH beginning at address 0x0800:0000 and
./boards/arm/stm32/photon/configs/nsh/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/configs/usbnsh/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/configs/wlan-perf/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/configs/rgbled/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/configs/wlan/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/arm/stm32/photon/configs/adb/defconfig:CONFIG_ARCH_CHIP_STM32F205RG=y
./boards/Kconfig: depends on ARCH_CHIP_STM32F205RG
./boards/Kconfig: features the STM32F205RGY6 MCU and BCM43362KUBG Wi-Fi chip.
kelland@HP-Desktop-PC:~/nuttx_new_stm32f205/nuttx$
可以看到源码里只对 STM32F205RG 有现成的支持。基于“代码量多/示例多”的考虑,我们选择了 photon 项目作为起点。
./tools/configure.sh photon:nsh
编译并烧录后没有串口输出,调试过程很长,下一小节里我会做更细致的讲解。

被折叠的 条评论
为什么被折叠?



