Hi,
I implemented PDM_eReadDataFromRecord in my JN-AN-1218-Zigbee-3-0-Light-Bulb based project. As an example i used app_power_on_counter.c.
This is my code:
typedef struct {
uint8 u8MinDim;
uint8 u8MaxDim;
}tsMinMaxDim;
PRIVATE tsMinMaxDim sMinMaxDim;
PDM_teStatus eStatus;
uint16 u16ByteRead;
eStatus = PDM_eReadDataFromRecord(PDM_ID_APP_MIN_MAX_DIM,
&sMinMaxDim,
sizeof(tsMinMaxDim),
&u16ByteRead);
Unfortunately it results in a bus error.
What am i doing wrong?
Solved! Go to Solution.
I called PDM_eReadDataFromRecord from within DriverBulb_vInit() which is before PDM_eInitialise(63) is called and that caused the Bus Error.
Now find a way to read settings from EEPROM in DriverBulb_vInit (or prior)
I called PDM_eReadDataFromRecord from within DriverBulb_vInit() which is before PDM_eInitialise(63) is called and that caused the Bus Error.
Now find a way to read settings from EEPROM in DriverBulb_vInit (or prior)
Hi @jacco_bezemer,
Are you sure that your identifier exists?
Please call the PDM_bDoesDataExist() in order
to determine whether a record with the specified identifier exists in the EEPROM.
Regards,
Mario
Hi Mario,
Yes, the identifier exists, this is how my PDM_IDs.h looks like:
/* application ids start from 0Xa100 */
#define PDM_ID_APP_TL_ROUTER (0xA100)
#define PDM_ID_APP_SCENES_DATA (0xA101)
#define PDM_ID_OTA_DATA (0xA102)
#define PDM_ID_APP_CLD_GP_TRANS_TABLE (0xA103)
#define PDM_ID_APP_CLD_GP_SINK_PROXY_TABLE (0xA104)
#define PDM_ID_APP_REPORTS 0xA105
#define PDM_ID_POWER_ON_COUNTER 0xA106
#define PDM_ID_ZCL_ATTRIB 0xA107
#define PDM_ID_APP_NTAG_NWK 0xA108
#define PDM_ID_APP_CONVERT 0xA109
#define PDM_ID_APP_NFC_NWK_NCI 0x30
#define PDM_ID_APP_NFC_ICODE 0x31
#define PDM_ID_APP_MIN_MAX_DIM (0xA10A)
and i tried PDM_bDoesDataExist(), but it also results in a bus error.
However this:
PDM_teStatus eStatus;
eStatus = PDM_eSaveRecordData(PDM_ID_APP_MIN_MAX_DIM,
&sMinMaxDim,
sizeof(tsMinMaxDim));
DBG_vPrintf(TRACE_DRIVER, "\nDimmer: PDM_eSaveRecordData Status = %d", eStatus);
results in PDM_E_STATUS_OK.
So the record exists (i think).