Skip to content

Commit a2281a7

Browse files
authored
Merge pull request #14822 from jeromecoutant/PR_H7_M4
STM32H7: correction for FLASH API for CM4
2 parents 43f1ee7 + a4b2695 commit a2281a7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/CMSIS/stm32h747xx.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13916,9 +13916,13 @@ typedef struct
1391613916
*/
1391713917
#define FLASH_SIZE_DATA_REGISTER 0x1FF1E880U
1391813918
#define FLASH_SECTOR_TOTAL 8U /* 8 sectors */
13919+
#ifdef CORE_CM4
13920+
#define FLASH_SIZE 0x200000UL /* 2 MB */
13921+
#else
1391913922
#define FLASH_SIZE ((((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0xFFFFU)) ? 0x200000U : \
1392013923
((((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x0000U)) ? 0x200000U : \
1392113924
(((uint32_t)(*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) & (0x0FFFU)) << 10U))) /* 2 MB */
13925+
#endif
1392213926
#define FLASH_BANK_SIZE (FLASH_SIZE >> 1) /* 1 MB */
1392313927
#define FLASH_SECTOR_SIZE 0x00020000UL /* 128 KB */
1392413928
#define FLASH_LATENCY_DEFAULT FLASH_ACR_LATENCY_7WS /* FLASH Seven Latency cycles */

targets/TARGET_STM/TARGET_STM32H7/flash_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ int32_t flash_program_page(flash_t *obj, uint32_t address, const uint8_t *data,
148148
#if defined(CORE_CM7)
149149
SCB_CleanInvalidateDCache_by_Addr((uint32_t *)StartAddress, FullSize);
150150
SCB_InvalidateICache();
151+
#else /* CORE_CM4 */
152+
__HAL_ART_ENABLE();
151153
#endif /* CORE_CM7 */
152154
#else /* DUAL_CORE */
153155
SCB_CleanInvalidateDCache_by_Addr((uint32_t *)StartAddress, FullSize);

0 commit comments

Comments
 (0)