Skip to content

Commit

Permalink
cmain IAR: add mbed main
Browse files Browse the repository at this point in the history
This fixes ARMmbed#4602 issue, mbed_main should be invoked right before the real main
  • Loading branch information
0xc0170 committed Jun 21, 2017
1 parent d121a43 commit 857ec23
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmsis/TOOLCHAIN_IAR/cmain.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
EXTERN exit
EXTERN __iar_dynamic_initialization
EXTERN mbed_sdk_init
EXTERN mbed_main
EXTERN SystemInit

THUMB
Expand Down Expand Up @@ -87,6 +88,10 @@ _call_main:
FUNCALL __cmain, __iar_argc_argv
BL __iar_argc_argv ; Maybe setup command line

MOVS r0,#0 ; No parameters
FUNCALL __cmain, mbed_main
BL mbed_main

FUNCALL __cmain, main
BL main
_main:
Expand Down

0 comments on commit 857ec23

Please sign in to comment.