hci_open(): init error (0x4021c00)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
cvanbeek
Level 3
Level 3
25 sign-ins 10 replies posted 10 sign-ins

Hello Infineon Support,

Apologies, I originally posted about this issue here, but I was taken off the project before I was able to test it out.  I'm back on now and I'm still getting this error after the BLE stack is initialized:

hci_open(): init error (0x4021c00)

The old post wouldn't let me reply so I'm adding some information here.

First off, I can confirm that I have the most up-to-date version of the BSP and libraries available, so that is not the issue.

Second, I'm using the Bluetooth_LE_CapSense_Buttons_and_Slider project as a baseline, and when I run that project, it works as expected and I do not get the HCI error. 

For my project, I copied in the ble_task files and the design.cybt file, so my setup should be the same for all the bluetooth libraries and functions.  I confirmed that my Makefile has the FREERTOS and WICED_BLE components added to it.

There's two other notable differences between my project and the original capsense project:

  • My project is a dual core project, with a smaller app running on CM0P
  • My project has some WiFi libraries it is using

Could either of those differences cause contention issues with the HCI hardware?  I've tried all sorts of things to get this running but cannot shake this error message.

Best regards,

Cory

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @cvanbeek ,

While looking through the code, the error is coming from UART initialization failure cyhal_uart_init() in cybt_platform_freertos.c that is part of bluetooth-freertos library.


The error code you are seeing "0x4021c00" is simply the error code from the UART HAL layer. You can decode this error code using the cy_rslt_decode_t helper function. Usage is also provided in the document below:
https://infineon.github.io/mtb-hal-cat1/html/group__group__result.html

For example, your error means the following :
Type = 0x02 -> CY_RSLT_TYPE_ERROR
Module = 0x100 () -> CY_RSLT_MODULE_ABSTRACTION_HAL
Submodule = 0x1C -> CYHAL_RSLT_MODULE_UART
Error = 00 -> CYHAL_UART_RSLT_ERR_INVALID_PIN

This is most likely because you have used some other peripheral for P3.0 to P3.3 that is designated for BT UART pins or you have reserved SCB2 for some other SCB functionality such as I2C/ SPI. Either of this could cause this error to occur.  

Regards,
Bragadeesh

View solution in original post

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @cvanbeek ,

Thanks for creating a new thread. We had to close this thread due to inactivity for a long time.

Would you be able to share a stripped down version of the project that replicates this issue? We would like to review the changes in your project to find the issue.

Regards,
Bragadeesh
0 Likes
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @cvanbeek ,

While looking through the code, the error is coming from UART initialization failure cyhal_uart_init() in cybt_platform_freertos.c that is part of bluetooth-freertos library.


The error code you are seeing "0x4021c00" is simply the error code from the UART HAL layer. You can decode this error code using the cy_rslt_decode_t helper function. Usage is also provided in the document below:
https://infineon.github.io/mtb-hal-cat1/html/group__group__result.html

For example, your error means the following :
Type = 0x02 -> CY_RSLT_TYPE_ERROR
Module = 0x100 () -> CY_RSLT_MODULE_ABSTRACTION_HAL
Submodule = 0x1C -> CYHAL_RSLT_MODULE_UART
Error = 00 -> CYHAL_UART_RSLT_ERR_INVALID_PIN

This is most likely because you have used some other peripheral for P3.0 to P3.3 that is designated for BT UART pins or you have reserved SCB2 for some other SCB functionality such as I2C/ SPI. Either of this could cause this error to occur.  

Regards,
Bragadeesh
0 Likes

Hi Bragadeesh,

You are correct, I was using P9.0 and P9.1 for I2C on the CM0P core, which was also on SCB2.  I've moved the I2C bus to SCB 3 and now it is working correctly.

Thank you,

Cory

0 Likes