-
Notifications
You must be signed in to change notification settings - Fork 3k
Add support for IAR version 8.x #4938
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
Conversation
fcd51c1
to
d98f9ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about testing? M0/M3/M4 with IAR all OK with these fixes (also backward compatible if possible. I assume yes as we are now using version < 8 macro in some changes here).
rtos/mbed_boot.c
Outdated
@@ -574,9 +576,14 @@ void pre_main(void) | |||
singleton_mutex_attr.cb_mem = &singleton_mutex_obj; | |||
singleton_mutex_id = osMutexNew(&singleton_mutex_attr); | |||
|
|||
#if (__IAR_SYSTEMS_ICC__ >= 8) | |||
__iar_Initlocks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are having exit function here defined as well? As the docs say, we should invoke it (as initlocks in multithreaded env, added here.
Info: http://netstorage.iar.com/SuppDB/Public/UPDINFO/012120/arm/doc/infocenter/iccarm.ENU.html
(This info is useful to know, could be part of the commit message to include details what this initlocks is fixing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the release document, void __iar_clearlocks(void); should be called to destroy the locks. It should be called after atexit and _Close_all.
In mbed applications, we never do close all we just wait for system to die (in case of issue). Other option was to call it on main thread exit, but than timer thread and background thread will still be running.
platform/mbed_retarget.cpp
Outdated
@@ -880,6 +880,9 @@ extern "C" WEAK void __iar_file_Mtxinit(__iar_Rmtx *mutex) {} | |||
extern "C" WEAK void __iar_file_Mtxdst(__iar_Rmtx *mutex) {} | |||
extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {} | |||
extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {} | |||
#if (__IAR_SYSTEMS_ICC__ >= 8) | |||
extern "C" WEAK void *__aeabi_read_tp (void) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this suddenly required, and what about the other requirements? As for any thread, there is more to implement than just read_tp ? See http://netstorage.iar.com/SuppDB/Public/UPDINFO/012120/arm/doc/infocenter/iccarm.ENU.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thread Local Storage requirement has changed in this version of IAR, and requires RTOS to allocate memory for secondary threads as part of TLS support. read_tp() is to point to the TLS section.
We do not have support of TLS in current RTOS, hence weak function is added to assist build. Actual support will be added in future with changes in RTOS.
nit: should the title be "Add support for IAR 8"? or better yet: "Update IAR to version 8". |
@studavekar Are we still waiting for IAR 8.x update in CI? @deepikabhavnani - all these changes are compatible with the exporter for IAR (templates we have are for v7.x and are forward compatible , all builds with 8.x) ? What version have you been testing with? |
@0xc0170 - I have verified exporter and build for K64F and Cortex-M23 with IAR 7.8/8.x @studavekar will verify few devices with IAR 8.x in single CI machine. We can label it to "needs: CI" but that would be manually triggered. We have not updated the template files to version 3. Version 2 is compatible, we will be missing few advantages of version 3, till we support new template version. |
@deepikabhavnani @0xc0170 have setup the CI machines with IAR 8.11.x Triggered a build for current PR
Build : http://mbed-ci-master-2.austin.arm.com:8081/view/All/job/build_matrix_stage_iar_8/2/ |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
1 similar comment
/morph test |
Result: ABORTEDYour command has finished executing! Here's what you wrote!
|
/morph test |
1 similar comment
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputExample Build failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@studavekar Could you trigger this manually with IAR8? |
3893a93
to
7e4b4fe
Compare
This would run with IAR 8 /morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
Build results IAR 8.XX : http://mbed-ci-master-2.austin.arm.com:8081/view/All/job/build_matrix_stage_iar_8/7/ Test results http://mbed-ci-master-2.austin.arm.com:8081/job/test_matrix/880/ |
MTS_DRAGONFLY_F411RE + IAR 8 + mbed-os-example-cellular - failed [DEBUG] Output: bool success = at->send("AT+CNMI=2,"CTX) && at->recv("OK"); |
@geky @sarahmarshy : Please review the fix in cellular example. |
@0xc0170 IAR build failure : http://mbed-ci-master-2.austin.arm.com:8081/job/iar_8_temp_pr_pipeline/ With the fix added , triggering the test again /morph test |
/morph test |
Looks fine to me. I had a look earlier this morning, syntax looked correct to me. Not sure why IAR 8 complained. @hasnainvirk To be aware of this change, the latest commit with CTX update. |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Results for IAR 8 : http://mbedosci.cloudapp.net/results/pr/4938/6/ |
@0xc0170 @deepikabhavnani Are we updating now to C++14 ? What about other compilers , are they going to be switched to C++14 as well ? |
@@ -110,7 +110,7 @@ static bool set_CNMI(ATCmdParser *at) | |||
// New SMS indication configuration | |||
// set AT+CMTI=[mode, index] , 0 PDU mode, 1 text mode | |||
// Multiple URCs for SMS, i.e., CMT, CMTI, UCMT, CBMI, CDSI as DTE could be following any of these SMS formats | |||
bool success = at->send("AT+CNMI=2,"CTX) && at->recv("OK"); | |||
bool success = at->send("AT+CNMI=2,""1") && at->recv("OK"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a space string literal and macro, it will work. Like:
bool success = at->send("AT+CNMI=2," CTX) && at->recv("OK");
@@ -141,7 +141,7 @@ static void CMT_URC(ATCmdParser *at) | |||
|
|||
static bool set_atd(ATCmdParser *at) | |||
{ | |||
bool success = at->send("ATD*99***"CTX"#") && at->recv("CONNECT"); | |||
bool success = at->send("ATD*99***""1""#") && at->recv("CONNECT"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same like above
@@ -469,7 +469,7 @@ nsapi_error_t PPPCellularInterface::setup_context_and_credentials() | |||
#endif | |||
success = _at->send("AT" | |||
"+FCLASS=0;" // set to connection (ATD) to data mode | |||
"+CGDCONT="CTX",\"%s\",\"%s%s\"", | |||
"+CGDCONT=""1"",\"%s\",\"%s%s\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same like above
The previous fix to replace CTX with string literals was the wrong solution. All that was actually required was to insert a space before the macro.
@0xc0170 - LP ticker and sleep manager tests are failing for all three toolchains. Is it expected for all 4 devices? NCS36510 | NRF51_DK | NRF52_DK | NUCLEO_F429ZI | |
@hasnainvirk I've pushed your change suggestions to Deepika's branch .Does this look better ? |
/morph test |
@studavekar Can we re-run with IAR 8 please and paste results once done? |
@deepikabhavnani yeah we are waiting on #5063 going in |
@SeppoTakalo @mikaleppanen @hasnainvirk pr_head has failed for some reason, any ideas ? |
@adbridge It seems CI timed out and couldn't complete jobs for many targets. Too many jobs in parallel pipe line. |
I have no better knowledge, so how about restarting the testcases? |
I've restarted pr-head, hopefully it won't fail in the same way again |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
@@ -217,7 +217,7 @@ emac_interface_t *wlan_emac_init_interface() | |||
{ | |||
|
|||
if (_emac == NULL) { | |||
_emac = new emac_interface_t(); | |||
_emac = (emac_interface_t*) malloc(sizeof(emac_interface_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use new or error in the case it fails, not print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sg- Everywhere in file print statements are used instead error, I can add that as bug and get it fix in new PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new would have failed as assert but malloc won't. That is the change in behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, @deepikabhavnani, this was the issue with const members right?
@sg-, the emac_interface_t
as written can't be default constructed in c++ (here). The const member (ops) must be constructed but the emac_interface_t
class doesn't have a constructor to initialize the member. Since the emac_api
header is also included by C files, we can't add a constructor. C supports struct initializers for this case, but C++ relies on constructors.
We can either remove the const or allocate with malloc. We could change the error print to assert.
Added support to IAR 8.x, with the reference of release document
__aeabi_read_tp - Weak empty function is added to support the build. It should be implemented with TLS support in IAR Dlib.