KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0) IAR 7.50
In Flash_Adapter.h there is a structure 576bytes (4*32+6*8+8*8+42*8):
typedef PACKED_STRUCT hardwareParameters_tag
{
uint8_t reserved[42]; /* for backward compatibility */
uint8_t ieee_802_15_4_address[8]; /* IEEE 802.15.4 MAC address */
uint8_t bluetooth_address[6]; /* Bluetooth address */
uint32_t xtalTrim; /* KW4x only */
uint32_t edCalibrationOffset; /* KW01 ED offset */
uint32_t pllFStepOffset; /* KW01 fine tune pll */
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;
Initialized at start ApplMain.c and in hardware_init.c
hardware_init() { ....
NV_ReadHWParameters(&gHardwareParameters);
void main_task(uint32_t param) { ....
/* Initialize NV module */
NV_Init();
Used for KW3xXcvrDrv.c (KW4xXcvrDrv.c)
void XcvrInit ( radio_mode_t radioMode )
{
XcvrInit_ModeChg_Common(radioMode,FIRST_INIT);
#ifdef gXcvrXtalTrimEnabled_d
if( 0xFFFFFFFF != gHardwareParameters.xtalTrim )
{
XcvrSetXtalTrim( (uint8_t)gHardwareParameters.xtalTrim );
}
#endif
}
Used for OtaSupport.c
otaResult_t OTA_InitExternalMemory(void) {....
/* Update the offset to the internal storage if necessary */
NV_ReadHWParameters(&gHardwareParameters);
if( gHardwareParameters.gInternalStorageAddr != gEepromParams_StartOffset_c )
{
gHardwareParameters.gInternalStorageAddr = gEepromParams_StartOffset_c;
NV_WriteHWParameters(&gHardwareParameters);
}
MKW30Z4_features.h
#define FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE (1024)
Why this hardwareParameters structure is dimensioned and set like this ?
Does bluetooth_address[6] has a specific value ?
Can the structure be changed by removing ieee_802_15_4_address, edCalibrationOffset, pllFStepOffset and adding new data in the reserved zone ?
Best Regards,
Lucian