mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/stm32/flashpage: adapt to non dual-core stm32wl
This commit is contained in:
parent
8a8e023d04
commit
c62f6e0590
@ -13,13 +13,20 @@ ROM_LEN_K := $(shell echo $(ROM_LEN) | sed 's/K//')
|
||||
RAM_LEN_K := $(shell echo $(RAM_LEN) | sed 's/K//')
|
||||
|
||||
ifneq (,$(filter w%,$(CPU_FAM)))
|
||||
# adjust RAM_LEN and ROM_LEN according to CPU2 RAM_LEN and ROM_LEN
|
||||
CPU2_RAM_LEN_K := $(shell echo $(CPU2_RAM_LEN) | sed 's/K//')
|
||||
RAM_LEN := $(shell echo $$(( ($(RAM_LEN_K) - $(CPU2_RAM_LEN_K) ) * $(KB) )))
|
||||
|
||||
CPU2_ROM_LEN_K := $(shell echo $(CPU2_ROM_LEN) | sed 's/K//')
|
||||
FLASHSIZE := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) )* $(KB) )) )
|
||||
ROM_LEN := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) ) ))K)
|
||||
ifneq (,$(CPU2_RAM_LEN))
|
||||
# adjust RAM_LEN and ROM_LEN according to CPU2 RAM_LEN and ROM_LEN
|
||||
CPU2_RAM_LEN_K := $(shell echo $(CPU2_RAM_LEN) | sed 's/K//')
|
||||
RAM_LEN := $(shell echo $$(( ($(RAM_LEN_K) - $(CPU2_RAM_LEN_K) ) * $(KB) )))
|
||||
else
|
||||
RAM_LEN := $(shell echo $$(( $(RAM_LEN_K) * $(KB) )) )
|
||||
endif
|
||||
ifneq (,$(CPU2_ROM_LEN))
|
||||
CPU2_ROM_LEN_K := $(shell echo $(CPU2_ROM_LEN) | sed 's/K//')
|
||||
FLASHSIZE := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) )* $(KB) )) )
|
||||
ROM_LEN := $(shell echo $$(( ($(ROM_LEN_K) - $(CPU2_ROM_LEN_K) ) ))K)
|
||||
else
|
||||
FLASHSIZE := $(shell echo $$(( $(ROM_LEN_K) * $(KB) )) )
|
||||
endif
|
||||
else
|
||||
FLASHSIZE := $(shell echo $$(( $(ROM_LEN_K) * $(KB) )) )
|
||||
RAM_LEN := $(shell echo $$(( $(RAM_LEN_K) * $(KB) )) )
|
||||
|
@ -190,7 +190,8 @@ void flashpage_erase(unsigned page)
|
||||
assert(page < (int)FLASHPAGE_NUMOF);
|
||||
|
||||
/* ensure there is no attempt to write to CPU2 protected area */
|
||||
#if defined(CPU_FAM_STM32WB) || defined(CPU_FAM_STM32WL)
|
||||
#if defined(CPU_FAM_STM32WB) || (defined(CPU_FAM_STM32WL) && \
|
||||
!defined(CPU_LINE_STM32WLE5xx))
|
||||
assert(page < (int)(FLASH->SFR & FLASH_SFR_SFSA));
|
||||
#endif
|
||||
|
||||
|
@ -33,7 +33,8 @@ void flashpage_read(unsigned page, void *data)
|
||||
{
|
||||
assert(page < FLASHPAGE_NUMOF);
|
||||
|
||||
#if defined(CPU_FAM_STM32WB) || defined(CPU_FAM_STM32WL)
|
||||
#if defined(CPU_FAM_STM32WB) || (defined(CPU_FAM_STM32WL) && \
|
||||
!defined(CPU_LINE_STM32WLE5xx))
|
||||
assert(page < (FLASH->SFR & FLASH_SFR_SFSA));
|
||||
#endif
|
||||
|
||||
@ -44,7 +45,8 @@ int flashpage_verify(unsigned page, const void *data)
|
||||
{
|
||||
assert(page < (int)FLASHPAGE_NUMOF);
|
||||
|
||||
#if defined(CPU_FAM_STM32WB) || defined(CPU_FAM_STM32WL)
|
||||
#if defined(CPU_FAM_STM32WB) || (defined(CPU_FAM_STM32WL) && \
|
||||
!defined(CPU_LINE_STM32WLE5xx))
|
||||
assert(page < (int)(FLASH->SFR & FLASH_SFR_SFSA));
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user