Skip to content

Commit f7b01a8

Browse files
committed
hw/bsp: Add support for blackpill411ce
This adds bsp for popular baord from WeActStudio. Board can be equipped with 64Mb flash, If external flash is not present, set SPIFLASH8M to 0. bsp show usage of flash map with two variants depending whether external spi flash is present or not. Signed-off-by: Jerzy Kasenberg <[email protected]>
1 parent 5979560 commit f7b01a8

File tree

7 files changed

+890
-0
lines changed

7 files changed

+890
-0
lines changed

hw/bsp/blackpill411ce/bsp.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
bsp.name: "blackpill411ce"
21+
bsp.url: https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1
22+
bsp.maker: WeAct
23+
bsp.arch: cortex_m4
24+
bsp.compiler: "@apache-mynewt-core/compiler/arm-none-eabi-m4"
25+
bsp.linkerscript: autogenerated
26+
bsp.downloadscript: "hw/scripts/download.sh"
27+
bsp.debugscript: "hw/bsp/blackpill411ce/debug.sh"
28+
29+
bsp.flash_map:
30+
areas:
31+
# System areas.
32+
FLASH_AREA_BOOTLOADER:
33+
device: 0
34+
offset: 0x08000000
35+
size: 32kB
36+
FLASH_AREA_IMAGE_0:
37+
device: 0
38+
offset: 0x08020000
39+
size: 374kB
40+
FLASH_AREA_IMAGE_SCRATCH:
41+
device: 1
42+
offset: 0x08040000
43+
size: 0kB
44+
FLASH_AREA_REBOOT_LOG:
45+
user_id: 2
46+
device: 0
47+
offset: 0x08010000
48+
size: 64kB
49+
50+
FLASH_AREA_LITTLEFS:
51+
user_id: 3
52+
device: 0
53+
offset: 0x08008000
54+
size: 32kB
55+
56+
bsp.flash_map.SPIFLASH8M:
57+
areas:
58+
# Embedded flash 512kB
59+
# Boot loader 32kB.
60+
FLASH_AREA_BOOTLOADER:
61+
device: 0
62+
offset: 0x08000000
63+
size: 32kB
64+
# 32kB not allocated
65+
# 64kB reboot log
66+
FLASH_AREA_REBOOT_LOG:
67+
user_id: 2
68+
device: 0
69+
offset: 0x08010000
70+
size: 64kB
71+
# Slot 0 374kB (3*128kB)
72+
FLASH_AREA_IMAGE_0:
73+
device: 0
74+
offset: 0x08020000
75+
size: 374kB
76+
# SPIFlash 8Mb
77+
# Image scratch 128Kb
78+
FLASH_AREA_IMAGE_SCRATCH:
79+
device: 1
80+
offset: 0x00000000
81+
size: 128kB
82+
FLASH_AREA_IMAGE_1:
83+
device: 1
84+
offset: 0x00020000
85+
size: 374kB
86+
87+
FLASH_AREA_NFFS:
88+
user_id: 1
89+
device: 1
90+
offset: 0x00080000
91+
size: 128kB
92+
FLASH_AREA_LITTLEFS:
93+
user_id: 3
94+
device: 1
95+
offset: 0x000A0000
96+
size: 128kB

hw/bsp/blackpill411ce/debug.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
# Called with following variables set:
21+
# - CORE_PATH is absolute path to @apache-mynewt-core
22+
# - BSP_PATH is absolute path to hw/bsp/bsp_name
23+
# - BIN_BASENAME is the path to prefix to target binary,
24+
# .elf appended to name is the ELF file
25+
# - FEATURES holds the target features string
26+
# - EXTRA_JTAG_CMD holds extra parameters to pass to jtag software
27+
# - RESET set if target should be reset when attaching
28+
# - NO_GDB set if we should not start gdb to debug
29+
30+
. $CORE_PATH/hw/scripts/stlink.sh
31+
32+
FILE_NAME=$BIN_BASENAME.elf
33+
34+
stlink_debug
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
#ifndef H_BSP_H
20+
#define H_BSP_H
21+
22+
#include <inttypes.h>
23+
#include <mcu/mcu.h>
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
/* Define special stackos sections */
30+
#define sec_data_core __attribute__((section(".data.core")))
31+
#define sec_bss_core __attribute__((section(".bss.core")))
32+
#define sec_bss_nz_core __attribute__((section(".bss.core.nz")))
33+
34+
/* More convenient section placement macros. */
35+
#define bssnz_t sec_bss_nz_core
36+
37+
extern uint8_t _ram_start;
38+
39+
#define RAM_SIZE (128 * 1024)
40+
41+
/* LED pins */
42+
#define LED_BLINK_PIN MCU_GPIO_PORTC(13)
43+
44+
/* Button pin */
45+
#define BUTTON_1 MCU_GPIO_PORTA(0)
46+
47+
#ifdef __cplusplus
48+
}
49+
#endif
50+
51+
#endif /* H_BSP_H */

0 commit comments

Comments
 (0)