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.

Bluetopia--unable to initialize stack

Other Parts Discussed in Thread: MSP430F5529

I've ported the Bluetopia Bluetooth stack to a project board.  I've based my port on the SPP demos provided with the SDK.  When my code calls the function BSC_Initialize, the return value is -14.  Looking at the BluetopiaCoreAPI.pdf document, I don't see a corresponding error code for this result.


Can someone help?

Thanks.

  • Hi Brent,

    The error you are facing is “BTPS_ERROR_HCI_DRIVER_ERROR(-14)”. Which is defined in “CC256x MSP430 Bluetopia SDK\v1.4\MSP430_Experimentor\Bluetopia\include\BTErrors.h” file.

    This seems to be like a UART interface problem. Please make sure that you have taken care of all the changes mentioned in the “CC256x MSP430 Bluetopia SDK\v1.4\Documentation\Hardware Porting Guidelines.pdf” as per your project board.

  • Thanks for the response.  I've looked through the Hardware Porting Guidelines and I believe I've got everything covered.

    Something that came up while I was stepping through code that I did not expect:  Comments in the Bluetopia code state that variables declared as static are initialized to zero automatically by the compiler as part of standard C/C++.  While debugging I'm definitely seeing this is not the case.  (HCITransportOpen for example was a random non-zero value causing a premature failure within the function HCITR_COMOpen.)  Is there a compiler option I need to select to enforce this rule?


    Thanks,

    Brent

  • Brent Huebert said:

    Something that came up while I was stepping through code that I did not expect:  Comments in the Bluetopia code state that variables declared as static are initialized to zero automatically by the compiler as part of standard C/C++.  While debugging I'm definitely seeing this is not the case.  (HCITransportOpen for example was a random non-zero value causing a premature failure within the function HCITR_COMOpen.)  Is there a compiler option I need to select to enforce this rule?

    Brent,

    The MSP430 Optimizing C/C++ Compiler User's Guide discusses how the compiler behaves, presuming you are using CCS and the TI code generation tools.  Specifically, Section 6.8.3 will be of use for this description.  The COFF ABI C compiler does not perform any preinitialization of uninitialized variables.  The application is responsible for explicitly initializing any variable that is assumed to be 0.

    In EABI mode, the compiler does automatically initialize to 0 uninitialized variables.

  • Hello,

    We will provide library in EABI format in the next releases.

    rregards,

    Miguel

  • Thanks for the replies.


    Yes, I'm using CCS--version 4.  Couple more questions:

    1)  How do I switch to EABI mode?

    2)  Is EABI mode compatible with the Bluetopia libraries?  (Miguel's answer almost suggested that it is not. In which case I guess I don't need to know how to switch to EABI mode in CCSV4.)


    Thank you,

    Brent

  • Brent,

    Yes, you will need the new library in EABI format.

    Miguel

  • Hi Miguel,

    I am also facing similar problem.I am trying to use CC256xQFN-EM  with MSP-EXP430F5529  dev board.

    Unfortunately I am getting the error BTPS_ERROR_HCI_INITIALIZATION_ERROR thrown from BSC_Initialize() library function. I am using "SPPLEDEMO Lite APP" IAR project without any modifications.

    Got to know that its related to UART initialization problem, but there is no specific solution found on E2E forum. 

    What could be the possible solution for this?

  • Hi Chethu,

    Could you make sure that you have the correct HW configuration?

    http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_Demo_APPS#MSP430F5529_Experimenter.E2.80.99s_Board

    Also, which CC256xQFN-EM version are you using? if you have 1.2B, you need to define " __SUPPORT_CC256XB_PATCH__" in the project settings.

    Regards,

    Miguel

  • Hi Miguel,

    Miguel said:
    you need to define " __SUPPORT_CC256XB_PATCH__" in the project settings.

    Thanks, it worked for me.

    Now I am planning to have HFP running on this setup(CC256X + MSP-EXP430F5529), But most of the threads on E2E show that it can't be done on 5529.. Is it possible to run HFP on MSP430F5529? 

  • Brent Huebert said:

    1)  How do I switch to EABI mode?

    Check out this wiki article.  It is not related to the issues you are having, however, it does have a picture of how to change to EABI mode.

    You will need to adjust the Project build options.  In the General tabl, you should see Output format.  This is the field to modify.

  • BrandonAzbell said:

    1)  How do I switch to EABI mode?

    Check out this wiki article.  It is not related to the issues you are having, however, it does have a picture of how to change to EABI mode.

    You will need to adjust the Project build options.  In the General tabl, you should see Output format.  This is the field to modify.

    [/quote]

    Okay, I'm using CCSV4 with Code Generation tool v3.3.1 so it doesn't look like I have EABI mode available to me.  In the end, I guess it doesn't matter as the current version of the Bluetopia libraries are not compatible with EABI mode anyway.

  • Chethu,

    There should not be any issue to run HFP in the F5529. Just be aware that you need an external CODEC (ADC/DAC).

    Miguel

  • Hey guys,

    I'm still dealing with this issue in CCSV4 where I can not initialize the Bluetopia stack.  The problem seems to be related to static variables not being initialized to zero at bootup.  While EABI mode would accomplish the assignments to zero, it is not useful to me because:

    1)  CCSV4 does not have EABI mode

    2)  the Bluetopia stack does not support EABI mode

    I've tried going to the processor command file and altering the bss section to:

        .bss       : {} > RAM, fill = 0x00   /* GLOBAL & STATIC VARS              */


    This lets the stack initialize when I'm running my system with the emulator; but it will not when the system is running on its own. 

    How is everyone else accomplishing it?  Is there something inherent to CCSV5 that accomplishes the loading of the static variables with zero created within the Bluetopia stack?

  • Hi,

    Please refer to the below links for EABI on CCSV4. I think it should answer your quesition 

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/155668.aspx

    http://e2e.ti.com/support/low_power_rf/f/660/t/296976.aspx

    As I understand from the above posts for Bluetopia to run with EABI, you will need the new library in EABI format.

    and it will be part of the new release.

  • Looks like altering the command file as I pointed out above specifically only assigns zeros to the variables at load time and not at system reset or power up.  That matches with what I see happening.  So I still need to figure out how everyone else is getting their systems to take care of this automatically.

  • Hi Sundeep,
    Yeah, we've determined EABI mode is not the answer. 

    The issue is: for the Bluetopia stack to initialize, it relies on static variables and such to be initialized to zero at system reset/power up.  EABI mode was suggested as it does this; but it won't work for this version of the Bluetopia library.

    I had some luck with initialization by altering the command file; but this only works when I load my program for the first time, not after a system reset or power up.  Not very practical for a product.

    Not sure how the Bluetopia examples are doing this; but this initialization to zero is not happening in my project.  And because it does not happen, I am unable to open the Bluetooth stack.

    Brent

  • Hi Brent,

    You are saying that, It is only working when you load  program, and after the system restart  It does not work.

    Does this mean that the you were not able to initialize the stack? Because after we load the program from the CCS, to use the profile we disconnect and reconnect the board.

    see below

    http://processors.wiki.ti.com/index.php/CC256x_MSP430_Bluetopia_Basic_Demo_APPS#CCS_2

    are you seeing the below in your tera term

    OpenStack().
    Bluetooth Stack ID: 1.
    Device Chipset: 4.0.
    BD_ADDR: 0xB8FFFEA97E17

    ******************************************************************
    * Command Options General:

    Is it possible for you to try with Code Composer Studio 5 and see if it helps?

  • Hi Sundeep,

    Thanks for following my thread this morning.  I think I need to re-establish what's happening.

    1)  SPPDemo, SPPLEDemo and SPPLEDemo_Lite all work and open the stack as intended.

    2)  I've based my own project on the SPPLEDemo_Lite; but note I did not start with that project and modify it for my own.  I constructed my own project and brought in the Bluetopia stack.

    3)  In MY project I am not able to successfully initialize/open the stack UNLESS I have the following in the cmd file:

    .bss       : {} > RAM, fill = 0x00

    This line allows for the stack to be opened only after an emulator loads the program.  After subsequent system resets or reboots the stack will not initialize.  To get it to initialize again, I have to reload the program.  (The compiler manual verifies why this is the case.)  The root of the problem is that the stack relies on static variables to be initialized to zero at system power up.  This is not happening in my project.  (Which is why EABI mode was suggested.  But as you know, is not compatible with the current version of the stack.)

    4)  I have moved my project to CCSV5 and unfortunately I'm having the same issue.

    Somehow the demo projects are able to force all unassigned variables to zero whereas I have not been able to do so.

  • I think I see what may be going on:

    _system_pre_init

    Need to look a little closer.

  • Hi Brent,

    I am running into the same issue. Can you explain how you changed system_pre_init to fix your issue?

  • Hi Mark,

    It's been a while since I ran into this; but I think it was a matter of simply including the file pre_init.c into my project.

    For me, no changes to the function _system_pre_init were required.  I used it as is.  I tend not to make changes to the cmd files which may have helped me here.

    I hope this helps.

    Brent