-
Notifications
You must be signed in to change notification settings - Fork 3k
Remove target dependency in ublox cellular APIs #11580
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
Remove target dependency in ublox cellular APIs #11580
Conversation
@@ -98,7 +104,7 @@ nsapi_error_t UBLOX_AT::init() | |||
|
|||
nsapi_error_t err = NSAPI_ERROR_OK; | |||
|
|||
#ifdef TARGET_UBLOX_C027 | |||
#ifdef UBX_MDM_SARA_G350 |
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.
shouldn't this be UBX_MDM_SARA_G3XX
one could have G340. It would than lead to UBX_MDM_SARA_G350
not being used therefore UBX_MDM_SARA_G3XX
would be enough to define
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.
Let me double check the differences and i will fix this.
@wajahat-ublox, thank you for your changes. |
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.
Introducing the new macros, where they are documented ? UBX_MDM_SARA_U2XX
vs UBX_MDM_SARA_U211
?
Wouldn't be easier to just introduce N211 macro and get U2XX automatically (cellular target header for deduction of the common code) ?
@0xc0170 Also please elaborate where am i supposed to document these new macros. Is this supposed to go in Cellular readme or is there some other section for this? |
9f3354c
to
2f5706b
Compare
I was just wondering if we can simplify this somehow. Setting two macros for almost the same thing (if we can just use the modem and the family can be found in the header file (although it would mean to maintain the header file to get proper family). So might be after all the same. Documentation - what types are there and what modems are supported - is it documented anywhere or do I need to scan the sources to find out macros U2XX, etc ? |
@0xc0170 |
@ARMmbed/mbed-os-wan any better place to document the modem hierarchy than readme in the targets folder in cellular? |
@ARMmbed/mbed-os-wan could you please answer @0xc0170 's question... |
targets/UBLOX folder can have it's own readme.md, that is the most logical place to find information regarding to UBLOX modems. |
@0xc0170 Readme file added. Please review. |
I am reviewing now
@wajahat-ublox Can you rebase to resolve conflict, will start CI |
@ARMmbed/mbed-os-wan Please review |
9eb0c9b
to
ed95989
Compare
@0xc0170 Conflict resolved and rebased to master. |
CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
@0xc0170 I looked at the CI logs, any idea why it is building for UBLOX_C030_R41XM? I mean actually there are two targets, UBLOX_C030_R410M and UBLOX_C030_R412M. My assumption is that UBLOX_C030_R41XM is only used for target inheritance purpose. |
Shouldn't that target have this : |
@0xc0170 Done. Please have a look. |
@wajahat-ublox Can you please rebase instead of merge ? The last commit should not be on your branch. |
0f12c68
to
98f3baa
Compare
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@@ -57,6 +61,24 @@ static const intptr_t cellular_properties[AT_CellularBase::PROPERTY_MAX] = { | |||
0, // PROPERTY_NON_IP_PDP_TYPE | |||
1, // PROPERTY_AT_CGEREP | |||
}; | |||
#else | |||
static const intptr_t cellular_properties[AT_CellularBase::PROPERTY_MAX] = { |
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.
@AnttiKauppila Is this approach fine ?
@wajahat-ublox Do we need to have this cellular_properties defined always?
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.
@0xc0170 The else condition is there for a cellular program using UBLOX APIs with an unsupported modem. Yes in case of non cellular programs, it should not be part of final binary (optimized out).
Last question about else condition for properties, as they are always defined even-though linker should be able to eliminate it |
CI started (last run is few days old) |
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
Test failed because of #11862, we will investigate |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
The intention of this PR is to allow ublox cellular APIs to be used with custom targets.
When using ublox modem with a different MCU, user only has to define correct modem macros in their mbed_app.json like this:
"K64F": { "target.macros_add": ["UBX_MDM_SARA_R41XM", "UBX_MDM_SARA_R412M"] }
Previously, as discussed in #11505 #11170, the APIs were tied to ublox mbed boards so it was troublesome to use the with a different MCU or a custom board.
Pull request type
Reviewers
@fahim-ublox @RobMeades @mudassar-ublox @pilotak
Release Notes