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.

MAC_ASSERT occur

Hi Friends,

I have followed the zstack OTA upgrade user's guide.pdf to adding a OTA client functionality to SampleApp application.

I have faced assertion during this process.(All LED are blinking continuously). 

I am debugging the process and find the place where the code enter into assertion.

MAC_INTERNAL_API void macRadioStartScan(uint8 scanMode)
{


MAC_ASSERT(macSleepState == MAC_SLEEP_STATE_AWAKE); /* radio must be awake */
MAC_ASSERT(macRxFilter == RX_FILTER_OFF); /* all filtering must be off to start scan */

/* set the receive filter based on the selected scan mode */
if (scanMode == MAC_SCAN_ED)
{
macRxFilter = RX_FILTER_ALL;
}
else if (scanMode == MAC_SCAN_ORPHAN)
{
macRxFilter = RX_FILTER_NON_COMMAND_FRAMES;
}
else
{
MAC_ASSERT((scanMode == MAC_SCAN_ACTIVE) || (scanMode == MAC_SCAN_PASSIVE)); /* invalid scan type */
macRxFilter = RX_FILTER_NON_BEACON_FRAMES;

/* for active and passive scans, per spec the pan ID must be 0xFFFF */
MAC_RADIO_SET_PAN_ID(0xFFFF);
}
}

 

The above code executed first time and macRxFilter set to 0x02 because else case is processed.

Next time , Assertion occur at  MAC_ASSERT(macRxFilter == RX_FILTER_OFF) function.(Instead of macRxFilter = 0X00 it has value of 0X02)

Please guide me to resolve this problem.

 

Platform           : Experimental board ( MSP-EXP5438 )

Zstack version : ZStack-EXP5438-2.5.1

IAR version     :  IAR version is 5.60.6. 

Regards,

Keerthi G.

  • Hi Keerthi,

    Did it happen when you initiate a scanning for the first time? It seems that a scanning job had already been running by the time another scanning was tried to be initiated. How do you initiate a scanning?

    Can you set a break points at macRadioStartScan() and macRadioStopScan() to see if macRadioStartScan() is followed by macRadioStopScan() every time?

    - Cetri