KW40Z bluetooth_address usage

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

KW40Z bluetooth_address usage

Jump to solution
1,347 Views
lucianfiran
Contributor V

 KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0); IAR 7.50;

How can be used gHardwareParameters.bluetooth_address in conjunction with gBDAddress_c ?

Flash_Adapter.c

/* Hardware parameters */
hardwareParameters_t gHardwareParameters;

ble_controller_task.c

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

Flash_Adapter.h

typedef PACKED_STRUCT hardwareParameters_tag
{
......
    uint8_t  bluetooth_address[6];     /* Bluetooth address */
......
}hardwareParameters_t;

something like making the same ROM region available from FREESCALE_PROD_DATA_BASE_ADDR ?

( last 1024Bytes of flash at the end of ROM address 0x00027C00 to 0x00027FFF )

ble_controller_task.c

  #if defined(__IAR_SYSTEMS_ICC__)
    #pragma location = "gBDAddress_ROM"
    uint8_t gBDAddress_c[6]
  #else
    uint8_t gBDAddress_c[6]  
  #endif
= {BD_ADDR};

/platform/devices/MKW40Z4/linker/iar/MKW40Z160xxx4_connectivity.icf

/platform/devices/MKW30Z4/linker/iar/MKW30Z160xxx4_connectivity.icf

place at address mem: m_hp_bluetooth_address_start { section gBDAddress_ROM };

......

define symbol m_hp_bluetooth_address_offset = 42+8;  

define symbol m_hp_bluetooth_address_start = m_fsl_prodInfo_start + m_hp_bluetooth_address_offset;

Was was the intent of this data gHardwareParameters.bluetooth_address and how should be used ?

1 Solution
1,133 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Lucian

You could use the API that is included in Flash_Adapter.c

uint32_t NV_WriteHWParameters(hardwareParameters_t *pHwParams)

so you can do the following:

FLib_MemCpy(gHardwareParameters.bluetooth_address, gBDAddress_c, 6);NV_WriteHWParameters(&gHardwareParameters);‍‍‍


Hope this information helps you
Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

1 Reply
1,134 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Lucian

You could use the API that is included in Flash_Adapter.c

uint32_t NV_WriteHWParameters(hardwareParameters_t *pHwParams)

so you can do the following:

FLib_MemCpy(gHardwareParameters.bluetooth_address, gBDAddress_c, 6);NV_WriteHWParameters(&gHardwareParameters);‍‍‍


Hope this information helps you
Have a great day,
Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------