Skip to content

Commit 66ddcc4

Browse files
committed
init code and cleanup
1 parent d6b7467 commit 66ddcc4

File tree

7 files changed

+23
-42
lines changed

7 files changed

+23
-42
lines changed

ports/stm/boards/STM32H750_nofs.ld renamed to ports/stm/boards/STM32H750.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
GNU linker script for STM32H750 no filesystem
2+
GNU linker script for STM32H750
33
*/
44

55
/* Entry Point */
@@ -12,7 +12,7 @@ MEMORY
1212
{
1313
FLASH (rx) : ORIGIN = 0x90000000, LENGTH = 8M /* 8M */
1414
FLASH_ISR (rx) : ORIGIN = 0x90000000, LENGTH = 4K /* sector 0 */
15-
FLASH_FIRMWARE (rx) : ORIGIN = 0x90001000, LENGTH = 8M-4K
15+
FLASH_FIRMWARE (rx) : ORIGIN = 0x90001000, LENGTH = 8M-4K
1616
DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
1717
RAM (xrw) : ORIGIN = 0x24000000, LENGTH = 512K /* AXI SRAM */
1818
SRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K /* AHB1 SRAM */

ports/stm/boards/STM32H750_fs.ld

Lines changed: 0 additions & 35 deletions
This file was deleted.

ports/stm/boards/common_tcm.ld

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ SECTIONS
134134
} > DTCM
135135
_ld_stack_top = ORIGIN(DTCM) + LENGTH(DTCM);
136136

137+
.ARM.extab :
138+
{
139+
*(.ARM.extab* .gnu.linkonce.armextab.*)
140+
} >FLASH_FIRMWARE
141+
.ARM :
142+
{
143+
__exidx_start = .;
144+
*(.ARM.exidx*)
145+
__exidx_end = .;
146+
} >FLASH_FIRMWARE
137147

138148
.ARM.attributes 0 : { *(.ARM.attributes) }
139149
}

ports/stm/boards/daisy_seed_with_sdram/mpconfigboard.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ MCU_VARIANT = STM32H750xx
1212
MCU_PACKAGE = UFBGA176
1313

1414
LD_COMMON = boards/common_tcm.ld
15-
LD_FILE = boards/STM32H750_nofs.ld
15+
LD_FILE = boards/STM32H750.ld
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "shared-bindings/board/__init__.h"
22

3-
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4-
{MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC07)},
3+
static const mp_rom_map_elem_t board_module_globals_table[] = {
4+
{MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PC07)},
55
};
66
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

ports/stm/packages/UFBGA176.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "common-hal/microcontroller/Pin.h"
3030
#include "py/obj.h"
3131

32-
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
32+
static const mp_rom_map_elem_t mcu_pin_globals_table[] = {
3333
// Row A
3434
{ MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) },
3535
{ MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) },

ports/stm/supervisor/port.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,14 @@ __attribute__((used, naked)) void Reset_Handler(void) {
134134
for (uint32_t i = 0; i < ((size_t)&_ld_d1_ram_bss_size) / 4; i++) {
135135
(&_ld_d1_ram_bss_start)[i] = 0;
136136
}
137-
137+
#ifdef STM32H750xx
138+
__DMB(); /* ARM says to use a DMB instruction before relocating VTOR */
139+
SCB->VTOR = 0x90000000u; /* We relocate vector table to the QSPI sector 1 */
140+
__DSB(); /* ARM says to use a DSB instruction just after relocating VTOR */
141+
/* SystemInit call is not necessary, initializations are done in the H750 special bootloader */
142+
#else
138143
SystemInit();
144+
#endif
139145
__enable_irq();
140146
main();
141147
}

0 commit comments

Comments
 (0)