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.

CC2564: Bluetopia porting issues when at intialization with uCOS-II

Part Number: CC2564

Hi, I am currently working with the Bluetooth device and porting the bluetopia stack from FreeRTOS to uCOS-II

I made the SPPdemo run with FreeRTOS with an STM32 (Cortex M4) series evaluation board.

Now when that I have the files BTPSKRNL.c and HCITRANS.c modified for uCOS-II for the same evaluation board, I have been trying to get it running but I came to a point where it returns a -4  (Stack Init Failed: -4) when it tries to initialize.

After some debugging I see that it does create 3 tasks but at the end it calls the HCITR_COMClose() and fails to continue OpenStack() successfully. 

Can someone have any hints of what may be causing to call HCITR_COMClose() ? or explain the sequence of the events that it could be waiting on? I have been trying to see if its related to the ISR or with the other OS feature that could be incorrectly hooked to the Bluetooth APIs but I am not sure.

Thanks

  • Everardo,

    Exactly which API returns the -4 error? Is it the BSC_Initialize()?

    The error code -4 refers to the BTPS_ERROR_HCI_INITIALIZATION_ERROR (defined in BTErrors.h). This error indicates that the stack was not able to open the HCI UART port.

    There could be various different reasons for this. Are you positive that the modifications in the BTPSKRNL.c and HCITRANS.c are done correctly?

    Best regards,
    Vihang

  • Hi, yes the API is BSC_Initialize(), as you mention I did notice that its related to the HCI UART port.
    The modification to btpskrnl and hcitrans look to me that they are ok, but this is where I am having doubts what could be wrong.
    I know that it does create threads, creates mutexes, creates events, creates mailboxes and delays . But since I have not been able to get it running I can not say that I am 100% positive that those APIs are being handled as expected by the Bluetopia stack
  • I found my issue a some weeks ago, there was a bug in my BTPSKRNL.c in the "events" handling (needed to be a one to many). Thanks