Skip to content
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

Merged
merged 2 commits into from Nov 15, 2019

Conversation

@wajahat-ublox
Copy link
Member

wajahat-ublox commented Sep 27, 2019

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

[ ] Fix
[ ] Refactor
[X] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@fahim-ublox @RobMeades @mudassar-ublox @pilotak

Release Notes

@wajahat-ublox wajahat-ublox changed the title Remove target dependancy in ublox cellular APIs Remove target dependency in ublox cellular APIs Sep 27, 2019
@@ -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

This comment has been minimized.

Copy link
@pilotak

pilotak Sep 27, 2019

Contributor

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

This comment has been minimized.

Copy link
@wajahat-ublox

wajahat-ublox Sep 27, 2019

Author Member

Let me double check the differences and i will fix this.

@ciarmcom ciarmcom requested review from ARMmbed/mbed-os-maintainers Sep 27, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Sep 27, 2019

@wajahat-ublox, thank you for your changes.
@ARMmbed/mbed-os-wan @ARMmbed/mbed-os-maintainers please review.

Copy link
Member

0xc0170 left a comment

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) ?

@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Sep 30, 2019

@0xc0170
Do you mean that e.g. only UBX_MDM_SARA_U201 macro is set in json file and we set the UBX_MDM_SARA_U2XX macro from a header file?
The reason for doing this is that in a modem family e.g. SARA-G3XX there is a G350 as well as G340 modem. The Ublox mbed board C027 comes with G350 however a user might want to use G340 with this own custom board. In this case, user simply has to set the family macro UBX_MDM_SARA_G3XX and be able to use the cellular APIs. If we set the family macros from header file based upon modem macro then in the case mentioned above UBX_MDM_SARA_G350 modem macro will not be set hence UBX_MDM_SARA_G3XX family macro also won't be set.

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?

@wajahat-ublox wajahat-ublox force-pushed the wajahat-ublox:ubx_modems_custom_boards branch from 9f3354c to 2f5706b Sep 30, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 30, 2019

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 ?

@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Sep 30, 2019

@0xc0170
I get your point on documenting it but apart from PR please let me know where shall i add the details? few places i can think of are source, json file, cellular docs. What do you recommend?

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Sep 30, 2019

@ARMmbed/mbed-os-wan any better place to document the modem hierarchy than readme in the targets folder in cellular?

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 7, 2019

@ARMmbed/mbed-os-wan could you please answer @0xc0170 's question...

@AnttiKauppila

This comment has been minimized.

Copy link
Contributor

AnttiKauppila commented Oct 8, 2019

targets/UBLOX folder can have it's own readme.md, that is the most logical place to find information regarding to UBLOX modems.

@wajahat-ublox wajahat-ublox requested a review from 0xc0170 Oct 8, 2019
@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Oct 8, 2019

@0xc0170 Readme file added. Please review.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 18, 2019

I am reviewing now

Conflicting files: features/cellular/framework/targets/UBLOX/AT/UBLOX_AT_CellularStack.cpp

@wajahat-ublox Can you rebase to resolve conflict, will start CI

@0xc0170 0xc0170 added the needs: work label Oct 18, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 18, 2019

@ARMmbed/mbed-os-wan Please review

@0xc0170 0xc0170 removed the needs: work label Oct 18, 2019
@wajahat-ublox wajahat-ublox force-pushed the wajahat-ublox:ubx_modems_custom_boards branch from 9eb0c9b to ed95989 Oct 21, 2019
@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Oct 21, 2019

@0xc0170 Conflict resolved and rebased to master.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 21, 2019

CI started

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Oct 21, 2019
@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 21, 2019

Test run: FAILED

Summary: 3 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-GCC_ARM
  • jenkins-ci/mbed-os-ci_build-IAR
  • jenkins-ci/mbed-os-ci_build-ARM
@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Oct 21, 2019

@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.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 21, 2019

Shouldn't that target have this : "public": false set ? That would avoid building

@0xc0170 0xc0170 removed the needs: CI label Oct 21, 2019
@wajahat-ublox

This comment has been minimized.

Copy link
Member Author

wajahat-ublox commented Nov 5, 2019

ill restart CI asap

@0xc0170 Done. Please have a look.

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 5, 2019

@wajahat-ublox Can you please rebase instead of merge ? The last commit should not be on your branch.

@wajahat-ublox wajahat-ublox force-pushed the wajahat-ublox:ubx_modems_custom_boards branch from 0f12c68 to 98f3baa Nov 5, 2019
@wajahat-ublox wajahat-ublox requested a review from 0xc0170 Nov 5, 2019
@0xc0170
0xc0170 approved these changes Nov 5, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 5, 2019

CI restarted

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Nov 5, 2019
@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Nov 5, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@@ -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] = {

This comment has been minimized.

Copy link
@0xc0170

0xc0170 Nov 5, 2019

Member

@AnttiKauppila Is this approach fine ?

@wajahat-ublox Do we need to have this cellular_properties defined always?

This comment has been minimized.

Copy link
@wajahat-ublox

wajahat-ublox Nov 6, 2019

Author Member

@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).

@0xc0170 0xc0170 added needs: review and removed needs: CI labels Nov 5, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 5, 2019

Last question about else condition for properties, as they are always defined even-though linker should be able to eliminate it

@wajahat-ublox wajahat-ublox requested review from AnttiKauppila and 0xc0170 Nov 8, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 13, 2019

CI started (last run is few days old)

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Nov 13, 2019
@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Nov 13, 2019

Test run: FAILED

Summary: 1 of 11 test jobs failed
Build number : 4
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_greentea-test
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Nov 14, 2019

Test failed because of #11862, we will investigate

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Nov 15, 2019

CI restarted

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Nov 15, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 5
Build artifacts

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Nov 15, 2019
@0xc0170 0xc0170 merged commit 7b79157 into ARMmbed:master Nov 15, 2019
27 checks passed
27 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/jenkins/pr-merge Manually fixed status
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8667 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8420B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.