Closed iloop2020 closed 2 years ago
Hi @iloop2020, this looks similar to https://github.com/espressif/esp-idf/issues/5423#issuecomment-644560431. What is the version of the toolchain that you are using? You can check it by running xtensa-esp32-elf-gcc --version
.
From the IDF commit ID you have provided, it seems that you might be using esp-2020r2 toolchain.
If this is the case, then you will need to:
install.sh
in esp-idf directory to install the new toolchain. ./export.sh
to update the environment variablesHi @igrr
Thank you for your support !!
I am using xtensa-esp32-elf-gcc (crosstool-NG esp-2019r2) 8.2.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Should I update it ? Thank you
Yes, I recommend following the instructions above to update ESP-IDF to v4.1.1 and the toolchain to esp-2020r3.
But after we update to stable v4.1.1, xtensa-esp32-elf-gcc (crosstool-NG esp-2020r3) 8.4.0,
can we still compare idf at 9778b16 ?
The reason we want to keep idf version, because
Please help, thank you.
Do I understand correctly that you want to keep IDF version 9778b16, rather than v4.1.1? I'm not sure why you say that v4.1.1 is a bit old. It has been released on 29 January 2021. Whereas commit 9778b16 is dated 5 May 2020. So the commit you are using right now is actually older than v4.1.1.
Yes, you are right, v.4.1.1 is newer.
And how can we fix "iram0_0_seg' overflowed " issue ?
Thank you.
Regarding IRAM overflow, could you please attach your project map file (found in the build directory) and your sdkconfig file? Most likely there are some options which can be changed in menuconfig to reduce IRAM usage.
Hi @igrr
Thank you for your suggestion, and we change Compiler options -> Assertion level to Silent, then can bypass the IRAM overflow issue.
But the pub_free issue seems still there, and I cannot 100% sure because the crash log does not show line number .
Question: Would you please help to check which config increase the IRAM usage , between 9778b16 to v4.1.1, It is because I want to change back the Assertion level to Enable for debugging.
Thank you very much.
Hi @igrr
Seems libbtdm_app.a consume a lot of IRAM(Is it the 3rd column, which is 27410 bytes ?
Thank you.
Hi @igrr
Any good news ?
Thank you
@iloop2020 sorry for not giving you any feedback on the libbtdm_app issue. I'll have to pass the issue to my colleagues working on Bluetooth. @Alvin1Zhang please help follow.
Hi @iloop2020 , I looked into the difference made to the Bluetooth library file libbtdm_app.a between the two IDF version 9778b16 and v4.1.1, and found that the difference is resulted from a bunch of bug fixes. In fact, the year 2020 observes a good amount of bug fixes for Bluetooth Controller on ESP32. The use of IRAM is contributed by the patches for Bluetooth Controller ROM code. The use of IRAM increases gradually as more bugs are found and patches are applied.
I don't find an easy way to shrink these IRAM cost, we need to go through each updates in Bluetooth Controller whether the patches can be eliminated or there can be other ways of fixing the issues. This take a time, and according to my evaluation, not much memory can be saved. So can can you try reducing IRAM usage in other ways?
Hi @wmy-espressif ,
Thank you for your support.
Thank you
Hi @iloop2020 , For Issue 2 about the AVRCP initialization, you need to change the initialization order of A2DP and AVRCP: AVRCP first and then A2DP. Inside Bluedroid, AVRCP is dependent on A2DP and cannot be used in separate from A2DP. When doing A2DP lower stack initialization, AVRCP requirement is checked.
For Issue 1, As far as I know there are some Wi-Fi Kconfig options that can be disabled to save some IRAM, e.g. CONFIG_ESP32_WIFI_IRAM_OPT, CONFIG_ESP32_WIFI_RX_IRAM_OPT, but will lead to some performance degradations. You can check their usage.
Hi @wmy-espressif ,
Thank you.
@iloop2020 , For the initialization A2DP and AVRCP in ADF's bluetooth service library, I have to pass the issue to my collegues.
My responsibility concerntrates on Bluetooth Part, and for current stage the IRAM use in the patches of libbtdm_app.a is not able to be reduced. You need to try to save IRAM from other modules and I am not sure how much I can help. I'd like to ask what hardware or software modules are being used in your project?
Hi @wmy-espressif ,
Do we have any update from your colleges ?
New question: How can we stop/disconnect or disable the blueooth if we want to switch to local SD playback ? Currently, it we are not able to stop the AD2P, so actually playing MP3 in SD card and receiving bluetooth streaming at the same time, the result is overload the ESP32.
Any suggestion ? Thank you,
Hi @iloop2020, to re-order the initialization of A2DP adn AVRCP in ADF's bluetooth service module, you have do modifiocations on the source file in ADF: components/bluetooth_service/bluetooth_service.c. My collegue doesn't tell their plan to fix the issue, so you may need to do the modification yourself if in a hurry.
For your new question, you can disconnect A2DP connection using the API esp_a2d_sink_disconnect
Hi @wmy-espressif
Thank you for your suggestion !
For esp_a2d_sink_disconnect() API, if our application call them directly, will it confuse the ADF bluetooth_service ? And how can we resume the Bluetooth A2DP ?
Thank you
Hi @iloop2020,
In ADF bluetooth_service, there are periph_bluetooth_xxx
APIs, which use AVRC commands to control the A2DP stream. You can learn about these APIs in bluetooth_service.h, and the example examples/player/pipeline_bt_sink
show the demo of some APIs.
Thanks!
@iloop2020 Thanks for reporting, would you please help share if any updates for the issue? Thanks.
Thanks for reporting, will close due to short of feedback, feel free to reopen.
Hi,
We see assertion at firmware/esp-idf/components/lwip/lwip/src/core/pbuf.c line 757, function: pbuf_free
Info: git commit 9778b163b174b1e4702cf354e9a26d98c511fd6c
I happen randomly , How can we fix it ?
Thank you.