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.

Can add new Z-Stack Home 1.2.1 BasicResetCB function to RST pin?

Other Parts Discussed in Thread: Z-STACK, CC2530

This BasicResetCB code in Sample Light for Z-Stack Home 1.2.0.

static void zclSampleLight_BasicResetCB( void )
{
// Put device back to factory default settings
zgWriteStartupOptions( ZG_STARTUP_SET, 3 ); // bit set both default configuration and default network

// restart device
MT_SysCommandProcessing( aProcessCmd );
}

I also add a reset button at RST pin on my CC2530. As I compare it, both perform the same function where it just restore to factory setting. This is not perform well when I try to reconnect the device to coordinator. Sometime it refuse to reconnect. Need to recycle power, then it will reconnect again to coordinator.

There is a new BasicResetCB code in Sample Light for Z-Stack Home 1.2.1 as per below.

static void zclSampleLight_BasicResetCB( void )
{
NLME_LeaveReq_t leaveReq;
// Set every field to 0
osal_memset( &leaveReq, 0, sizeof( NLME_LeaveReq_t ) );

// This will enable the device to rejoin the network after reset.
leaveReq.rejoin = TRUE;

// Set the NV startup option to force a "new" join.
zgWriteStartupOptions( ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE );

// Leave the network, and reset afterwards
if ( NLME_LeaveReq( &leaveReq ) != ZSuccess )
{
// Couldn't send out leave; prepare to reset anyway
ZDApp_LeaveReset( FALSE );
}
}

At firmware level, I wonder, is it possible to implement this code on RST pin on my CC2530? Can we add it to hal etc? How?

Thanks.