Skip to content

Commit e60db57

Browse files
committed
cmake: link default flash-protect hook
Include hal/hal.c in wolfboothal and mark hal_flash_protect RAMFUNCTION so CMake RAM_CODE targets link and call the default hook correctly.
1 parent b8131a1 commit e60db57

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ if(TZEN)
11521152
endif()
11531153
endif()
11541154

1155-
target_sources(wolfboothal PRIVATE include/hal.h hal/${WOLFBOOT_TARGET}.c ${WOLFBOOT_FLASH_SOURCES}
1155+
target_sources(wolfboothal PRIVATE include/hal.h hal/hal.c hal/${WOLFBOOT_TARGET}.c ${WOLFBOOT_FLASH_SOURCES}
11561156
${PARTITION_SOURCE} ${WOLFBOOT_TZ_HAL_SOURCES})
11571157

11581158

hal/hal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int hal_flash_test_dualbank(void)
281281

282282
#endif /* TEST_FLASH */
283283

284-
WEAKFUNCTION int hal_flash_protect(haladdr_t address, int len)
284+
WEAKFUNCTION int RAMFUNCTION hal_flash_protect(haladdr_t address, int len)
285285
{
286286
(void)address;
287287
(void)len;

hal/nrf5340.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ void hal_init(void)
827827

828828
#ifdef __WOLFBOOT
829829
/* enable write protection for the region of flash specified */
830-
int hal_flash_protect(uint32_t start, uint32_t len)
830+
int RAMFUNCTION hal_flash_protect(uint32_t start, uint32_t len)
831831
{
832832
/* only application core supports SPU */
833833
#ifdef TARGET_nrf5340_app

0 commit comments

Comments
 (0)