Part Number: CC2652R
The fix in the osal_nv_write function has errors that make it impossible to compile.
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.
Part Number: CC2652R
The fix in the osal_nv_write function has errors that make it impossible to compile.
Do you see link error "undefined symbol restoreInProgress_NLME"? If so, you can refer to Toby's reply in
to patch zd_app.c to fix it.
Hi,
Please specify which compile errors you see.
Regards,
Toby
There are two errors prompted after compilation。
Error[Pe117]: non-void function "osal_nv_write" should return a value
Error[Pe852]: expression must be a pointer to a complete object type
Do I make the following changes?
// Fix added
#include "aps_groups.h"
extern uint8_t restoreInProgress_NLME;
extern apsGroupItem_t *apsGroupTable;
struct apsGroupNVItem {
uint8_t endpoint;
aps_Group_t group;
};
apsGroupItem_t *pLoop = apsGroupTable;
struct apsGroupNVItem item;
if (id == ZCD_NV_GROUP_TABLE)
{
if (restoreInProgress_NLME)
return NV_OPER_FAILED; // don't write to NV group table while a restore is in progress
// write correctly to NV group table
uint16_t i = 0;
while ( pLoop )
{
// Build the record
item.endpoint = pLoop->endpoint;
OsalPort_memcpy( &(item.group), &(pLoop->group), sizeof ( aps_Group_t ) );
OsalPort_memcpy((uint8_t *)buf + (uint16_t)((sizeof(uint16_t)) + (i * sizeof ( struct apsGroupNVItem ))), &item, sizeof ( struct apsGroupNVItem ));
pLoop = pLoop->next;
i += 1;
}
}
// End of fix
I suppose you remove the last line "return ( osal_nv_write_ex( ZCD_NV_EX_LEGACY, id, ndx, len, buf ) );" in osal_nv_write function when you do patch. You can add it back to fix the problem.