• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Bluetooth® Applications » Is there anyway not giveing pin code every time when power on my BlueMSP?
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

Is there anyway not giveing pin code every time when power on my BlueMSP?

This question is answered
shali lv
Posted by shali lv
on Feb 20 2012 19:18 PM
Intellectual320 points

I have build a ez430-bt5190 board myself and using MindTree's EtherMind Bluetooth® SDK. My board connected with a PC with bluetooth adapter. I have to enter pin code every times when my board power on. Is there any way (for example setting SDK) connecting with my PC directly without pin code needed.

ez430-rf2560 EZ430-RF2560 bluetooth
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Miguel
    Posted by Miguel
    on Feb 21 2012 08:57 AM
    Verified Answer
    Verified by shali lv
    Genius11565 points

    Shali,

    Please refer to this thread.

    Regards,

    Miguel

    pairing link key
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • shali lv
    Posted by shali lv
    on Feb 21 2012 09:50 AM
    Intellectual320 points

    Thanks Miguel, That is just what I needed program. I would try it to see if it works well.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • shali lv
    Posted by shali lv
    on Feb 21 2012 22:53 PM
    Intellectual320 points

    Hi, Miguel

    I have tried that program according to your thread, I changed sm_storage_pl.c and appl_sdk.c, but it seems have some problem. First all, the statement appl_sdk_display_status(STATUS_BLUETOOTH_ON); could not pass compile. and if I shield this statement, It can pass compiltion but my board could not be found by other blue tooth device. I have not read this program in detail but I set a breakpoint at if(1== v_dev_info){...} in void appl_sm_reconnect() in appl_sdk.c and found that this condition is never established. that is to say reconnection is failed. Please let me know how I modify them and let it work well.

    Thanks

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • srisenthilkumar chandrasekaran
    Posted by srisenthilkumar chandrasekaran
    on Feb 27 2012 00:02 AM
    Intellectual425 points

    Hi Shali,

    1. We have given sample code that refers temperature application so that "appl_sdk_display_status(STATUS_BLUETOOTH_ON);" statements are available in auto reconnect sample code.  we are suggesting you to add only

    appl_sm_reconnect(); /* ------> Newly added */   function call in the end of appl_bluetooth_on_complete_event_handler(void) function definition.

    2. if(1== v_dev_info){...}

    Please check in your code, Have you replaced the following line( in sm_storage_pl.c), "#define SM_STORAGE_START_ADDR 0x4C00"  with  #define SM_STORAGE_START_ADDR 0x1800  ?  

    • Note : (Here 0x1800 is the flash info memory and 0x4c00 is the ram memory). Please put a break point in “v_dev_info = *(sm_temp_ptr);” while reconnection, and check the value of v_dev_info variable.

    Thanks

    Senthil.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • shali lv
    Posted by shali lv
    on Feb 27 2012 23:46 PM
    Intellectual320 points

    Hi,

           I have tried my program according to you advice(select flash memory 0x1800, change sm_ps_write(), call appl_sm_reconnect();  at the end of appl_bluetooth_on_complete_event_handler(void) ). and I found that function call appl_sm_reconnect(); often led my program into sdk_error_handler(); So I just skip this function call and my program work well, that is to say: my board can reconnect with PC without need pin code even if power off and power on again.  Can I just use my board this way? Mybe there are some disadvantages, astable etc. would you mind tell me the result.

    sincerely yours

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • srisenthilkumar chandrasekaran
    Posted by srisenthilkumar chandrasekaran
    on Feb 28 2012 06:58 AM
    Intellectual425 points

    Hi Shali,

            appl_sm_reconnect() function is required to establish the reconnection, I think in your case PC is trying to re-connect with your board based the previous paired information.

          Could you please give us the call stack information once it is enter into "sdk_error_handler" function. Normally there is no relation between "appl_sm_reconnect()" function  and  "sdk_error_handler()" function. 

    sm_ps_write() -> it saves the paired information into flash. appl_sm_reconnect() -> establish the reconnection based on the pairing information from flash.

     

    Regards

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • shali lv
    Posted by shali lv
    on Feb 28 2012 22:39 PM
    Intellectual320 points

    Hi, srisenthilkumar chandrasekaran

           the call stack is like this when it into "sdk_error_handler"

    CALL STACK:
    sdk_error_handler()
    hci_command_complete_event_handler(?)
    sdk_hci_event_indication_callback(?,?,?)
    hci_transport_read_data()
    ht_read_task_start_routine()
    [PC=Memory:0x2AB6]

    the steps that my program into "sdk_error_handler" are:

    >download and debug
    >go
    connect to PC and trasformation data through a  virtual serial port
    >break
    >reset
    >go
    enter sdk_error_handler()
    from then on program always enters sdk_error_handler() ,LED1 and LED2 blink synchronously.

    And I also found that my board connects with one other bluetooth device normally(without pin code needed)
    if I skip appl_sm_reconnect(), even if I power off my board and then power on it again.
    But my board will changes when I connect it to more than one other bluetooth, Pin code will be required everytime
    while power on my board, even if I connect it to the device last time it connected(paired).

      void appl_sm_reconnect()
      {
        API_RESULT retval;
        UCHAR *sm_temp_ptr;
        UCHAR dev_bd_addr[6];
        UCHAR v_dev_info;
        sm_temp_ptr =(unsigned char*) 0x1815;
        v_dev_info = *(sm_temp_ptr);
        if(1== v_dev_info){
          sm_temp_ptr++;
          for(int i=0;i<=5;i++){
          dev_bd_addr[i] = *sm_temp_ptr;
          sm_temp_ptr++;
          }
          BT_mem_copy(sdk_status[0].peer_bd_addr,dev_bd_addr, BT_BD_ADDR_SIZE);
          retval= BT_hci_create_connection(dev_bd_addr, SDK_CONFIG_ACL_PKT_TYPE, rem_bt_dev[0].
                                           page_scan_rep_mode, 0,
                                           rem_bt_dev[0].clock_offset,
                                           0x01);
          /* If already connected */
          if (HCI_STATE_ALREADY_CONNECTED == retval) {
            /* Initiate SDP Query */
            appl_spp_sdp_query(0);
            SDK_SPP_CHANGE_STATE(0, SDK_IN_SDP_QUERY);
          } else if (API_SUCCESS == retval) {
            /* On Success */
            SDK_SPP_CHANGE_STATE(0, SDK_IN_ACL_CONNECTION);
          } else {
            sdk_display((const UCHAR *)"SM device does not exist\n");
          }
        }else{
          printf("Device info does not exist..So,Initiate the new connection\n");
        }
      }

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • srisenthilkumar chandrasekaran
    Posted by srisenthilkumar chandrasekaran
    on Mar 02 2012 03:11 AM
    Intellectual425 points

    Hi Shali,

       Thanks for your reply. Today I have tested auto reconnect with EZ430 board.

     

    Please comment out the below code in appl_cb.c file (last 4 lines in hci_command_complete_event_handler() function)

    //    if (0x00 != status) {
    //        sdk_error_code = SDK_WRONG_EVENT_RECEIVED;
    //        sdk_error_handler();
    //    }
     

     Test condition:

    >download and debug
    >go
    connect to PC and trasformation data through a virtual serial port
    >break
    >reset
    >go

    >close the old terminal(ex.putty)
    >reopen the terminal for same port.

    Please check the same in your end and let me know the feedback.

     

    Regards,


     

     

               

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • shali lv
    Posted by shali lv
    on Mar 03 2012 09:28 AM
    Intellectual320 points

    Hi, 

    It seems work well according to your advice of commenting out those three instructions. But I still find that my board somehow straped into sdk_error_handler() by other ways. I have two MID devices with bluetooth funcion, my board always traped into sdk_error_handler() when It connects with them. The call stack like this:

    CALL STACK:
    sdk_error_handler()
    BT_alloc_mem()
    BT_rfcomm_write()
    BT_spp_send()
    user_task_routine
    [DATA16_HEAP_SIZE+0]

    sdk_error_handler()
    BT_alloc_mem()
    rfcomm_transmit_data()
    rfcomm_write_bh()
    wt_service_queue()
    write_task_start_routine()
    [PC=Memory:0x2AB6]

    sdk_error_handler()
    BT_alloc_mem()
    rfcomm_common_appi_handler()
    BT_rfcomm_write()
    BT_spp_send()
    user_task_routine()
    [PC=Memory:0x0]

    But my board works well with my PC and notebook computer. Are those two MID failed? No, they work well with other bluetooth modul. When will the program enter sdk_error_handler()?  and what should we do to avoid my program traped into sdk_error_handler() ?

     

    Regards

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use