Skip to content

Commit 06e924e

Browse files
committed
board: add NUCLEO-F429ZI board support
Add initial support for the STM32 NUCLEO-F429ZI board. This commit introduces a new board definition, including board initialization code, build rules, and default configuration. It also updates Kconfig and Makefile entries to integrate the new board into the build system. The board configuration supports the on-board ST-Link Virtual COM Port (VCOM) using USART3, allowing kernel log output and debugging via the standard USB ST-Link interface without additional hardware. - Add new board definition under board/nucleof429 - board initialization code - build.mk and defconfig - Update board and platform Kconfig entries - Update top-level Makefile for board selection - Enable USART3 for ST-Link VCOM console output - STM32 NUCLEO-F429ZI - ST-Link V2-1 (on-board)
1 parent ce791fa commit 06e924e

11 files changed

Lines changed: 147 additions & 4 deletions

File tree

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ifeq "$(CONFIG_BOARD_STM32F429DISCOVERY)" "y"
1818
BOARD ?= discoveryf429
1919
else ifeq "$(CONFIG_BOARD_NETDUINOPLUS2)" "y"
2020
BOARD ?= netduinoplus2
21+
else ifeq "$(CONFIG_BOARD_STM32F429NUCLEO)" "y"
22+
BOARD ?= nucleof429
2123
else
2224
BOARD ?= discoveryf4
2325
endif

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ with a focus on efficiency (performance and power consumption) and security
5555
F9 Microkernel supports the following boards:
5656
* [STM32F4DISCOVERY](https://www.st.com/en/evaluation-tools/stm32f4discovery.html)
5757
* [STM32F429I-DISC1](https://www.st.com/en/evaluation-tools/32f429idiscovery.html)
58-
- Both are based on ARM Cortex-M4F core. F9 should work on any STM32F40x/STM32F429/STM32F439 microcontroller.
58+
* [NUCLEO-F429ZI](https://www.st.com/en/evaluation-tools/nucleo-f429zi.html)
59+
- All supported boards are based on the ARM Cortex-M4F core. F9 should work on any STM32F40x/STM32F429/STM32F439 microcontroller.
5960
* Netduino Plus 2 (STM32F405RGT6)
6061
- Supported by upstream [QEMU for emulation](https://www.qemu.org/docs/master/system/arm/stm32.html), making it ideal for development and testing without hardware.
6162

@@ -108,6 +109,17 @@ For STM32F429I-DISC1:
108109
| USART2 | PD5 | PD6 |
109110
| USART1 | PA9 | PA10 |
110111

112+
For NUCLEO-F429ZI:
113+
114+
| Port | TX Pin | RX Pin |
115+
|--------|--------|--------|
116+
| USART3 | PD8 | PD9 |
117+
| USART2 | PD5 | PD6 |
118+
| USART1 | PB6 | PB7 |
119+
120+
> **Note:** On the NUCLEO-F429ZI, `USART3` is connected to the on-board
121+
> **VCOM (Virtual COM Port)** provided by the ST-LINK.
122+
111123
For Netduino Plus 2 under QEMU, the default configuration uses USART1, which
112124
QEMU routes to the console. Run with:
113125

board/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ config BOARD_NETDUINOPLUS2
2929
Netduino Plus 2 board with STM32F405RGT6 MCU.
3030
This board is supported by upstream QEMU for emulation.
3131

32+
config BOARD_STM32F429NUCLEO
33+
bool "STM32F429 Nucleo"
34+
select PLATFORM_STM32F429
35+
help
36+
STM32F429 Nucleo board with STM32F429ZIT6 MCU.
37+
3238
endchoice
3339

3440
config QEMU

board/nucleof429/board.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
2+
* Use of this source code is governed by a BSD-style license that can be
3+
* found in the LICENSE file.
4+
*/
5+
6+
#include <platform/stm32f429/gpio.h>
7+
#include <platform/stm32f429/usart.h>
8+
#include "board.h"
9+
10+
struct usart_dev console_uart = {
11+
.u_num = 3,
12+
.baud = 115200,
13+
BOARD_USART_CONFIGS
14+
.tx = {
15+
.port = BOARD_USART_TX_IO_PORT,
16+
.pin = BOARD_USART_TX_IO_PIN,
17+
.pupd = GPIO_PUPDR_NONE,
18+
.type = GPIO_MODER_ALT,
19+
.func = BOARD_USART_FUNC,
20+
.o_type = GPIO_OTYPER_PP,
21+
.speed = GPIO_OSPEEDR_50M,
22+
},
23+
.rx = {
24+
.port = BOARD_USART_RX_IO_PORT,
25+
.pin = BOARD_USART_RX_IO_PIN,
26+
.pupd = GPIO_PUPDR_NONE,
27+
.type = GPIO_MODER_ALT,
28+
.func = BOARD_USART_FUNC,
29+
.o_type = GPIO_OTYPER_PP,
30+
.speed = GPIO_OSPEEDR_50M,
31+
},
32+
};

board/nucleof429/board.h

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/* Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
2+
* Use of this source code is governed by a BSD-style license that can be
3+
* found in the LICENSE file.
4+
*/
5+
6+
#ifndef NUCLEO_F429_BOARD_H_
7+
#define NUCLEO_F429_BOARD_H_
8+
9+
#include <platform/stm32f429/registers.h>
10+
#include <platform/stm32f429/gpio.h>
11+
#include <platform/stm32f429/usart.h>
12+
#include <platform/stm32f429/nvic.h>
13+
#include <platform/stm32f429/systick.h>
14+
15+
extern struct usart_dev console_uart;
16+
17+
#if defined(CONFIG_DBGPORT_USE_USART1)
18+
19+
#define BOARD_UART_DEVICE USART1_IRQn
20+
#define BOARD_UART_HANDLER USART1_HANDLER
21+
#define BOARD_USART_FUNC af_usart1
22+
#define BOARD_USART_CONFIGS \
23+
.base = USART1_BASE, \
24+
.rcc_apbenr = RCC_USART1_APBENR, \
25+
.rcc_reset = RCC_APB2RSTR_USART1RST,
26+
#define BOARD_USART_TX_IO_PORT GPIOB
27+
#define BOARD_USART_TX_IO_PIN 6
28+
#define BOARD_USART_RX_IO_PORT GPIOB
29+
#define BOARD_USART_RX_IO_PIN 7
30+
31+
32+
#elif defined(CONFIG_DBGPORT_USE_USART2)
33+
34+
#define BOARD_UART_DEVICE USART2_IRQn
35+
#define BOARD_UART_HANDLER USART2_HANDLER
36+
#define BOARD_USART_FUNC af_usart2
37+
#define BOARD_USART_CONFIGS \
38+
.base = USART2_BASE, \
39+
.rcc_apbenr = RCC_USART2_APBENR, \
40+
.rcc_reset = RCC_APB1RSTR_USART2RST,
41+
#define BOARD_USART_TX_IO_PORT GPIOD
42+
#define BOARD_USART_TX_IO_PIN 5
43+
#define BOARD_USART_RX_IO_PORT GPIOD
44+
#define BOARD_USART_RX_IO_PIN 6
45+
46+
#else /* default: USART3 (ST-LINK virtual COM port on Nucleo-F429ZI) */
47+
48+
#define BOARD_UART_DEVICE USART3_IRQn
49+
#define BOARD_UART_HANDLER USART3_HANDLER
50+
#define BOARD_USART_FUNC af_usart3
51+
#define BOARD_USART_CONFIGS \
52+
.base = USART3_BASE, \
53+
.rcc_apbenr = RCC_USART3_APBENR, \
54+
.rcc_reset = RCC_APB1RSTR_USART3RST,
55+
#define BOARD_USART_TX_IO_PORT GPIOD
56+
#define BOARD_USART_TX_IO_PIN 8
57+
#define BOARD_USART_RX_IO_PORT GPIOD
58+
#define BOARD_USART_RX_IO_PIN 9
59+
60+
#endif
61+
62+
#endif /* NUCLEO_F429_BOARD_H_ */

board/nucleof429/build.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
2+
# Use of this source code is governed by a BSD-style license that can be
3+
# found in the LICENSE file.
4+
5+
CHIP := stm32f429
6+
PLATFORM := stm32
7+
STM32_VARIANT := f4
8+
9+
board-y = board.o
10+
loader-board-y = board.loader.o

board/nucleof429/defconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CONFIG_BOARD_STM32F429NUCLEO=y
2+
CONFIG_DBGPORT_USE_USART3=y
3+
CONFIG_EXTI0_USER_IRQ=y
4+
CONFIG_EXTI1_USER_IRQ=y
5+
CONFIG_ETH_USER_IRQ=y
6+
CONFIG_BUILD_USER_APPS=y
7+
CONFIG_PINGPONG=y
8+
CONFIG_EXTI_INTERRUPT_TEST=y
9+
CONFIG_L4_TEST=y

kernel/memory.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ static mempool_t memmap[] = {
9797
DECLARE_MEMPOOL("LCD_FRAME_BUFFER_2", 0xD00A0000, 0xD0140000,
9898
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
9999
#endif
100+
#ifdef CONFIG_BOARD_STM32F429NUCLEO
101+
DECLARE_MEMPOOL("APB2_3DEV", 0x40015000, 0x40015c00,
102+
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
103+
DECLARE_MEMPOOL("APB2_4DEV", 0x40016800, 0x40017900,
104+
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
105+
DECLARE_MEMPOOL("CR_PLLSAION_BB", 0x42470000, 0x42470c00,
106+
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
107+
#endif
100108
};
101109

102110
DECLARE_KTABLE(as_t, as_table, CONFIG_MAX_ADRESS_SPACES);

platform/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ config DBGPORT_USE_USART1
4242
bool "USART1"
4343
config DBGPORT_USE_USART2
4444
bool "USART2"
45+
config DBGPORT_USE_USART3
46+
bool "USART3"
4547
config DBGPORT_USE_USART4
4648
bool "USART4"
4749

platform/stm32f429/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ config TIM1_CC_USER_IRQ
112112
bool "TIM1_CC User IRQ"
113113
default n
114114

115-
config TIM2_USER_IRQ
115+
config TIM2_USER_IRQ
116116
bool "TIM2 User IRQ"
117117
default n
118118

@@ -180,7 +180,7 @@ config TIM8_UP_TIM13_USER_IRQ
180180
bool "TIM8_UP_TIM13 User IRQ"
181181
default n
182182

183-
config TIM8_TRG_COM_TIM14_USER_IRQ
183+
config TIM8_TRG_COM_TIM14_USER_IRQ
184184
bool "TIM8_TRG_COM_TIM14 User IRQ"
185185
default n
186186

0 commit comments

Comments
 (0)