Skip to content

Cortex-M7 Toolchain & STM32 Skeleton #6

@alieissa-commits

Description

@alieissa-commits

Description

Establish the local CMake toolchain for the ARM Cortex-M7 and write the low-level board enablement and initialization code for the STMicroelectronics STM32F767ZI-Nucleo-144 board.

This sets up the isolated foundation for the Network-Connected Environmental Station use-case, localizes all build settings to prevent merge conflicts, and aligns with the clean, decoupled board framework.

Checklist

1. Toolchain & Local Infrastructure

  • Create a local board-specific CMake directory: STMicroelectronics/STM32F767ZI-Nucleo/cmake/.
  • Implement local copies of the build helpers inside STMicroelectronics/STM32F767ZI-Nucleo/cmake/ (arm-gcc-cortex-toolchain.cmake and utilities.cmake) copied and customized from MXChip to achieve 100% target isolation.
  • Create the local toolchain file STMicroelectronics/STM32F767ZI-Nucleo/cmake/arm-gcc-cortex-m7.cmake configuring compiler options specifically for the Cortex-M7 double-precision FPU (-mfloat-abi=hard -mfpu=fpv5-d16).
  • Create localized discovery modules FindCMSIS.cmake and FindSTM32HAL.cmake inside the board's cmake/ folder, configured specifically to discover STM32F7 headers and HAL sources.

2. Directory Structure & SDK Setup

  • Create the target directory structure directly in the root workspace: STMicroelectronics/STM32F767ZI-Nucleo/ (conforming to the <Vendor>/<Board> repository convention).
  • Implement a script or command step to download/clone the lightweight vendor SDK folders (Drivers/CMSIS and Drivers/STM32F7xx_HAL_Driver) from the official STMicroelectronics/STM32CubeF7 repository into STMicroelectronics/STM32F767ZI-Nucleo/lib/stm32cubef7/.

3. Low-Level Startup & Hardware Abstraction

  • Implement the startup/ files:
    • Add the official GCC linker script STM32F767ZITx_FLASH.ld defining Flash and SRAM boundaries.
    • Add the startup assembly startup_stm32f767xx.s defining the hardware vector table and redirecting to SystemInit.
    • Add the ThreadX low-level initialization assembly tx_initialize_low_level.S for Cortex-M7.
    • Add system_stm32f7xx.c to define standard clock-system parameters.

4. Board Initialization & Console Redirect

  • Implement board_init.c and board_init.h to:
    • Configure the System Clock Tree (SystemClock_Config) to run at the maximum 216 MHz utilizing the ST-LINK 8 MHz oscillator bypass.
    • Initialize basic GPIOs (User LEDs, User Button).
  • Implement console.c and console.h to initialize the virtual COM port UART (USART3 on pins PD8/PD9) and redirect printf outputs through nanoprintf.

5. Ethernet PHY Initialization

  • Implement low-level Ethernet controller and RMII pin configurations.
  • Write the initialization sequence for the on-board LAN8742A Ethernet PHY (setting up transceiver speeds, autonegotiation, and clock gating) to prepare for the NetX Duo IP stack.

Metadata

Metadata

Labels

GSoCGoogle Summer of Code participant tasks

Type

No type
No fields configured for issues without a type.

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions