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

[nrf5-lock] start joiner role on boot #1962

Merged
merged 4 commits into from
Aug 7, 2020

Conversation

bukepo
Copy link
Contributor

@bukepo bukepo commented Aug 4, 2020

Problem

This commit starts joiner role boot boot so that it can be discovered by commissioners.

Summary of Changes

Start joiner role within 15 minutes on boot.

if (xTaskGetTickCount() > self->mJoinerExpire || self->Impl()->IsThreadProvisioned())
{
ChipLogDetail(DeviceLayer, "Thread joiner timer stopped.");
xTimerStop(xTimer, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

should we check return codes in some form of ASSERT ?

Copy link
Contributor

Choose a reason for hiding this comment

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

// Try starting joiner within 15m.
self->mJoinerExpire = xTaskGetTickCount() + pdMS_TO_TICKS(15 * 60 * 1000);

TimerHandle_t joinerTimer = xTimerCreate("JoinerTimer", pdMS_TO_TICKS(10000), pdTRUE, self, &OnJoinerTimer);
Copy link
Contributor

Choose a reason for hiding this comment

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

check for NULL return in case of failure?

Copy link
Contributor

Choose a reason for hiding this comment

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

@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "nrf-example-build"

File Section File VM
chip-nrf52840-lock-example.out .text 280 280
chip-nrf52840-lock-example.out .bss 0 8
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-nrf52840-lock-example.out and ./pull_artifact/chip-nrf52840-lock-example.out:

sections,vmsize,filesize
.debug_info,0,931
.debug_macro,0,371
.debug_line,0,336
.text,280,280
.debug_loc,0,253
.debug_str,0,160
.strtab,0,121
.symtab,0,64
.debug_frame,0,40
.debug_abbrev,0,25
.bss,8,0
.debug_aranges,0,8
.debug_ranges,0,8
[Unmapped],0,-277


@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "nrfconnect-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-nrf52840-lock-example.elf and ./pull_artifact/chip-nrf52840-lock-example.elf:

sections,vmsize,filesize


@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "linux-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-standalone-demo.out and ./pull_artifact/chip-standalone-demo.out:

sections,vmsize,filesize


@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "esp32-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-wifi-echo.elf and ./pull_artifact/chip-wifi-echo.elf:

sections,vmsize,filesize


@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "gn_nrf-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv


@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Size increase report for "gn_linux-example-build"

File Section File VM
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv


@bukepo bukepo requested a review from andy31415 August 5, 2020 08:40
@andy31415 andy31415 merged commit b15c292 into project-chip:master Aug 7, 2020
mspang added a commit to mspang/connectedhomeip that referenced this pull request Aug 16, 2020
As of b15c292 ("[nrf5-lock] start joiner role on boot (project-chip#1962)"),
we are using too much stack space in timer task. The timer task has a 1k
stack and logging along uses a 256 byte stack buffer.

The code in
GenericThreadStackManagerImpl_FreeRTOS<ImplClass>::OnJoinerTimer should
be moved off the timer task. In the meantime increase the stack size
to avoid overruns in the thread joiner.

Also enable the option configCHECK_FOR_STACK_OVERFLOW, and while we're
here also enable configUSE_MALLOC_FAILED_HOOK. These diagnostic options
are invaluable for saving debugging time.

Since logging uses significant stack space, try to catch stack overflows
in the platform LogV(). This fires reliably in OnJoinerTimer prior
to enlarging the stack.

Depends on project-chip#2185

Fixes project-chip#2187
mspang added a commit to mspang/connectedhomeip that referenced this pull request Aug 16, 2020
As of b15c292 ("[nrf5-lock] start joiner role on boot (project-chip#1962)"),
we are using too much stack space in timer task. The timer task has a 1k
stack and logging along uses a 256 byte stack buffer.

The code in
GenericThreadStackManagerImpl_FreeRTOS<ImplClass>::OnJoinerTimer should
be moved off the timer task. In the meantime increase the stack size
to avoid overruns in the thread joiner.

Also enable the option configCHECK_FOR_STACK_OVERFLOW, and while we're
here also enable configUSE_MALLOC_FAILED_HOOK. These diagnostic options
are invaluable for saving debugging time.

Since logging uses significant stack space, try to catch stack overflows
in the platform LogV(). This fires reliably in OnJoinerTimer prior
to enlarging the stack.

Fixes project-chip#2187
BroderickCarlin pushed a commit that referenced this pull request Aug 20, 2020
* nrf5: Enlarge stack to fix thread join overruns

As of b15c292 ("[nrf5-lock] start joiner role on boot (#1962)"),
we are using too much stack space in timer task. The timer task has a 1k
stack and logging along uses a 256 byte stack buffer.

The code in
GenericThreadStackManagerImpl_FreeRTOS<ImplClass>::OnJoinerTimer should
be moved off the timer task. In the meantime increase the stack size
to avoid overruns in the thread joiner.

Also enable the option configCHECK_FOR_STACK_OVERFLOW, and while we're
here also enable configUSE_MALLOC_FAILED_HOOK. These diagnostic options
are invaluable for saving debugging time.

Since logging uses significant stack space, try to catch stack overflows
in the platform LogV(). This fires reliably in OnJoinerTimer prior
to enlarging the stack.

Fixes #2187

* Reduce timer task memory to 2k

* Fix the stack size in EFR32 as well
andy31415 pushed a commit that referenced this pull request Aug 20, 2020
* -Include the correct FreeRTOS Cortex files in the EFR32 makefiles correspoding to the defined MCU family (MG12 vs MG21)
-Init all IRQs priority to a lower priority valid for FreeRTOS API. An IRQ in the gecko radio libs
 with the default priority 0 (highest) was causing a assert failure in FreeRTOS

* Add the IRQ priority init for all EFR32 boards init
Restyle some file headers and copyright mentions

* Fix build script

* Fix sources for EFR32 platform

* Set mbedtls to external source

* Fix compilation with ninja

* Add BoltLockManager to manage the lock and unlock request and state
Add DataModelHandler to handle bolt actions from the cluster messages
Add Gen folder with the files for silicon lab cluster implementation
Strt a server session for UDP messages
Include some mbedtls sources  files from gsdk 2.7 in gni . TO BE FIX

* merge upstream

* Added Openthread to the example

* nrf5: Enlarge stack to fix thread join overruns

As of b15c292 ("[nrf5-lock] start joiner role on boot (#1962)"),
we are using too much stack space in timer task. The timer task has a 1k
stack and logging along uses a 256 byte stack buffer.

The code in
GenericThreadStackManagerImpl_FreeRTOS<ImplClass>::OnJoinerTimer should
be moved off the timer task. In the meantime increase the stack size
to avoid overruns in the thread joiner.

Also enable the option configCHECK_FOR_STACK_OVERFLOW, and while we're
here also enable configUSE_MALLOC_FAILED_HOOK. These diagnostic options
are invaluable for saving debugging time.

Since logging uses significant stack space, try to catch stack overflows
in the platform LogV(). This fires reliably in OnJoinerTimer prior
to enlarging the stack.

Fixes #2187

* Reduce timer task memory to 2k

* Fix the stack size in EFR32 as well

* Add BoltLockManager to manage the lock and unlock request and state
Add DataModelHandler to handle bolt actions from the cluster messages
Add Gen folder with the files for silicon lab cluster implementation
Start a server session for UDP messages
Include some mbedtls sources  files from gsdk 2.7 in gni . TO BE FIX

merge upstream

* Add support for Silabs dev board BRD4163A and BRD4164A

Merge Upstream into branch

Add BoltLockManager to manage the lock and unlock request and state
Add DataModelHandler to handle bolt actions from the cluster messages
Add Gen folder with the files for silicon lab cluster implementation
Strt a server session for UDP messages
Include some mbedtls sources  files from gsdk 2.7 in gni . TO BE FIX

merge upstream

Add the IRQ priority init for all EFR32 boards init
Restyle some file headers and copyright mentions

* Restyled by whitespace

* Fix submodules

* Format GN files

* Clean up & enable Thread on EFR32

* Fix initial thread stack overrun

* Fix entropy provider

* Restyled by clang-format

* Fix openthread commit

* Reformat build files

  gn format $(git ls-files HEAD '*.gn' '*.gni')
  git add $(git ls-files HEAD '*.gn' '*.gni')

Hopefully the last time now that restyled is working.

* Format GN files

* Apply fixes from master

Co-authored-by: jmartinez-silabs <[email protected]>
Co-authored-by: jfpenven <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: jmartinez-silabs <[email protected]>
chirag-silabs pushed a commit to rosahay-silabs/connectedhomeip that referenced this pull request Jul 15, 2024
Merge in WMN_TOOLS/matter from provision_si917_flash_only_v2 to silabs_slc_1.3

Squashed commit of the following:

commit e1232e7d4be9965bba64739d24afe32d0c325dd8
Author: Ricardo Casallas <[email protected]>
Date:   Thu Jun 6 15:43:50 2024 -0400

    Provision: Si917 Flash-only.
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.

7 participants