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.

MSP430F5438A Saving LTK to flash and reusing after power reset

Other Parts Discussed in Thread: MSP430F5438A, CC2540, CC2640

Hi,

I need to save a list of client devices (say 10) that I was connected to using Bluetooth and reinitialize connection automatically after a server reset (msp430f5438A).

I think this is the LTK file but, which file do I save to flash (it's difficult to find) and where should I reinitialize it after a power reset?

Best regards,

Forrest Kimbriel

  • Hello Forrest,

    I think your question could require some clarification. So are you saying that once a client device is connected to the F5438A via Bluetooth a LTK is generated which you would then like to save to the flash in case the F5438A is reset so that communication can be restarted automatically afterwards? Are you asking what should be saved to flash or how to save it?

    At any rate you will need to save this information to an available flash info segment. However you are required to clear out the info segment first so the best practice would be to copy valuable flash segment contents to RAM, erase the flash, and then move the saved RAM contents plus the new information to the flash segment. The F5438A code examples folder provides a few examples on writing to flash.

    Are you using any TI-provided Bluetooth example projects or app notes for this design?

    Regards,
    Ryan
  • Hi Ryan,

    I'm familiar with saving to flash but, I was wondering where I can find the LTK file. Also, I'm assuming when I load from flash I should load it to the same place as well?

    Best regards,

    Forrest Kimbriel

  • Forrest,

    As this is a MSP430-specific forum I have limited knowledge on Bluetooth applications, specifically how to generate and locate a LTK file. That is why I asked if you are using any TI-provided projects, we have a Bluetooth forum that I can move this thread to if you think it would give you the proper expertise needed to solve your problem. And it would be most efficient to save under the same flash location as to not waste space.

    Regards,
    Ryan
  • Hi Ryan,
    I applogize for that, I wasn't sure which forum to post to. Yes please, if you can switch the forum that would be great.
    Best regards,Forrest Kimbriel
  • Hello Forrest,

    Are you using a TI BLE processor (e.g. CC2540 or CC2640)? If so, what operating configuration of the BLE processor (network processor, embedded application)?

    Best wishes
  • Hi,

    I'm using the CC256xQFN Bluetooth Dual Mode Evaluation Board.

    Thanks for your time.

    Best regards,

    Forrest Kimbriel

  • Hi Forrest,

    The bluetooth sample apps does not store the LTK to the flash. It needs to be implemented. You can take a look at: "DeviceInfo->LTK" in any of the sample apps.

    Regards,
    Gigi Joseph.
  • Hi Joseph,


    I've found the Device->LTK in the SPPLEDemo and if you have a moment I few more questions. When saving Device->LTK to flash I just pass the "Device->LTK" right? Also, once I reload from flash after a power cycle do I need to call the BTPSAPI GAP_LE_Event_Callback() function? If so, what parameters do I need to pass? It doesn't seem to be called anywhere if the program.


    Best regards,


    Forrest Kimbriel
  • Hi Forrest,

    I think you need to put the complete "DeviceInfo" structure and modify: "SearchDeviceInfoEntryByBD_ADDR", "DeleteDeviceInfoEntry" & "CreateNewDeviceInfoEntry" appropriately.

    Regards,
    Gigi Joseph.