KW40Z Update Bluetooth address from ble_controller_task.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KW40Z Update Bluetooth address from ble_controller_task.c

520 Views
lucianfiran
Contributor V

KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0); IAR 7.50


How to update Bluetooth address gBDAddress_c to value stored in gHardwareParameters.bluetooth_address

ble_controller_task.c

/* Public Device Address */
const uint8_t gBDAddress_c[6] = {BD_ADDR};


Read at start-up in board.c from FREESCALE_PROD_DATA_BASE_ADDR flash part.

NV_ReadHWParameters(&gHardwareParameters)


Flash_Adapter.h, Flash_Adapter.c

typedef PACKED_STRUCT hardwareParameters_tag
{
    uint8_t  reserved[42];             /* for backward compatibillity */
    uint8_t  ieee_802_15_4_address[8]; /* IEEE 802.15.4 MAC address   - not used  */
    uint8_t  bluetooth_address[6];     /* Bluetooth address */
    uint32_t xtalTrim;                 /* KW4x only */
    uint32_t edCalibrationOffset;      /* KW01 ED offset  - not used */
    uint32_t pllFStepOffset;           /* KW01 fine tune pll   - not used  */
    uint32_t gInternalStorageAddr;     /* The start address of the internal storage used for OTA update.
                                          A value of 0xFFFFFFFF means that the External storage is used. */   
} hardwareParameters_t;

0 Kudos
0 Replies