From e111793d8d6a0b921f47c7396b70a0aca1edaea5 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Fri, 19 Jan 2024 11:12:13 +0200 Subject: [PATCH] nrf: Fix _start() build issue with CMSIS 5.9.0. The `_start` function prototype is now declared as no-return, so `main()` can't return. To fix this, `main()` is replaced with `_start`. Signed-off-by: iabdalkader --- ports/nrf/drivers/secureboot/secureboot_main.c | 7 +------ ports/nrf/main.c | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/ports/nrf/drivers/secureboot/secureboot_main.c b/ports/nrf/drivers/secureboot/secureboot_main.c index 748e080a24..8362852cd7 100644 --- a/ports/nrf/drivers/secureboot/secureboot_main.c +++ b/ports/nrf/drivers/secureboot/secureboot_main.c @@ -176,7 +176,7 @@ static void jump_to_non_secure(void) } } -int main(void) { +void _start(void) { configure_flash(); configure_ram(); configure_peripherals(); @@ -186,9 +186,4 @@ int main(void) { while (1) { ; } - - return 0; } - -void _start(void) {main();} - diff --git a/ports/nrf/main.c b/ports/nrf/main.c index 0e5a26c487..9809ba0e23 100644 --- a/ports/nrf/main.c +++ b/ports/nrf/main.c @@ -107,7 +107,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) { extern uint32_t _heap_start; extern uint32_t _heap_end; -int main(int argc, char **argv) { +void NORETURN _start(void) { // Hook for a board to run code at start up, for example check if a // bootloader should be entered instead of the main application. MICROPY_BOARD_STARTUP(); @@ -299,8 +299,6 @@ soft_reset: #endif goto soft_reset; - - return 0; } #if !MICROPY_VFS @@ -369,7 +367,3 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line); __fatal_error("Assertion failed"); } - -void _start(void) { - main(0, NULL); -}