Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ ifeq "$(CONFIG_BOARD_STM32F429DISCOVERY)" "y"
BOARD ?= discoveryf429
else ifeq "$(CONFIG_BOARD_NETDUINOPLUS2)" "y"
BOARD ?= netduinoplus2
else ifeq "$(CONFIG_BOARD_STM32F429NUCLEO)" "y"
BOARD ?= nucleof429
else
BOARD ?= discoveryf4
endif
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ with a focus on efficiency (performance and power consumption) and security
F9 Microkernel supports the following boards:
* [STM32F4DISCOVERY](https://www.st.com/en/evaluation-tools/stm32f4discovery.html)
* [STM32F429I-DISC1](https://www.st.com/en/evaluation-tools/32f429idiscovery.html)
- Both are based on ARM Cortex-M4F core. F9 should work on any STM32F40x/STM32F429/STM32F439 microcontroller.
* [NUCLEO-F429ZI](https://www.st.com/en/evaluation-tools/nucleo-f429zi.html)
- All supported boards are based on the ARM Cortex-M4F core. F9 should work on any STM32F40x/STM32F429/STM32F439 microcontroller.
* Netduino Plus 2 (STM32F405RGT6)
- 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.

Expand Down Expand Up @@ -108,6 +109,17 @@ For STM32F429I-DISC1:
| USART2 | PD5 | PD6 |
| USART1 | PA9 | PA10 |

For NUCLEO-F429ZI:

| Port | TX Pin | RX Pin |
|--------|--------|--------|
| USART3 | PD8 | PD9 |
| USART2 | PD5 | PD6 |
| USART1 | PB6 | PB7 |

> **Note:** On the NUCLEO-F429ZI, `USART3` is connected to the on-board
> **VCOM (Virtual COM Port)** provided by the ST-LINK.

For Netduino Plus 2 under QEMU, the default configuration uses USART1, which
QEMU routes to the console. Run with:

Expand Down
6 changes: 6 additions & 0 deletions board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ config BOARD_NETDUINOPLUS2
Netduino Plus 2 board with STM32F405RGT6 MCU.
This board is supported by upstream QEMU for emulation.

config BOARD_STM32F429NUCLEO
bool "STM32F429 Nucleo"
select PLATFORM_STM32F429
help
STM32F429 Nucleo board with STM32F429ZIT6 MCU.

endchoice

config QEMU
Expand Down
32 changes: 32 additions & 0 deletions board/nucleof429/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

#include <platform/stm32f429/gpio.h>
#include <platform/stm32f429/usart.h>
#include "board.h"

struct usart_dev console_uart = {
.u_num = 3,
.baud = 115200,
BOARD_USART_CONFIGS
.tx = {
.port = BOARD_USART_TX_IO_PORT,
.pin = BOARD_USART_TX_IO_PIN,
.pupd = GPIO_PUPDR_NONE,
.type = GPIO_MODER_ALT,
.func = BOARD_USART_FUNC,
.o_type = GPIO_OTYPER_PP,
.speed = GPIO_OSPEEDR_50M,
},
.rx = {
.port = BOARD_USART_RX_IO_PORT,
.pin = BOARD_USART_RX_IO_PIN,
.pupd = GPIO_PUPDR_NONE,
.type = GPIO_MODER_ALT,
.func = BOARD_USART_FUNC,
.o_type = GPIO_OTYPER_PP,
.speed = GPIO_OSPEEDR_50M,
},
};
62 changes: 62 additions & 0 deletions board/nucleof429/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

#ifndef NUCLEO_F429_BOARD_H_
#define NUCLEO_F429_BOARD_H_

#include <platform/stm32f429/registers.h>
#include <platform/stm32f429/gpio.h>
#include <platform/stm32f429/usart.h>
#include <platform/stm32f429/nvic.h>
#include <platform/stm32f429/systick.h>

extern struct usart_dev console_uart;

#if defined(CONFIG_DBGPORT_USE_USART1)

#define BOARD_UART_DEVICE USART1_IRQn
#define BOARD_UART_HANDLER USART1_HANDLER
#define BOARD_USART_FUNC af_usart1
#define BOARD_USART_CONFIGS \
.base = USART1_BASE, \
.rcc_apbenr = RCC_USART1_APBENR, \
.rcc_reset = RCC_APB2RSTR_USART1RST,
#define BOARD_USART_TX_IO_PORT GPIOB
#define BOARD_USART_TX_IO_PIN 6
#define BOARD_USART_RX_IO_PORT GPIOB
#define BOARD_USART_RX_IO_PIN 7


#elif defined(CONFIG_DBGPORT_USE_USART2)

#define BOARD_UART_DEVICE USART2_IRQn
#define BOARD_UART_HANDLER USART2_HANDLER
#define BOARD_USART_FUNC af_usart2
#define BOARD_USART_CONFIGS \
.base = USART2_BASE, \
.rcc_apbenr = RCC_USART2_APBENR, \
.rcc_reset = RCC_APB1RSTR_USART2RST,
#define BOARD_USART_TX_IO_PORT GPIOD
#define BOARD_USART_TX_IO_PIN 5
#define BOARD_USART_RX_IO_PORT GPIOD
#define BOARD_USART_RX_IO_PIN 6

#else /* default: USART3 (ST-LINK virtual COM port on Nucleo-F429ZI) */

#define BOARD_UART_DEVICE USART3_IRQn
#define BOARD_UART_HANDLER USART3_HANDLER
#define BOARD_USART_FUNC af_usart3
#define BOARD_USART_CONFIGS \
.base = USART3_BASE, \
.rcc_apbenr = RCC_USART3_APBENR, \
.rcc_reset = RCC_APB1RSTR_USART3RST,
#define BOARD_USART_TX_IO_PORT GPIOD
#define BOARD_USART_TX_IO_PIN 8
#define BOARD_USART_RX_IO_PORT GPIOD
#define BOARD_USART_RX_IO_PIN 9

#endif

#endif /* NUCLEO_F429_BOARD_H_ */
10 changes: 10 additions & 0 deletions board/nucleof429/build.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2016 The F9 Microkernel Project. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

CHIP := stm32f429
PLATFORM := stm32
STM32_VARIANT := f4

board-y = board.o
loader-board-y = board.loader.o
9 changes: 9 additions & 0 deletions board/nucleof429/defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONFIG_BOARD_STM32F429NUCLEO=y
CONFIG_DBGPORT_USE_USART3=y
CONFIG_EXTI0_USER_IRQ=y
CONFIG_EXTI1_USER_IRQ=y
CONFIG_ETH_USER_IRQ=y
CONFIG_BUILD_USER_APPS=y
CONFIG_PINGPONG=y
CONFIG_EXTI_INTERRUPT_TEST=y
CONFIG_L4_TEST=y
8 changes: 8 additions & 0 deletions kernel/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ static mempool_t memmap[] = {
DECLARE_MEMPOOL("LCD_FRAME_BUFFER_2", 0xD00A0000, 0xD0140000,
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
#endif
#ifdef CONFIG_BOARD_STM32F429NUCLEO
DECLARE_MEMPOOL("APB2_3DEV", 0x40015000, 0x40015c00,
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
DECLARE_MEMPOOL("APB2_4DEV", 0x40016800, 0x40017900,
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
DECLARE_MEMPOOL("CR_PLLSAION_BB", 0x42470000, 0x42470c00,
MP_UR | MP_UW | MP_DEVICES, MPT_DEVICES),
#endif
};

DECLARE_KTABLE(as_t, as_table, CONFIG_MAX_ADRESS_SPACES);
Expand Down
2 changes: 2 additions & 0 deletions platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ config DBGPORT_USE_USART1
bool "USART1"
config DBGPORT_USE_USART2
bool "USART2"
config DBGPORT_USE_USART3
bool "USART3"
config DBGPORT_USE_USART4
bool "USART4"

Expand Down
4 changes: 2 additions & 2 deletions platform/stm32f429/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ config TIM1_CC_USER_IRQ
bool "TIM1_CC User IRQ"
default n

config TIM2_USER_IRQ
config TIM2_USER_IRQ
bool "TIM2 User IRQ"
default n

Expand Down Expand Up @@ -180,7 +180,7 @@ config TIM8_UP_TIM13_USER_IRQ
bool "TIM8_UP_TIM13 User IRQ"
default n

config TIM8_TRG_COM_TIM14_USER_IRQ
config TIM8_TRG_COM_TIM14_USER_IRQ
bool "TIM8_TRG_COM_TIM14 User IRQ"
default n

Expand Down
2 changes: 1 addition & 1 deletion platform/stm32f429/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chip-y = \
ltdc.o \
dma2d.o \
i2c.o \
ioe.o
ioe.o

loader-chip-y = \
gpio.loader.o \
Expand Down