summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriabdalkader <i.abdalkader@gmail.com>2024-01-19 11:12:13 +0200
committerDamien George <damien@micropython.org>2024-01-22 12:40:16 +1100
commite111793d8d6a0b921f47c7396b70a0aca1edaea5 (patch)
tree60edcc60b751a83a926ab6eae41811bd5dae6053
parentbeb44597841805a85d31326b375669b6a1251c02 (diff)
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 <i.abdalkader@gmail.com>
-rw-r--r--ports/nrf/drivers/secureboot/secureboot_main.c7
-rw-r--r--ports/nrf/main.c8
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 748e080a2..8362852cd 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 0e5a26c48..9809ba0e2 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);
-}