Skip to content

Commit 6a93391

Browse files
authored
Merge pull request #3737 from jgillick/thunderpack1.2
STM32: Add new STM board: Thunderpack v1.2
2 parents 22af5a1 + f8499a4 commit 6a93391

File tree

13 files changed

+232
-5
lines changed

13 files changed

+232
-5
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ jobs:
318318
- "teensy40"
319319
- "teensy41"
320320
- "teknikio_bluebird"
321-
- "thunderpack"
321+
- "thunderpack_v11"
322+
- "thunderpack_v12"
322323
- "tinkeringtech_scoutmakes_azul"
323324
- "trellis_m4_express"
324325
- "trinket_m0"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
GNU linker script for STM32F411 with nvm and an external flash chip.
3+
No space is reserved for a filesystem.
4+
*/
5+
6+
/* Specify the memory areas */
7+
MEMORY
8+
{
9+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */
10+
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */
11+
FLASH_NVM (rwx) : ORIGIN = 0x08004000, LENGTH = 16K /* sector 1 is 16K */
12+
FLASH_FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 480K /* sector 2,3 is 16k, sector 4 is 64K, sectors 5,6,7 are 128K */
13+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
14+
}
15+
16+
/* produce a link error if there is not this amount of RAM for these sections */
17+
_minimum_stack_size = 24K;
18+
_minimum_heap_size = 16K;
19+
20+
/* Define the top end of the stack. The stack is full descending so begins just
21+
above last byte of RAM. Note that EABI requires the stack to be 8-byte
22+
aligned for a call. */
23+
_estack = ORIGIN(RAM) + LENGTH(RAM);
24+
25+
/* RAM extents for the garbage collector */
26+
_ram_start = ORIGIN(RAM);
27+
_ram_end = ORIGIN(RAM) + LENGTH(RAM);

ports/stm/boards/thunderpack/mpconfigboard.h renamed to ports/stm/boards/thunderpack_v11/mpconfigboard.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
#define MICROPY_HW_BOARD_NAME "THUNDERPACK"
26+
#define MICROPY_HW_BOARD_NAME "THUNDERPACK_v11"
2727
#define MICROPY_HW_MCU_NAME "STM32F411CE"
2828

2929
// Non-volatile memory config
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "boards/board.h"
28+
29+
void board_init(void) {
30+
}
31+
32+
bool board_requests_safe_mode(void) {
33+
return false;
34+
}
35+
36+
void reset_board(void) {
37+
38+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
#define MICROPY_HW_BOARD_NAME "THUNDERPACK_v12"
27+
#define MICROPY_HW_MCU_NAME "STM32F411CE"
28+
29+
// Non-volatile memory config
30+
#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000)
31+
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x08004000)
32+
#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_1
33+
#define NVM_BYTEARRAY_BUFFER_SIZE 512
34+
35+
// Flash config
36+
#define FLASH_SIZE (0x80000)
37+
#define FLASH_PAGE_SIZE (0x4000)
38+
#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000)
39+
#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x8000
40+
41+
// On-board flash
42+
#define SPI_FLASH_MOSI_PIN (&pin_PB15)
43+
#define SPI_FLASH_MISO_PIN (&pin_PB14)
44+
#define SPI_FLASH_SCK_PIN (&pin_PB13)
45+
#define SPI_FLASH_CS_PIN (&pin_PB12)
46+
47+
#define HSE_VALUE ((uint32_t)24000000U)
48+
#define BOARD_OVERWRITE_SWD (1)
49+
#define BOARD_NO_VBUS_SENSE (1)
50+
#define BOARD_HAS_LOW_SPEED_CRYSTAL (0)
51+
52+
// Status LEDs
53+
#define MICROPY_HW_APA102_MOSI (&pin_PB08)
54+
#define MICROPY_HW_APA102_SCK (&pin_PB00)
55+
// I2C
56+
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
57+
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x8071
3+
USB_PRODUCT = "Thunderpack STM32F411"
4+
USB_MANUFACTURER = "Jeremy Gillick"
5+
USB_DEVICES = "CDC,MSC"
6+
7+
LONGINT_IMPL = NONE
8+
9+
SPI_FLASH_FILESYSTEM = 1
10+
EXTERNAL_FLASH_DEVICE_COUNT = 1
11+
EXTERNAL_FLASH_DEVICES = GD25Q16C
12+
13+
CIRCUITPY_NVM = 1
14+
CIRCUITPY_BLEIO_HCI = 0
15+
16+
MCU_SERIES = F4
17+
MCU_VARIANT = STM32F411xE
18+
MCU_PACKAGE = UFQFPN48
19+
20+
LD_COMMON = boards/common_nvm.ld
21+
LD_FILE = boards/STM32F411_nvm_nofs.ld
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
{ MP_ROM_QSTR(MP_QSTR_PA0), MP_ROM_PTR(&pin_PA00) },
5+
{ MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_PA01) },
6+
{ MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_PA02) },
7+
{ MP_ROM_QSTR(MP_QSTR_PA3), MP_ROM_PTR(&pin_PA03) },
8+
{ MP_ROM_QSTR(MP_QSTR_PA4), MP_ROM_PTR(&pin_PA04) },
9+
{ MP_ROM_QSTR(MP_QSTR_PA5), MP_ROM_PTR(&pin_PA05) },
10+
{ MP_ROM_QSTR(MP_QSTR_PA6), MP_ROM_PTR(&pin_PA06) },
11+
{ MP_ROM_QSTR(MP_QSTR_PA7), MP_ROM_PTR(&pin_PA07) },
12+
{ MP_ROM_QSTR(MP_QSTR_PA8), MP_ROM_PTR(&pin_PA08) },
13+
{ MP_ROM_QSTR(MP_QSTR_PA9), MP_ROM_PTR(&pin_PA09) },
14+
{ MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) },
15+
{ MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) },
16+
{ MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) },
17+
18+
{ MP_ROM_QSTR(MP_QSTR_PB0), MP_ROM_PTR(&pin_PB00) },
19+
{ MP_ROM_QSTR(MP_QSTR_PB5), MP_ROM_PTR(&pin_PB05) },
20+
{ MP_ROM_QSTR(MP_QSTR_PB6), MP_ROM_PTR(&pin_PB06) },
21+
{ MP_ROM_QSTR(MP_QSTR_PB7), MP_ROM_PTR(&pin_PB07) },
22+
{ MP_ROM_QSTR(MP_QSTR_PB8), MP_ROM_PTR(&pin_PB08) },
23+
24+
{ MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_PA00) },
25+
{ MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_PA01) },
26+
{ MP_ROM_QSTR(MP_QSTR_LED3), MP_ROM_PTR(&pin_PA02) },
27+
{ MP_ROM_QSTR(MP_QSTR_LED4), MP_ROM_PTR(&pin_PA03) },
28+
29+
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB04) },
30+
31+
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) },
32+
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) },
33+
34+
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PB08) },
35+
{ MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PB00) },
36+
37+
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
38+
};
39+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)