Skip to content

OS2 test MBED_A21 (Call function before main) failed only with IAR #4602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeromecoutant opened this issue Jun 21, 2017 · 4 comments · Fixed by #4604
Closed

OS2 test MBED_A21 (Call function before main) failed only with IAR #4602

jeromecoutant opened this issue Jun 21, 2017 · 4 comments · Fixed by #4604

Comments

@jeromecoutant
Copy link
Collaborator

Bug

On master branch, test MBED_A21 is FAIL for all STM32 targets only with IAR:

MBED_A21 Call function before main (mbed_main) NUCLEO_F091RC IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_F103RB IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_F207ZG IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_F303ZE IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_F446RE IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_F767ZI IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_L073RZ IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_L152RE IAR FAIL
MBED_A21 Call function before main (mbed_main) NUCLEO_L476RG IAR FAIL

Target
STM32

Toolchain:
IAR

@jeromecoutant
Copy link
Collaborator Author

jeromecoutant commented Jun 21, 2017

Proposition:

diff --git a/platform/mbed_sdk_boot.c b/platform/mbed_sdk_boot.c

@@ -109,6 +109,10 @@ 
int __low_level_init(void)
   return 1;
 }

+void __iar_argc_argv() {
+    mbed_main();
+}
+
 #endif

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 21, 2017

Thanks for reporting ! Either we can do what you proposed, but I believe better place for IAR would be in their cmain file, where we already call other init functions.

https://github.com/ARMmbed/mbed-os/blob/master/cmsis/TOOLCHAIN_IAR/cmain.S#L88 (right after argc) we can invoke mbed_main.

          FUNCALL __cmain, mbed_main()
        BL      mbed_main()

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 21, 2017

I'll send a patch rightaway now, will request a review

0xc0170 added a commit to 0xc0170/mbed-os that referenced this issue Jun 21, 2017
This fixes ARMmbed#4602 issue, mbed_main should be invoked right before the real main
@0xc0170 0xc0170 self-assigned this Jun 21, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 21, 2017

Done, pull request sent, please review.

adbridge pushed a commit that referenced this issue Jul 3, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 12, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 13, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 19, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 20, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 25, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Oct 30, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
bulislaw pushed a commit that referenced this issue Nov 1, 2017
This fixes #4602 issue, mbed_main should be invoked right before the real main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants