-
Notifications
You must be signed in to change notification settings - Fork 7.6k
esp_bt_controller_init error 259 on esp-idf project with arduino as component #3436
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
Comments
This message come when this line is executed |
First idea is memory shortage. |
@chegewara , the same sketch run on a native Arduino sketch for ESP32. |
Strange, code looks like one of example, easy code. |
Ok, so I start from the default sdkconfig and run menuconfig directly this time (not by visualgdb).
Compiling finish nicely. and when I run the code I got:
:-( I realy dont know where to search now |
I try to build the esp-idf ble spp client example and it worked on my hardware.
|
Ok, i just tested code from your repository, with esp-idf v3.2 and it works, with 1 exception. I had to disable classic BT in menuconfig. |
@chegewara : I understand you havent any message on serial console about ble init? this right? |
With classic BT enabled in menuconfig BLE just didnt start, but when i disabled it then all works, my android phone can see it.
I am using VS code and since your code is not platformio ready, i had to use command line |
ok, I will test this.
Le lun. 4 nov. 2019 à 06:57, chegewara <[email protected]> a écrit :
… With classic BT enabled in menuconfig BLE just didnt start, but when i
disabled it then all works, my android phone can see it.
This is esp-idf version i used (most recent as of today):
commit 90af68bd3c1941d9f5513bee22a12de7250208d7
Merge: 093214c 0afad4c
Author: Jiang Jiang Jian ***@***.***>
Date: Mon Oct 14 21:46:22 2019 +0800
Merge branch 'bugfix/alt_exit_idf_monitor_v3.2' into 'release/v3.2'
idf_monitor: Exit with CTRL+X in menu (v3.2)
See merge request espressif/esp-idf!6292
I am using VS code and since your code is not platformio ready, i had to
use command line make.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3436?email_source=notifications&email_token=ACTRBWZTRZ3WNFDSVU7Q4ZDQR62T7A5CNFSM4JHBAN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC6JWXY#issuecomment-549231455>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTRBW55BGNX2D2MYJNDVMDQR62T7ANCNFSM4JHBAN7Q>
.
|
Thanks for your return chegewara !
Le lun. 4 nov. 2019 à 06:57, chegewara <[email protected]> a écrit :
… With classic BT enabled in menuconfig BLE just didnt start, but when i
disabled it then all works, my android phone can see it.
This is esp-idf version i used (most recent as of today):
commit 90af68bd3c1941d9f5513bee22a12de7250208d7
Merge: 093214c 0afad4c
Author: Jiang Jiang Jian ***@***.***>
Date: Mon Oct 14 21:46:22 2019 +0800
Merge branch 'bugfix/alt_exit_idf_monitor_v3.2' into 'release/v3.2'
idf_monitor: Exit with CTRL+X in menu (v3.2)
See merge request espressif/esp-idf!6292
I am using VS code and since your code is not platformio ready, i had to
use command line make.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3436?email_source=notifications&email_token=ACTRBWZTRZ3WNFDSVU7Q4ZDQR62T7A5CNFSM4JHBAN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC6JWXY#issuecomment-549231455>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTRBW55BGNX2D2MYJNDVMDQR62T7ANCNFSM4JHBAN7Q>
.
|
@chegewara : Bluetooth classic option is disable and its not work.. I will try to compile the code with your sdk configuration. Reagards |
So, I use the esp-idf installer under windows, I install the esp-idf 3.2 release branch and launch manualy a build
So it's also not working. I am no able to analyze the monitor log. If somebody could help. Thanks |
@chegewara : Could you share with me your working project ? (with arduino component) |
I will, when i find few spare minutes. |
Thanks for your support Chegewara!
Le jeu. 7 nov. 2019 à 01:55, chegewara <[email protected]> a écrit :
… I will, when i find few spare minutes.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3436?email_source=notifications&email_token=ACTRBWZFCF6GJFCCRUNZMQ3QSNRRFA5CNFSM4JHBAN72YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDIQRKQ#issuecomment-550570154>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTRBW655VWMWVMDNQ2I67DQSNRRFANCNFSM4JHBAN7Q>
.
|
Ok, this time i had some troubles before i make it to work. Looks like last time i did it automatically:
And remember to disable Classic BT too. |
@CheGevara: Hum I did evry things, just not find why it failed evry time for me. |
Yes, this is what i did. Pull cod from your repository and tested few options in menuconfig until i was able to make it work, then i reverted BT classic options to make sure all is needed. |
In my repository there are no ESP32 Arduino core. Did you use the last available in Espressif repository? |
Yes, most recent arduino cloned. |
so, I install the esp-idf 3.2 release with esp-idf-tools-setup-2.1. I think I will give up ..:-( Last things, @chegewara could you try to run my bin on your hardware ? |
@chegewara Did you have time to try my bin?
... |
In that case i really dont know what to say if code from my repository works on my device but you still getting error.
|
@chegewara This code is a full native esp-idf function to run ble right ? Do you check my repository with this code or with the arduino code in ble_uart.cpp ? |
Yes, my repository i pasted link above is fork of your repository, just changed sdkconfig with Also I posted here BLEDevice::init() function (code above) just in case i have in my environment somehow changed library (just dont remember) so you could compare with library you have. |
ok, I will test all that. Thanks a lot! |
Any news ?? |
I dont know, any news? Last post is this:
I cant help more, because i cant reproduce your problem. |
Ohhh sorry, I forgot a comment... where is my head ?? ;-) |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
I had the same issue, took me a long time to figure it out, it's a missing "#define ARDUINO_ARCH_ESP32", which has something to do with "-DARDUINO_ARCH_ESP32" not configured correctly. |
Seems the problem is in the #ifdef CONFIG_BT_ENABLED
//overwritten in esp32-hal-bt.c
bool btInUse() __attribute__((weak));
bool btInUse(){ return false; }
#endif
void initArduino()
{
#ifdef CONFIG_APP_ROLLBACK_ENABLE
const esp_partition_t *running = esp_ota_get_running_partition();
esp_ota_img_states_t ota_state;
if (esp_ota_get_state_partition(running, &ota_state) == ESP_OK) {
if (ota_state == ESP_OTA_IMG_PENDING_VERIFY) {
if (verifyOta()) {
esp_ota_mark_app_valid_cancel_rollback();
} else {
log_e("OTA verification failed! Start rollback to the previous version ...");
esp_ota_mark_app_invalid_rollback_and_reboot();
}
}
}
#endif
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
#ifdef F_CPU
setCpuFrequencyMhz(F_CPU/1000000);
#endif
#if CONFIG_SPIRAM_SUPPORT
psramInit();
#endif
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
esp_err_t err = nvs_flash_init();
if(err == ESP_ERR_NVS_NO_FREE_PAGES){
const esp_partition_t* partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_NVS, NULL);
if (partition != NULL) {
err = esp_partition_erase_range(partition, 0, partition->size);
if(!err){
err = nvs_flash_init();
} else {
log_e("Failed to format the broken NVS partition!");
}
}
}
if(err) {
log_e("Failed to initialize NVS! Error: %u", err);
}
#ifdef CONFIG_BT_ENABLED
if(!btInUse()){
esp_bt_controller_mem_release(ESP_BT_MODE_BTDM);
}
#endif
init();
initVariant();
} I've tried to define my own The only solution I've found up to now is to call a function from |
if that would be true, then bluetooth would not work to anyone ever. Maybe it is required to init BT in setup, so make use that BT from |
For sure this is quite strange. I'm using platformIO:
I've digged inside code and haven't seen a rational explanation. Even I've tried to change the order in CMakeLists.txt of the repo. What I'm sure is that if I don't call a function from Perhaps it might be due to compiler options, or even because of |
Thank you, sir! I was completely puzzled by the init error, but what you suggested resolved the issue like magic. |
I can confirm this is still an issue in 4.4.5, thanks @miqmago for the solution! |
I have an esp-idf project with arduino as components.
I try the ble uart example. Evrything compile now.
But on serial console I have this message when I run the example:
[E][BLEDevice.cpp:356] init(): esp_bt_controller_init: rc=259 Unknown ESP_ERR error.
I found this error come from
errRc = esp_bt_controller_init(&bt_cfg); (line 354)
and in esp_bt_controller_init method, the error come from esp-idf file : components\bt\bt.c, line 1040:
I use the sdkconfig from the espressif/esp 32 arduino core and (this time) the esp-idf component is the same who was use to compile the arduino core (comit id : d3e562907).
If I test the ble example in a pure arduino project, the example work and I am able to discover the uart service on my phone
Now I dont know where to search.
Emmanuel
From France.
The text was updated successfully, but these errors were encountered: