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

[Demo] [ESP32] Enable the BLE stack and get the code to compile #1241

Merged

Conversation

vivien-apple
Copy link
Contributor

Problem

Turning on CHIPoBLE on menuconfig for the ESP32 does not work.

Summary of Changes

  • Rename WoBLE to CHIPoBLE where it has been forgotten
  • Add missing headers
  • Add missing inheritances for ConfigurationManager
  • Add missing code for linking

The proposed patch get the M5Stack demo to advertise BLE. It will still needs some love in order to communicate with an app.

fixes #1240

@@ -110,15 +87,15 @@ CHIP_ERROR GenericConfigurationManagerImpl<ImplClass>::_ConfigureChipStack()
err = CHIP_NO_ERROR;
}
}
exit:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to move this exit:

Copy link
Contributor Author

@vivien-apple vivien-apple Jun 24, 2020

Choose a reason for hiding this comment

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

I agree this is hacky but I moved it on purposes. The main reason is that the current code does not compile if CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH is not defined since the only call sites that call 'exit' are inside it and the compiler complains otherwise.

The solutions I have handy are:

  • Do what I did
  • Remove the code inside CHIP_DEVICE_CONFIG_LOG_PROVISIONING
  • remove the 'exit:' label and rewrite the code accordingly

Comment on lines -60 to -67
// Singleton instance of Chip Group Key Store for the ESP32
//
// NOTE: This is declared as a private global variable, rather than a static
// member of ConfigurationManagerImpl, to reduce the number of headers that
// must be included by the application when using the ConfigurationManager API.
//
GroupKeyStoreImpl gGroupKeyStore;

Copy link
Contributor

Choose a reason for hiding this comment

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

There seems to be a lot of removed code in this PR that I'm not seeing as directly related to "enabling the BLE stack". Were these changes intended to be included in the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a fair point. This file was not used and so there was a lot of dead code that does not even compile and was not used.
For example CHIP does not have all those namespaces:
::chip::Profiles::Security::AppKeys;
::chip::Profiles::NetworkProvisioning;
::chip::Profiles::DeviceDescription

I was unsure about what is the best strategy with this code.
Should I remove it, or should I just try to go and fix it, even if this code is completely unrelated to the BLE thing ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think removing is fine, as long as we annotate why here.

@vivien-apple
Copy link
Contributor Author

For the record, while digging into the opened PR I realised that this PR shares some similarities with #1192 since both bring ConfigurationManagerImpl into the build (#1192 for nRF5 and this one for ESP32).

I believe the comments related to GroupKeyStoreImpl there will apply here: basically, add a TODO with an issue #

@vivien-apple
Copy link
Contributor Author

I opened #1266 for the GroupKeyStore part and will add a TODO in my next update to the code.

@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch 2 times, most recently from 6160eb0 to cd0d221 Compare June 25, 2020 09:07
@andy31415
Copy link
Contributor

Is the 300+ KB increase on .text and +79KB .data increase for the ESP32 examples really correct? OUCH!

@kedars
Copy link
Contributor

kedars commented Jun 25, 2020

Is the 300+ KB increase on .text and +79KB .data increase for the ESP32 examples really correct? OUCH!

That's likely due to Bluedroid as BT got pulled in. I am working on a NimBLE implementation for the BT layer, that should help bring this down. Hopefully will raise a PR early next week.

@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch from cd0d221 to 3b39ee5 Compare June 25, 2020 17:09
@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch 3 times, most recently from 56d2c62 to f7da2ff Compare June 26, 2020 14:06
@vivien-apple
Copy link
Contributor Author

OK I was wondering why the ESP32 build suddenly fails on CI but not locally. It ends up that I got a working sdkconfig that uses the right parameters while CI has been broken by #1248. Hopefully once #1299 lands I should be able to have a green CI.

@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch from f7da2ff to a18c62c Compare June 26, 2020 15:40
@woody-apple
Copy link
Contributor

@vivien-apple merge conflicts

@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch 2 times, most recently from 7ec72ea to 3da5d19 Compare June 26, 2020 22:44
@vivien-apple
Copy link
Contributor Author

Rebased and the ESP32 CI is finally green...

@vivien-apple vivien-apple force-pushed the Demo_RendezVous_StartTheBTStack branch from 3da5d19 to 46f4ba3 Compare June 27, 2020 09:25
@chip-bot
Copy link

Size increase report for "Build Examples [nRF]"

File Section File VM
chip-nrf52840-lock-example.out .text 4768 4768
chip-nrf52840-lock-example.out .bss 0 16
chip-nrf52840-lock-example.out .data 8 8
Full report output
Bloat report for job 'Build Examples [nRF]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/nrf-build/chip-nrf52840-lock-example.out and example_binaries/nrf-build/chip-nrf52840-lock-example.out:

sections,vmsize,filesize
.debug_info,0,84180
.debug_line,0,21933
.debug_loc,0,14079
.debug_macro,0,8619
.debug_abbrev,0,7270
.text,4768,4768
.debug_str,0,3919
.strtab,0,2285
.debug_frame,0,1980
.debug_ranges,0,1840
.symtab,0,1840
.debug_aranges,0,752
.bss,16,0
.data,8,8
[Unmapped],0,-4765


@chip-bot
Copy link

Size increase report for "Build Examples [main-build]"

File Section File VM
Full report output
Bloat report for job 'Build Examples [main-build]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/main-build/chip-standalone-demo.out and example_binaries/main-build/chip-standalone-demo.out:

sections,vmsize,filesize


@chip-bot
Copy link

Size increase report for "Build Examples [ESP32]"

File Section File VM
chip-wifi-echo.elf .flash.text 298560 298560
chip-wifi-echo.elf .flash.rodata 78584 78584
chip-wifi-echo.elf .dram0.bss 0 28368
chip-wifi-echo.elf .iram0.text 27488 27488
chip-wifi-echo.elf .dram0.data 1360 1360
Full report output
Bloat report for job 'Build Examples [ESP32]'

Files found only in the baseline:
    bloat_report.txt

Comparing master_binaries/esp32-build/chip-wifi-echo.elf and example_binaries/esp32-build/chip-wifi-echo.elf:

sections,vmsize,filesize
.debug_info,0,2224454
.debug_line,0,918167
.debug_loc,0,343933
.flash.text,298560,298560
.debug_str,0,187402
.debug_abbrev,0,132251
.flash.rodata,78584,78584
.strtab,0,75078
.debug_frame,0,62444
.symtab,0,54704
.debug_ranges,0,29136
.dram0.bss,28368,0
.iram0.text,27488,27488
.debug_aranges,0,22944
.shstrtab,0,4633
[106 Others],0,2508
.dram0.data,1360,1360
.xt.lit._ZNKSt13__facet_shims12__any_stringcvSbIT_St11char_traitsIS1_ESaIS1_EEIcEEv,0,360
.xt.prop._ZNSt13__facet_shims12__any_stringaSIcEERS0_RKSbIT_St11char_traitsIS3_ESaIS3_EE,0,360
.xt.lit._ZNKSt7num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE14_M_extract_intItEES3_S3_S3_RSt8ios_baseRSt12_Ios_IostateRT_,0,328
[Unmapped],0,-930


@vivien-apple
Copy link
Contributor Author

Ok. It is fully green now.

@woody-apple woody-apple merged commit d15fa87 into project-chip:master Jun 27, 2020
jmartinez-silabs pushed a commit to SiliconLabs/matter that referenced this pull request Oct 25, 2023
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
shgutte pushed a commit to shgutte/connectedhomeip that referenced this pull request Jan 11, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
jmartinez-silabs pushed a commit to SiliconLabs/matter that referenced this pull request Jan 18, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
mkardous-silabs pushed a commit to mkardous-silabs/connectedhomeip that referenced this pull request Jan 29, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
jmartinez-silabs pushed a commit to SiliconLabs/matter that referenced this pull request Feb 15, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
jmartinez-silabs pushed a commit to SiliconLabs/matter that referenced this pull request May 8, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
rcasallas-silabs pushed a commit to rcasallas-silabs/connectedhomeip that referenced this pull request Jun 20, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
rcasallas-silabs pushed a commit to rcasallas-silabs/connectedhomeip that referenced this pull request Jun 20, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
chirag-silabs pushed a commit to rosahay-silabs/connectedhomeip that referenced this pull request Jul 15, 2024
…due to data-model update from CSA

Merge in WMN_TOOLS/matter from bugfix/mpc-build-failure-fix to silabs

Squashed commit of the following:

commit 4702c471222d7ebf9e16a13d6e899a444e62a823
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 17:33:39 2023 +0530

    Update .zap and .matter file with feature-level 98

commit d1ed41ba38e9c6bc6f8303458285b77370c1bd29
Author: Suhas Shankar <[email protected]>
Date:   Fri Oct 13 14:19:35 2023 +0530

    Fixes build failure due to data-model update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Demo][ESP32] Enable the BLE stack and get the code to compile
7 participants