Skip to content

Commit 119e9d3

Browse files
committed
Add Thunderpack 1.2
1 parent 1ce682d commit 119e9d3

File tree

6 files changed

+631
-0
lines changed

6 files changed

+631
-0
lines changed
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: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 (0x08010000)
32+
#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_4
33+
34+
// Putting the entire flash sector in the NVM byte array buffer
35+
// would take up too much RAM. This limits how much of the sector we use.
36+
#define NVM_BYTEARRAY_BUFFER_SIZE 512
37+
38+
// Flash config
39+
#define FLASH_SIZE (0x80000)
40+
#define FLASH_PAGE_SIZE (0x4000)
41+
#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000)
42+
43+
// On-board flash
44+
#define SPI_FLASH_MOSI_PIN (&pin_PB15)
45+
#define SPI_FLASH_MISO_PIN (&pin_PB14)
46+
#define SPI_FLASH_SCK_PIN (&pin_PB13)
47+
#define SPI_FLASH_CS_PIN (&pin_PB12)
48+
49+
// Status LEDs
50+
#define MICROPY_HW_LED_STATUS (&pin_PA02)
51+
#define MICROPY_HW_APA102_MOSI (&pin_PB08)
52+
#define MICROPY_HW_APA102_SCK (&pin_PB00)
53+
54+
// I2C
55+
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
56+
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
57+
58+
// General config
59+
#define BOARD_OSC_DIV (24)
60+
#define BOARD_OVERWRITE_SWD (1)
61+
#define BOARD_NO_VBUS_SENSE (1)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
USB_VID = 0x239A
2+
USB_PID = 0x806A
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+
15+
MCU_SERIES = F4
16+
MCU_VARIANT = STM32F411xE
17+
MCU_PACKAGE = UFQFPN48
18+
19+
LD_COMMON = boards/common_nvm.ld
20+
LD_FILE = boards/STM32F411_nvm.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)