Skip to content

Commit fdad722

Browse files
committed
fix(stm32): HAL build issue
Since stm32 core release 2.8.0 including: stm32duino/Arduino_Core_STM32#2380 ArduinoOTA can't be built due to direct include of HAL flash ex module for STM32F0, STM32F1 and STM32F3. Including stm32_def.h solve the issue by properly including HAL headers. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 43f7506 commit fdad722

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Diff for: src/utility/stm32_flash_boot.c

+3-12
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,9 @@
1919
#ifdef ARDUINO_ARCH_STM32
2020

2121
#include "stm32_flash_boot.h"
22-
#if defined(STM32F0xx)
23-
#include <stm32f0xx_hal_flash_ex.h> // FLASH_PAGE_SIZE is in hal.h
24-
#elif defined(STM32F1xx)
25-
#include <stm32f1xx_hal_flash_ex.h> // FLASH_PAGE_SIZE is in hal.h
26-
#elif defined(STM32F2xx)
27-
#include <stm32f2xx.h>
28-
#elif defined(STM32F3xx)
29-
#include <stm32f3xx_hal_flash_ex.h> // FLASH_PAGE_SIZE is in hal.h
30-
#elif defined(STM32F4xx)
31-
#include "stm32f4xx.h"
32-
#elif defined(STM32F7xx)
33-
#include <stm32f7xx.h>
22+
#include "stm32_def.h" // To get FLASH_PAGE_SIZE
23+
24+
#if defined(STM32F7xx)
3425
#define SMALL_SECTOR_SIZE 0x8000 // sectors 0 to 3
3526
#define LARGE_SECTOR_SIZE 0x40000 // from sector 5
3627
#endif

0 commit comments

Comments
 (0)