Skip to content

Commit 090db8d

Browse files
committed
sysparam: always create the semaphore on init.
Otherwise when initialization was not successful it may fail with an assertion in FreeRTOS rather than returning SYSPARAM_ERR_NOINIT.
1 parent 93d43d7 commit 090db8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/sysparam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ sysparam_status_t sysparam_init(uint32_t base_addr, uint32_t top_addr) {
505505
struct sysparam_context ctx;
506506
uint16_t num_sectors;
507507

508+
_sysparam_info.sem = xSemaphoreCreateMutex();
509+
508510
// Make sure we're starting at the beginning of the sector
509511
base_addr -= (base_addr % sdk_flashchip.sector_size);
510512

@@ -584,8 +586,6 @@ sysparam_status_t sysparam_init(uint32_t base_addr, uint32_t top_addr) {
584586
_sysparam_info.end_addr = ctx.addr;
585587
}
586588

587-
_sysparam_info.sem = xSemaphoreCreateMutex();
588-
589589
return SYSPARAM_OK;
590590
}
591591

0 commit comments

Comments
 (0)