This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2564MODA: Bluetooth Stack (Bluetopia) - Error -4 on BSC_Initialize() after HCI_RESET command

Part Number: CC2564MODA
Other Parts Discussed in Thread: MSP432E401Y, CC2564C

Good afternoon.

We are facing a few challenges trying to use Bluetopia Bluetooth stack in our project. We are using custom hardware based on MSP432E401Y MCU Rev.B and CC2564MODA Rev1.0. We are basing our tests on the SPPDemo supplied by the stack. Since the example is based on MSP432P401R, we had to update some code for our MCU. The only files we updated are:

  • Bluetopia/hcitrans/HCITrans.c
  • Platforms/MSP-EXP432P401R/HAL.c
  • Platforms/MSP-EXP432P401R/HAL.h
  • Platforms/MSP-EXP432P401R/HRDWCFG.h

The main changes were direct conversions of MSP432P401R functions to MSP432E401Y driverlib functions. We are able to communicate with the CC2564MODA via UART and send the HCI_RESET (0x01 0x03 0x0C 0x00) command using HCI Transport Layer function HCITR_COMWrite. We successfully receive a valid response from CC2564MODA which is a Command Complete Event (0x04 0x0E 0x04 0x01 0x03 0x0C 0x00). The received data is successfully stored inside the UARTContext.RxBuffer and passed to _COMDataCallback by HCITR_COMProcess. However, after we pass all seven bytes to the upper layer, the function HCITR_COMClose is called and BSC_Initialize returns BTPS_ERROR_HCI_INITIALIZATION_ERROR (-4). We confirmed that the data is sent correctly to the upper layer in the correct order and that the callback is called correctly, via dissassembly debug.

We do not understand why the stack fails to process the data and continue with the initialization procedure. We are out of ideas on how to approach this problem. We also used the CC256X_Logger for debug but it only logs data until the HCI_Reset is processed. I'll leave a screenshot of the logger and the HCITR_COMProcess and HCI UART RX ISR. The HCI UART is configured with HW Flow Control and 115200 baud rate. On the oscilloscope all the data is correctly visualized.

The is also what seems to be a strange behaviour from the stack. After _COMDataCallback is called with the last byte(s) the address to which it points changes to 0x00000000. Is this the expected behaviour. Before it was pointing to HCITR_COMDataCallback_UART (0x000047DF). Because of this, when HCITR_COMClose is called the callback is no longer called on the following lines:

/* All finished, perform the callback to let the upper layer know */
/* that this module will no longer issue data callbacks and is    */
/* completely cleaned up.                                         */
if(COMDataCallback)
   (*COMDataCallback)(HCITransportID, 0, NULL, CallbackParameter);

CC2564MODA Logger Data

HCITR_COMProcess

HCI UART RX ISR

We have other questions that can interfere on the way the stack works. We noticed that the stack comes with the file CC256XB.h from 2015. We downloaded the Service pack 1.8 that comes with the same file but dated 2017. We are using the new one but it still does not solved the issues. Are we right to assume that we should used the file CC256XB.h instead of CC256X.h for our CC2564MODA?
We also read on some forum posts that we could convert the BTS files to .H files with BHET tool but it seems to be unavailable for download. We can only subscribe to alerts.

Is it possible that we are missing any project configuration or file? We are using Code Composer Studio 10.1.1.00004 to compile and run the project.

We already spent several weeks stuck on this problem. We really need some input on your side.

Thank you very much for the support.

  • We will get back in couple of days.. In the mean time, did you try with the MSP432EVM setup, as described in the release guide? (https://www.ti.com/lit/pdf/swru497) . Please, use this setup as the reference and then port it to your custom board.

    Thanks

  • Hi Hari. Thanks for your reply.

    We already tried that setup. I noticed that the guide references the bluetooth module CC2564C. However, we are using CC2564MODA. On its page it references Bluetooth Service Pack for CC256xB, i.e., for model B and not C. Also, the stack version that I used is 4.0.3.0 (CC256XMS432BTBLESW) which is not the same as the C version 4.2.1.1 (CC2564CMSP432BTBLESW).

    Which one is right?

    Thanks.

  • Yes, you would need to use CC256XB.h. For converting BTS file to *.h file, you can use BTStranform tool, from https://www.ti.com/tool/WILINK-BT_WIFI-WIRELESS_TOOLS.

    Thanks

  • Hi Hari.

    I was using CC256XB.h that came with the service pack on the folder cc256xb_bt_sp_v1.8\CC256XB_BT_SP\v1.8\Bluetopia. With this file I produced the log previously posted.

    I also tried to convert the file initscripts-TIInit_6.7.16_bt_spec_4.1.bts to .h using the BTStransform tool. On a different post here at the forum, someone suggested to use "Data Only" and "HCI Format" configurations. I used that format and replaced the data on the BasePatch array on CC256XB.h. After doing that most of the host controller logs disappeared. Even after restoring the previous version of the file the logs are no longer ok. The stack still stops at the same place after receiving the HCI_RESET response.

    I don't understand exactly how to convert the BTS directly to *.h since there are no specific options, and the saving types are only *.c and *.*.

    Another important thing to mention is that we are not using the SPPDemo project directly. We were having many problems compiling the project on the new MCU. We used the uart_echo example for MSP432E401Y Launchpad using driverlib. We later imported the Bluetopia files to the project and are using the main() from the SPPDemo project. Is it possible that there are any missing project configurations that prevent it from working? We do not have any compilations errors at this moment.

    Thanks.

  • With regard to BTS transform - i select the below configuration:

    a) create single dimensional array b) const variables c) HCI format d) Bigarray. 

    Take the array contents into the *.h file.

    We, will review the others and get back..

    Thanks

  • Are you able to create and integrate the CC2564XB.h header file? Make sure this file is included in BTPSVEND.c. 

    Thanks