steps to be followed before spp_over_ble_init() function.

Can anyone suggest what steps to be followed before spp_over_ble_init() ??

I have followed following sequence, i am getting expected events from module till it goes into TCU mode after that i am not getting response for "ble_api_init();" function there is no any response on this function. please correct me if i am following wrong sequence and if not please suggest the way to get SPPOverBLE profile in use in my project. Please look into code snippet.

    GpioDataRegs.GPADAT.bit.GPIOA15 = 0;                //this is hardware reset
    SYS_DelayMs(200);
    GpioDataRegs.GPADAT.bit.GPIOA15 = 1;
    ret=hci_api_hardware_reset_handler();
    SYS_DelayMs(500);
    ret=hci_api_reset();                                                    //hci reset
    SYS_DelayMs(500);
    hci_api_open_storage_flash(0x00);                                        
    SYS_DelayMs(500);
    hci_api_set_i2_enable(0x01,0x01);
    SYS_DelayMs(500);
//    bd_addr[5] = 0x00;bd_addr[4] = 0x11;bd_addr[3] = 0x22;bd_addr[2] = // //0x33;bd_addr[1] = 0x44;//    bd_addr[0] = 0x55;
    /* byte order is reversed to what HCI controller expects */
    bd_addr[5] = 0x00;
    bd_addr[4] = 0x13;
    bd_addr[3] = 0x43;
    bd_addr[2] = 0x00;
    bd_addr[1] = 0x84;
    bd_addr[0] = 0xcd;
    ret=hci_api_write_bd_addr(&bd_addr[0]);
    ret=hci_api_read_firmware_version(version_val);
    ret=hci_api_switch_to_tcu_mode(*version_val);
    ret=ble_api_configure_bt_chip_mode(*version_val,LEGACY);
    ret=ble_api_init(*version_val);//not implementing as of now
    SYS_DelayMs(500);
    tcu_mng_init_req();

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • I am using PAN1762. not getting any response on tcu_mng_init_req();

    Like
  •     hci_api_set_i2_enable(0x01,0x01);

    Where did you get that sequence from? For PAN1762 this call is not necessary and should not be used.

        ret=hci_api_switch_to_tcu_mode(*version_val);

    Your are not checking the return codes of the function calls. Please add checks here and see if something went wrong.

    Also there are some timing constraints. The switch to TCU mode takes some time where PAN1762 is unresponsive. In all of the sample application there is a delay after this function call of at least 30ms.

        tcu_mng_init_req();

    This is a low-level function which you should not call directly.

    Only call official BLE API functions.

    Like
  • Michael Hunold said:
    Where did you get that sequence from?

     from bluetooth_sdk_4_3_0.pdf document.
     

    we are referring host mode code given in SDK
    .\BT_SDK_v_4_3_0\software\host_mode_deployment\application\profile_implementation

    Michael Hunold said:
    Your are not checking the return codes of the function calls. Please add checks here and see if something went wrong.

    not implemented as we are using debugger for checking.
     

     i have removed "hci_api_set_i2_enable(0x01,0x01);" API already and I am getting proper response for "ble_api_init()"  now. after this I have to call "spp_over_ble_profile_init();" directly??... or i have to follow some more sequence in between ble_api_init() to spp_over_ble_profile_init()??... i am getting error on "ret=spp_over_ble_profile_init();", which i am calling after ble_api_init(); ,"LE_API_ERROR", in response we are getting "0x08 0x00 0x00 0xD3 0xA7 0x01 0x00 0xA6" bytes.


    So can you suggest which steps needs to be followed after that for SPPoverBLE?
    Any further inputs will be helpful

    Like
Like Follow
  • Status Answered
  • 4 mths agoLast active
  • 3Replies
  • 43Views
  • 3 Following