ESP32 Problem with enabling BT stack

Sysprogs forums Forums VisualGDB ESP32 Problem with enabling BT stack

This topic contains 6 replies, has 2 voices, and was last updated by  Lanrets 2 years, 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9611

    Lanrets
    Participant

    Hello all,

    I have problem with enabling BT_stack for ESP32.

    When I try to call: bt_controller_init(); I get:

    Error undefined reference to bt_controller_init’

    So I added to: sdkconfig.h

    #define CONFIG_ESP32_ENABLE_STACK_BT 1
    #define CONFIG_BT_ENABLED 1

    Now I get :

    Error undefined reference to btdm_osi_funcs_register’
    Error undefined reference to btdm_controller_init’
    Error undefined reference to
    btdm_osi_funcs_register’

    Error undefined reference to `btdm_controller_init’
    Error ld returned 1 exit status  

     

    What I am missing?

     

    • This topic was modified 2 years, 9 months ago by  Lanrets.
    #9618

    support
    Keymaster

    Hi,

    Sorry about that. Looks like our BSP is missing a reference to the library that provides those functions.

    Please add the <SysGCC>\esp32\esp32-bsp\esp-idf\components\bt\lib\libbtdm_app.a file to your project manually and the Bluetooth functions should get linked properly.

    #9645

    Lanrets
    Participant

    Great! It worked 🙂 (I have edited BSP.xml and recreated project)

    So now I am able to compile and load binary into ESP32. But I get “Double Exception” when I try to call function: “btdm_controller_init(void);”

    Any idea why?

    #9646

    support
    Keymaster

    Hi,

    Have you tried setting optimization to -Og like the tutorial suggests?

    #9668

    Lanrets
    Participant

    Hey,

    Yes, I run debugger with software compiled using ‘-Og’ flag.

    #9669

    support
    Keymaster

    Hi,

    Thanks, we have rechecked this. The ESP32 Bluetooth LE support requires some extra macros to be set in your project configuration file. Please replace your sdkconfig.h file with the following one:

    Then please use the following linker script to link your Bluetooth LE code:

    #9672

    Lanrets
    Participant

    Great! It worked 🙂

    Thanks…

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.