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

Refactorization of ot repos #7139

Merged

Conversation

doru91
Copy link
Contributor

@doru91 doru91 commented May 26, 2021

This addresses #7058

Part 1:
[K32W] Use the new ot-nxp repo

OpenThread maintainers decided to split the big OT repo (core OT stack + vendor example)
in several repos: one repo containing the OT stack, then each vendor has a separate repo
with its example (the vendor repo contains the OT stack repo as a submodule).

This commit allows using the ot-nxp repo inside PCHIP. Only the platform files from ot-nxp
are used, the OT stack repo used is still the one from third_party/openthread/repo.

Part 2: Use the new ot-{efr32/qorvo} repos

This PR also touches Silabs and Qorvo files so help from @jmartinez-silabs and someone from Qorvo is needed.

@todo
Copy link

todo bot commented May 26, 2021

*/

/* TODO */
/**
* @def OPENTHREAD_CONFIG_ENABLE_SOFTWARE_CSMA_BACKOFF
*
* Define to 1 if you want to enable software CSMA-CA backoff logic.
*
*/
/* TODO */
/**


This comment was generated by todo based on a TODO comment in 1a9ce7e in #7139. cc @doru91.

@todo
Copy link

todo bot commented May 26, 2021

*/

/* TODO */
/**
* @def OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
*
* Define to 1 to enable NCP HDLC support.
*
*/
#ifndef OPENTHREAD_CONFIG_NCP_HDLC_ENABLE
#define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1
#endif


This comment was generated by todo based on a TODO comment in 1a9ce7e in #7139. cc @doru91.

@todo
Copy link

todo bot commented May 26, 2021

*/

/* TODO */
return false;
}
void otSysDeinit(void)
{
/* TODO */
}
void otSysProcessDrivers(otInstance *aInstance)
{


This comment was generated by todo based on a TODO comment in 1a9ce7e in #7139. cc @doru91.

@todo
Copy link

todo bot commented May 26, 2021

*/

/* TODO */
}
void otSysProcessDrivers(otInstance *aInstance)
{
K32WRadioProcess(aInstance);
K32WUartProcess();
K32WAlarmProcess(aInstance);
}
WEAK void otSysEventSignalPending(void)


This comment was generated by todo based on a TODO comment in 1a9ce7e in #7139. cc @doru91.

@doru91 doru91 changed the title Feature/ot repo refactoring stash Feature/ot repo refactoring May 26, 2021
@doru91 doru91 changed the title Feature/ot repo refactoring Refactorization of ot repos May 26, 2021
@doru91 doru91 force-pushed the feature/ot_repo_refactoring_stash branch from 990906f to cb3bd36 Compare May 26, 2021 19:37
doru91 and others added 8 commits May 27, 2021 00:36
OpenThread maintainers decided to split the big OT repo (core OT stack + vendor example)
in several repos: one repo containing the OT stack, then each vendor has a separate repo
with its example (the vendor repo contains the OT stack repo as a submodule).

This commit allows using the ot-nxp repo inside PCHIP. Only the platform files from ot-nxp
are used, the OT stack repo used is still the one from third_party/openthread/repo.

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
@doru91 doru91 force-pushed the feature/ot_repo_refactoring_stash branch from abfcd3b to a27add0 Compare May 27, 2021 07:36
doru91 added 2 commits May 27, 2021 01:02
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
@@ -813,10 +813,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread<ImplClass>::DoInit(otInstanc
VerifyOrExit(otInst != NULL, err = MapOpenThreadError(OT_ERROR_FAILED));
}

#if !defined(__ZEPHYR__) && !defined(ENABLE_CHIP_SHELL) && !defined(PW_RPC_ENABLED)
Copy link
Contributor

Choose a reason for hiding this comment

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

The path towards OT CLI interface get's removed here. What will be the substitution to access the OT infrastructure for debugging purposes ?
Noted removing the CLI frees up quite some RAM/flash if no longer required

Copy link
Contributor Author

@doru91 doru91 May 27, 2021

Choose a reason for hiding this comment

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

I removed these lines because otCliUartInit API is not available anymore in openthread since openthread/openthread#6243.
I will push a change such that the user will be able to use a GN build argument for enabling/disabling the OT CLI.

OT CLI takes around 25K of flash with everything compiled with size optimizations - I wonder why it requires so much space.

@@ -44,6 +44,15 @@
// Use smaller maximum interval to speed up reattaching.
#define OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_MAXIMUM_INTERVAL (60 * 10 * 1000) // default 1200000 ms

// disable unused features
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree to remove these features as they are indeed unused within Matter - we would leave a lot of unused dead code in the Matter stack otherwise.
But are they not required for Thread stack certification ? Which triggers the question how the supported set of Thread features relates to Matter certification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest, I don't know how Matter certification will work in conjunction with Thread certification. In my opinion. we shouldn't loose Thread certification if some features which are not used by Matter are disabled. Maybe someone experienced with the certification process can comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK at least Joiner functionality (from the below list) is now required to pass the official Thread certification for End Device / Router.

@github-actions
Copy link

Size increase report for "gn_qpg6100-example-build" from d96d8a3

File Section File VM
chip-qpg6100-lighting-example.out .heap 0 2128
chip-qpg6100-lighting-example.out .bss 0 -2128
chip-qpg6100-lighting-example.out .text -22036 -22036
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.heap,2128,0
.debug_aranges,0,-1824
.bss,-2128,0
.debug_ranges,0,-5096
.debug_frame,0,-6280
.strtab,0,-12460
.symtab,0,-13792
.debug_abbrev,0,-15929
.text,-22036,-22036
.debug_str,0,-26477
.debug_line,0,-42867
[Unmapped],0,-43500
.debug_loc,0,-50388
.debug_info,0,-892651


Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
@doru91
Copy link
Contributor Author

doru91 commented May 27, 2021

CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI

Done.

@doru91
Copy link
Contributor Author

doru91 commented May 27, 2021

could this logic be moved to third_party/openthread/platforms/BUILD.gn to be generic for all ?

I wouldn't add this change to third_party/openthread/platforms/BUILD.gn as that BUILD.gn file contains rules for building core OT stack. The CLI implementation should be platform dependant.

tima-q and others added 3 commits May 28, 2021 14:39
* Re-enabled CLI on QPG6100 - introducing CLI flag in DeviceConfig.h
Fix to efr buld to support openthread repo update
"${openthread_root}/examples/platforms/efr32/src/openthread-core-efr32-config.h",
"${openthread_efr32_root}/src/src/openthread-core-efr32-config-check.h",
"${openthread_efr32_root}/src/src/openthread-core-efr32-config.h",
"${openthread_root}/src/cli/cli_config.h",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mspang, could you please help us removing this ugly hack?

We had to do it in order to bypass this error:

ERROR at //third_party/connectedhomeip/third_party/openthread/repo/examples/apps/cli/cli_uart.cpp:37:11: Include not allowed.
#include "cli/cli_config.h"
^---------------
It is not in any dependency of
//third_party/connectedhomeip/third_party/openthread/platforms:libopenthread-cli-uart
The include file is in the target(s):
//third_party/connectedhomeip/third_party/openthread/repo/src/cli:libopenthread-cli-ftd
//third_party/connectedhomeip/third_party/openthread/repo/src/cli:libopenthread-cli-mtd

@@ -0,0 +1,17 @@
# Copyright (c) 2020 Project CHIP Authors
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 2021

@@ -44,6 +44,15 @@
// Use smaller maximum interval to speed up reattaching.
#define OPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_MAXIMUM_INTERVAL (60 * 10 * 1000) // default 1200000 ms

// disable unused features
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK at least Joiner functionality (from the below list) is now required to pass the official Thread certification for End Device / Router.

Suggestion cleanup + re-enabling CLI on QPG6100
@andy31415 andy31415 merged commit dcc1558 into project-chip:master May 31, 2021
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
* [K32W] Use the new ot-nxp repo

OpenThread maintainers decided to split the big OT repo (core OT stack + vendor example)
in several repos: one repo containing the OT stack, then each vendor has a separate repo
with its example (the vendor repo contains the OT stack repo as a submodule).

This commit allows using the ot-nxp repo inside PCHIP. Only the platform files from ot-nxp
are used, the OT stack repo used is still the one from third_party/openthread/repo.

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Use the new ot-{efr32/qorvo} repos

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Restyled by whitespace

* Restyled by clang-format

* Restyled by gn

* Restyled by shfmt

* Fix ot submodules

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Remove TODOs

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Restyled by clang-format

* Remove ot-efr from .gitsubmodules

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Fix ot-efr submodule

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* * Update QPG6100 OpenThreadConfig.h (UART->HDLC)

* [K32W] Add a GN build arg for enabling/disabling the OT CLI

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* Restyled by clang-format

* Restyled by gn

* Fix define naming

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>

* * Removing ot_<platform>.gni files - moved ot root var to platforms
* Re-enabled CLI on QPG6100 - introducing CLI flag in DeviceConfig.h

* Fix to efr buld to support openthread repo update

Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Timothy Maes <timothy.maes@qorvo.com>
Co-authored-by: jmartinez-silabs <junior.martinez@silabs.com>
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.

6 participants