Skip to content

Fix MeshInterface::get_default_instance() #7778

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

Merged
merged 5 commits into from
Aug 30, 2018

Conversation

SeppoTakalo
Copy link
Contributor

Description

Fix MeshInterface::get_default_instance()
Both 6LoWPAN and Thread interfaces were returning and referencing wrong types. Pointers instead of reference, and objects where pointer should have been.

Also enable targets like MCR20A and NCS36510 to provide the default Nanostack RF driver.

Tested quickly on K64F+Atmel shield, K64F+MCR20 shield, MCR20A.

Requires following PRs to be usable:

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Feature
[ ] Breaking change

@SeppoTakalo
Copy link
Contributor Author

@kjbracey-arm @mikaleppanen Please review.

@SeppoTakalo SeppoTakalo changed the title Provide default mesh Fix MeshInterface::get_default_instance() Aug 13, 2018
@cmonr cmonr requested review from kjbracey and mikaleppanen August 13, 2018 15:45
@@ -582,10 +582,13 @@
"macros": ["CPU_MKW24D512VHA5", "FSL_RTOS_MBED"],
"inherits": ["Target"],
"detect_code": ["0250"],
"device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG", "FLASH"],
"device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG", "FLASH", "802_15_4_PHY", "MCR20A"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this, I think (but am not totally certain) that "MCR20A" should be in "extra_labels". That seems to be where specific parts are named, whereas "device_has" is for general technologies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. extra_labels means that it would pick up folder like TARGET_MCR20A but it would not be available as a build time flag.

device_has is a build time macro, but not visible in the mbed_config.h

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sg- suggests that this - driver providing an implementation - is the intended use of the new component, and that should work both ways. Worth a try?

@SeppoTakalo
Copy link
Contributor Author

Removed the DEVICE_MCR20A flag and rebased on top of master

@SeppoTakalo
Copy link
Contributor Author

For KW24D to be fully usable, it requires #7814

@AnttiKauppila
Copy link

This is targeted to 5.10.0-rc1
@kjbracey-arm can you review this again.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 24, 2018

Build : FAILURE

Build number : 2889
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7778/

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 24, 2018

Please review KW24D build failures

@SeppoTakalo
Copy link
Contributor Author

Rebased on top of master and dropped the KW24D changes.
Those are in #7814

@cmonr
Copy link
Contributor

cmonr commented Aug 27, 2018

/morph build

@cmonr cmonr removed the needs: CI label Aug 29, 2018
@cmonr
Copy link
Contributor

cmonr commented Aug 29, 2018

@SeppoTakalo Please take a look at the single linker failure.

@stevew817
Copy link
Contributor

stevew817 commented Aug 29, 2018

@SeppoTakalo If this impacts NCS36510, then targets providing SL_RAIL most probably need a similar update. Please don't leave us behind.

@SeppoTakalo SeppoTakalo force-pushed the provide_default_mesh branch from 2ad903e to 4989650 Compare August 30, 2018 08:04
@SeppoTakalo
Copy link
Contributor Author

SeppoTakalo commented Aug 30, 2018

My bad, the previous commit did not disable NCS36510 builds.
I had to remove the test config as well.

Now "should" build with IAR as well

+------+--------+-----------+------------+-------------+
| name | target | toolchain | static_ram | total_flash |
+------+--------+-----------+------------+-------------+
+------+--------+-----------+------------+-------------+


Build successes:
  * NCS36510::IAR::MBED-BUILD


Build skips:
  * NCS36510::IAR::MBED-OS-TESTS-NETSOCKET-DNS
  * NCS36510::IAR::MBED-OS-TESTS-NETSOCKET-TCP
  * NCS36510::IAR::MBED-OS-TESTS-NETSOCKET-UDP

It skips the build as it is supposed to.

@SeppoTakalo
Copy link
Contributor Author

@stevew817 Good point,
Can you do this for the SL_RAIL as well
9836b9b

So targets that use 802.15.4 as a default, should provide NanostackRfPhy &NanostackRfPhy::get_default_instance() method.
Then once the device does:

	        "overrides": {
            "network-default-interface-type": "MESH"
        }

in the targets.json and has 802_15_4_PHY in the device_has list, it will provide mesh network as a NetworkInterface::get_default_instance() call.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 30, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Aug 30, 2018

Build : SUCCESS

Build number : 2963
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7778/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Aug 30, 2018

@cmonr
Copy link
Contributor

cmonr commented Aug 30, 2018

Exporter node got stuck, had to abort.

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Aug 30, 2018

@mbed-ci
Copy link

mbed-ci commented Aug 30, 2018

@cmonr cmonr merged commit 06a98e7 into ARMmbed:master Aug 30, 2018
@0xc0170 0xc0170 removed the needs: CI label Aug 30, 2018
@SeppoTakalo SeppoTakalo deleted the provide_default_mesh branch August 31, 2018 13:08
@cmonr cmonr removed the risk: A label Sep 2, 2018
stevew817 added a commit to SiliconLabs/mbed-os that referenced this pull request Sep 6, 2018
TB_SENSE_12 would have been left behind by the changes in ARMmbed#7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
cmonr pushed a commit to cmonr/mbed-os that referenced this pull request Sep 18, 2018
TB_SENSE_12 would have been left behind by the changes in ARMmbed#7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
stevew817 added a commit to SiliconLabs/mbed-os that referenced this pull request Sep 19, 2018
TB_SENSE_12 would have been left behind by the changes in ARMmbed#7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
cmonr pushed a commit that referenced this pull request Sep 21, 2018
…terface

Hotfix for PR #7778 on Silicon Labs targets
0xc0170 pushed a commit that referenced this pull request Oct 1, 2018
TB_SENSE_12 would have been left behind by the changes in #7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
adbridge pushed a commit that referenced this pull request Oct 8, 2018
TB_SENSE_12 would have been left behind by the changes in #7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
adbridge pushed a commit that referenced this pull request Oct 8, 2018
TB_SENSE_12 would have been left behind by the changes in #7778. This commit implements the changes in mbed to allow targets to provide a default network interface for Silicon Labs targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants