From 19cf71646155108939c196475a8fab44b8852e3f Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 23 Sep 2019 12:14:27 -0400 Subject: [PATCH] Fix missing items --- ports/stm32f4/Makefile | 2 +- ports/stm32f4/boards/startup_stm32f405xx.s | 2 +- ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk | 2 +- ports/stm32f4/peripherals/stm32f4/periph.h | 6 +++--- ports/stm32f4/peripherals/stm32f4/pins.h | 6 +++--- ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c | 1 - ports/stm32f4/supervisor/internal_flash.h | 5 +++++ 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ports/stm32f4/Makefile b/ports/stm32f4/Makefile index 90f0f800f4..ae31c2b1d9 100755 --- a/ports/stm32f4/Makefile +++ b/ports/stm32f4/Makefile @@ -88,7 +88,7 @@ else ### CFLAGS += -flto endif -C_DEFS += -DMCU_PACKAGE=$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(MCU_SUB_VARIANT) +C_DEFS += -DMCU_PACKAGE=$(MCU_PACKAGE) -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -D$(CMSIS_MCU) CFLAGS += $(INC) -Werror -Wall -std=gnu11 -nostdlib $(BASE_CFLAGS) $(C_DEFS) $(CFLAGS_MOD) $(COPT) diff --git a/ports/stm32f4/boards/startup_stm32f405xx.s b/ports/stm32f4/boards/startup_stm32f405xx.s index ea0e76a972..6b77655ca1 100644 --- a/ports/stm32f4/boards/startup_stm32f405xx.s +++ b/ports/stm32f4/boards/startup_stm32f405xx.s @@ -108,7 +108,7 @@ LoopFillZerobss: /* Call the clock system intitialization function.*/ bl SystemInit /* Call static constructors */ - bl __libc_init_array +/* bl __libc_init_array */ /* Call the application's entry point.*/ bl main bx lr diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk index 804a20f2b7..21af63735f 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.mk @@ -10,7 +10,7 @@ MCU_SERIES = m4 MCU_VARIANT = stm32f4 MCU_SUB_VARIANT = stm32f412zx MCU_PACKAGE = 144 -CMSIS_MCU = STM32F412xG +CMSIS_MCU = STM32F412Zx LD_FILE = boards/STM32F412ZGTx_FLASH.ld TEXT0_ADDR = 0x08000000 TEXT1_ADDR = 0x08020000 diff --git a/ports/stm32f4/peripherals/stm32f4/periph.h b/ports/stm32f4/peripherals/stm32f4/periph.h index e2078bff64..c60abdc0ee 100644 --- a/ports/stm32f4/peripherals/stm32f4/periph.h +++ b/ports/stm32f4/peripherals/stm32f4/periph.h @@ -65,13 +65,13 @@ typedef struct { // TODO: SPI, UART, etc // Choose based on chip -#ifdef stm32f412zx +#ifdef STM32F412Zx #include "stm32f412zx/periph.h" #endif -#ifdef stm32f411xe +#ifdef STM32F411xE #include "stm32f411xe/periph.h" #endif -#ifdef stm32f405xx +#ifdef STM32F405xx #include "stm32f405xx/periph.h" #endif #endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PERIPH_H__ diff --git a/ports/stm32f4/peripherals/stm32f4/pins.h b/ports/stm32f4/peripherals/stm32f4/pins.h index 6d2015d8c6..6d5d0618df 100644 --- a/ports/stm32f4/peripherals/stm32f4/pins.h +++ b/ports/stm32f4/peripherals/stm32f4/pins.h @@ -77,13 +77,13 @@ extern const mp_obj_type_t mcu_pin_type; #define NO_PIN 0xff // Choose based on chip -#ifdef stm32f412zx +#ifdef STM32F412Zx #include "stm32f412zx/pins.h" #endif -#ifdef stm32f411xe +#ifdef STM32F411xE #include "stm32f411xe/pins.h" #endif -#ifdef stm32f405xx +#ifdef STM32F405xx #include "stm32f405xx/pins.h" #endif #endif // __MICROPY_INCLUDED_STM32F4_PERIPHERALS_PINS_H__ diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c index f277f80c30..f0a2a35056 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c @@ -30,7 +30,6 @@ void stm32f4_peripherals_gpio_init(void) { //Enable all GPIO for now - GPIO_InitTypeDef GPIO_InitStruct = {0}; __HAL_RCC_GPIOE_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE(); diff --git a/ports/stm32f4/supervisor/internal_flash.h b/ports/stm32f4/supervisor/internal_flash.h index 90237d80e0..b6d26a07fe 100644 --- a/ports/stm32f4/supervisor/internal_flash.h +++ b/ports/stm32f4/supervisor/internal_flash.h @@ -42,6 +42,11 @@ #define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB #endif +#ifdef STM32F405xx +#define STM32_FLASH_SIZE 0x100000 //1MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0xC000 //48KiB +#endif + #define STM32_FLASH_OFFSET 0x8000000 //All STM32 chips map to this flash location #define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08004000