Skip to content

Commit e111793

Browse files
iabdalkaderdpgeorge
authored andcommitted
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 <[email protected]>
1 parent beb4459 commit e111793

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

ports/nrf/drivers/secureboot/secureboot_main.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void jump_to_non_secure(void)
176176
}
177177
}
178178

179-
int main(void) {
179+
void _start(void) {
180180
configure_flash();
181181
configure_ram();
182182
configure_peripherals();
@@ -186,9 +186,4 @@ int main(void) {
186186
while (1) {
187187
;
188188
}
189-
190-
return 0;
191189
}
192-
193-
void _start(void) {main();}
194-

ports/nrf/main.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
107107
extern uint32_t _heap_start;
108108
extern uint32_t _heap_end;
109109

110-
int main(int argc, char **argv) {
110+
void NORETURN _start(void) {
111111
// Hook for a board to run code at start up, for example check if a
112112
// bootloader should be entered instead of the main application.
113113
MICROPY_BOARD_STARTUP();
@@ -299,8 +299,6 @@ int main(int argc, char **argv) {
299299
#endif
300300

301301
goto soft_reset;
302-
303-
return 0;
304302
}
305303

306304
#if !MICROPY_VFS
@@ -369,7 +367,3 @@ void MP_WEAK __assert_func(const char *file, int line, const char *func, const c
369367
printf("Assertion '%s' failed, at file %s:%d\n", expr, file, line);
370368
__fatal_error("Assertion failed");
371369
}
372-
373-
void _start(void) {
374-
main(0, NULL);
375-
}

0 commit comments

Comments
 (0)