-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
fixes ESP32-C3 WiFiProv and btInUse() #8243
Conversation
@sanketwadekar - please test it and let me know. Thanks! |
@SuGlider, I have tested the Rainmaker Switch example which uses the WiFiProv library on esp32c3 and it works fine. Have you checked other weak symbols in esp32-hal-misc.c? Also, Arduino 2.0.9 is already released right? You might need to add this PR to the next release milestone. Tagging @vikramdattu, @dhavalgujar |
Closes #7903 |
@@ -209,9 +209,8 @@ bool verifyRollbackLater() { return false; } | |||
#endif | |||
|
|||
#ifdef CONFIG_BT_ENABLED | |||
//overwritten in esp32-hal-bt.c | |||
bool btInUse() __attribute__((weak)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuGlider I am wondering if this change is also applicable for other weak symbols in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified it.
The issue occurs when a weak and strong symbols are part of the same core.a
library file.
In the building process with Arduino, it first compiles all the Core Files and build a reusable Library.
The other weak functions are changed/redefined in the Sketch, therefore, its strong symbols are correctly linked.
The issue only happens with this very specific btInUse()
function because its strong symbol is in the same core.a
file and it is ignored by the RISC-V Linker.
Thanks for testing and confirming.
Yes, all other symbols are OK. They can be defined in the Arduino Sketch and the strong symbols are linked correctly (xtensa and RV). The issue is very specific to symbols within the same Core Library (
Yes. We don't have yet a 2.0.10 version. |
@VojtechBartoska - I just created the 2.0.10 TAG. I also added this one and another PR to 2.0.10 |
Description of Change
This change is necessary within Arduino Core 2.0.x and 3.0.x.
When testing ESP32-C3 with WiFiProv.ino example to use Bluetooth provisioning, it fails because
btInUse()
returns false due to a weak/strong symbol resolving within the linker.This PR sets the origin of the
btInUse()
function to be withesp32-hal-bt.c
and its symbol is an external one foresp32-hal-misc.c
making possible for the user to redefine it, is necessary. This solves the Core library C3 linker issue.Tests scenarios
The PR is tested by using
WiFiProv.ino
example by removing the#if CONFIG_IDF_TARGET_ESP32
in order to use it with the C3.This shall use this call:
WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, "abcd1234", "Prov_123");
Tested with ESP32, ESP32-C3, ESP32-S3.
Related links
Fix #7903