Skip to content

Commit 6082da0

Browse files
committed
boards: Add CUSTOM_PYBV11 board, based on stm32 PYBV11.
Signed-off-by: Damien George <[email protected]>
1 parent 19ef417 commit 6082da0

File tree

9 files changed

+154
-0
lines changed

9 files changed

+154
-0
lines changed

boards/CUSTOM_PYBV11/Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Makefile for custom MicroPython stm32 board.
2+
3+
################################################################################
4+
# Define your settings here.
5+
6+
# The board name.
7+
BOARD ?= CUSTOM_PYBV11
8+
9+
# Location of MicroPython repository.
10+
MICROPY_TOP ?= $(abspath ../../lib/micropython)
11+
12+
################################################################################
13+
# Define your targets here.
14+
15+
all: firmware
16+
17+
################################################################################
18+
# Items below this line do not generally need to be changed.
19+
20+
BOARD_DIR = $(abspath .)
21+
BUILD = $(abspath build)
22+
23+
include $(MICROPY_TOP)/py/mkenv.mk
24+
include $(MICROPY_TOP)/py/mkrules.mk
25+
26+
firmware:
27+
$(Q)$(MAKE) -C $(MICROPY_TOP)/ports/stm32 \
28+
PROJECT_TOP=$(abspath ../..) \
29+
BOARD=$(BOARD) \
30+
BOARD_DIR=$(BOARD_DIR) \
31+
BUILD=$(BUILD)
32+
33+
deploy:
34+
$(PYTHON) $(MICROPY_TOP)/tools/pydfu.py -u $(BUILD)/firmware.dfu

boards/CUSTOM_PYBV11/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This directory contains board definition files for an stm32-based board, which
2+
is based on the PYBV11 board definition.
3+
4+
To build it:
5+
6+
$ make
7+
8+
To deploy the firmware to the board:
9+
10+
$ make deploy

boards/CUSTOM_PYBV11/board_init.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "py/mphal.h"
2+
#include "boardctrl.h"
3+
4+
int board_run_boot_py(boardctrl_state_t *state) {
5+
mp_printf(&mp_plat_print, "Starting custom board\n");
6+
return boardctrl_run_boot_py(state);
7+
}

boards/CUSTOM_PYBV11/manifest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
freeze("$(BOARD_DIR)/../../src/utils", "xxd.py")

boards/CUSTOM_PYBV11/mpconfigboard.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Take PYBV11 as base configuration.
2+
#include "ports/stm32/boards/PYBV11/mpconfigboard.h"
3+
4+
#undef MICROPY_HW_BOARD_NAME
5+
#undef MICROPY_HW_CLK_PLLM
6+
#undef MICROPY_HW_CLK_PLLN
7+
#undef MICROPY_HW_CLK_PLLP
8+
#undef MICROPY_HW_CLK_PLLQ
9+
#undef MICROPY_HW_FLASH_LATENCY
10+
11+
#define MICROPY_HW_BOARD_NAME "Custom PYBv1.1"
12+
#define MICROPY_BOARD_RUN_BOOT_PY board_run_boot_py
13+
14+
// HSE is 12MHz, run SYS at 48MHz
15+
#define MICROPY_HW_CLK_PLLM (12)
16+
#define MICROPY_HW_CLK_PLLN (192)
17+
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV4)
18+
#define MICROPY_HW_CLK_PLLQ (4)
19+
#define MICROPY_HW_FLASH_LATENCY (FLASH_LATENCY_1)
20+
21+
struct _boardctrl_state_t;
22+
int board_run_boot_py(struct _boardctrl_state_t *state);

boards/CUSTOM_PYBV11/mpconfigboard.mk

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# MCU settings
2+
MCU_SERIES = f4
3+
CMSIS_MCU = STM32F405xx
4+
AF_FILE = boards/stm32f405_af.csv
5+
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
6+
TEXT0_ADDR = 0x08000000
7+
TEXT1_ADDR = 0x08020000
8+
9+
# MicroPython settings
10+
MICROPY_FLOAT_IMPL = double
11+
MICROPY_VFS_LFS1 = 1
12+
MICROPY_VFS_LFS2 = 1
13+
14+
# Custom C modules
15+
USER_C_MODULES = $(PROJECT_TOP)/src/cmodules
16+
17+
# PYBD-specific frozen modules
18+
FROZEN_MANIFEST = $(BOARD_DIR)/manifest.py

boards/CUSTOM_PYBV11/pins.csv

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
X1,PA0
2+
X2,PA1
3+
X3,PA2
4+
X4,PA3
5+
X5,PA4
6+
X6,PA5
7+
X7,PA6
8+
X8,PA7
9+
X9,PB6
10+
X10,PB7
11+
X11,PC4
12+
X12,PC5
13+
X13,Reset
14+
X14,GND
15+
X15,3.3V
16+
X16,VIN
17+
X17,PB3
18+
X18,PC13
19+
X19,PC0
20+
X20,PC1
21+
X21,PC2
22+
X22,PC3
23+
X23,A3.3V
24+
X24,AGND
25+
Y1,PC6
26+
Y2,PC7
27+
Y3,PB8
28+
Y4,PB9
29+
Y5,PB12
30+
Y6,PB13
31+
Y7,PB14
32+
Y8,PB15
33+
Y9,PB10
34+
Y10,PB11
35+
Y11,PB0
36+
Y12,PB1
37+
Y13,Reset
38+
Y14,GND
39+
Y15,3.3V
40+
Y16,VIN
41+
SW,PB3
42+
LED_RED,PA13
43+
LED_GREEN,PA14
44+
LED_YELLOW,PA15
45+
LED_BLUE,PB4
46+
MMA_INT,PB2
47+
MMA_AVDD,PB5
48+
SD_D0,PC8
49+
SD_D1,PC9
50+
SD_D2,PC10
51+
SD_D3,PC11
52+
SD_CMD,PD2
53+
SD_CK,PC12
54+
SD,PA8
55+
SD_SW,PA8
56+
USB_VBUS,PA9
57+
USB_ID,PA10
58+
USB_DM,PA11
59+
USB_DP,PA12
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Use PYBV11 configuration.
2+
#include "boards/PYBV11/stm32f4xx_hal_conf.h"

boards/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This directory contains all boards that can be built as part of this project.

0 commit comments

Comments
 (0)