<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: List_RemoveHead goes into infinite loop in simple 802.15.4 app in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151579#M8298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There should not be any special modifications needed for the indication.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I will check up on the documentation, which codebase are you using ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please note the latest beekit installer is 1.7.0 and latest mac codebase is 1.0.3.&lt;/DIV&gt;&lt;DIV&gt;You might have an older version of the reference manual.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Br,&lt;/DIV&gt;&lt;DIV&gt;Mads&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 May 2008 17:22:41 GMT</pubDate>
    <dc:creator>Mads</dc:creator>
    <dc:date>2008-05-01T17:22:41Z</dc:date>
    <item>
      <title>List_RemoveHead goes into infinite loop in simple 802.15.4 app</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151576#M8295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm moving from an old version of the 802.15.4 MAC library (1.063) to the most recent in the BeeStack. I've coded a simple transmit test that continuously sends a short broadcast message (1 at a time). The app is based on MyWirelessApp framework project. Strangely, after around 76 packets sent, the application hangs by infinitely calling Default_Dummy_ISR().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the call stack:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;- Default_Dummy_ISR()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- List_RemoveHeade (pAnchor=0x43f)&amp;nbsp; (always the same address)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Mlme_Main (events=2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- TS_Scheduler()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- MemCtrlNonBCoord&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the hardware:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- MC13213&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Custom PCB with mappings updated in PortConfig.h&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Working with legacy 802.15.4 lib version 1.063&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm suspecting from kind of memory allocation problem but can't figure it out. I've adjusted the pool size without results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my MApp.c code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;/***************************************************************************** * MyWirelessApp Demo Framework * * (c) Copyright 2008, Freescale, Inc. All rights reserved. * * * No part of this document must be reproduced in any form - including copied, * transcribed, printed or by any electronic means - without specific written * permission from Freescale Semiconductor. * *****************************************************************************/#include "MApp.h"#include "NVM_Interface.h"/************************************************************************************ ************************************************************************************* * Private macros ************************************************************************************* ************************************************************************************/#define CHANNEL_MAX 26#define CHANNEL_MIN 11/** Maximum size in bytes of a packet's data unit. */#define MAX_MSDU_SIZE 10 //102/************************************************************************************ ************************************************************************************* * Private prototypes ************************************************************************************* ************************************************************************************/static void App_HandleKeys(key_event_t events);void AppTask(event_t events);static uint8_t waitForMessage(nwkMessage_t *pMsg, uint8_t msgType);static uint8_t config(void);static uint8_t send(void);/************************************************************************************ ************************************************************************************* * Private type definitions ************************************************************************************* ************************************************************************************/enum {&amp;nbsp; eState_stopped,&amp;nbsp; eState_start,&amp;nbsp; eState_waitStartConfirm,&amp;nbsp; eState_send,};/** Error codes */enum {&amp;nbsp; errorNoError,&amp;nbsp; errorWrongConfirm,&amp;nbsp; errorNotSuccessful,&amp;nbsp; errorNoMessage,&amp;nbsp; errorAllocFailed,&amp;nbsp; errorInvalidParameter,&amp;nbsp; errorNoScanResults};/************************************************************************************ ************************************************************************************* * Private memory declarations ************************************************************************************* ************************************************************************************//** Flags when the module should next send a packet. Used to add delays between * packets. */bool_t isReadyToSend_test= TRUE;//****** Private global variables *********************************************/** Test state */static uint8_t state = eState_start;/** Application input queue for MLME messages. */static anchor_t mMlmeNwkInputQueue;/** Application input queue for MCPS messages. */static anchor_t mMcpsNwkInputQueue;/** The device's address, always 0x11 22 */static uint8_t shortAddress[2] = { 0x11, 0x22 };/** The Gateway's 802.15.4 PAN. */static uint8_t panId[2] = { 0xEF, 0xBE };/** The current logical channel (frequency band) */static uint8_t logicalChannel= CHANNEL_MIN;/** Total number of packets sent */static uint32_t sentCnt = 0;/** Number of packets sent with an error */static uint32_t errorCnt = 0;/** Number of packets data confirmations*/static uint32_t confCnt = 0;/** Sequence number for next packet */static uint8_t seqNumber = 0;static bool_t firstStart= TRUE;static uint8_t delayCounter = 0;/************************************************************************************ ************************************************************************************* * Public memory declarations ************************************************************************************* ************************************************************************************//* The current state of the applications state machine */uint8_t gState;/* This data set contains application variables to be preserved across resets */NvDataItemDescription_t const gaNvAppDataSet[] = { { NULL, 0 } /* Required end-of-table marker. */};/************************************************************************************ ************************************************************************************* * Public functions ************************************************************************************* ************************************************************************************/void DeepSleepWakeupStackProc(void);/***************************************************************************** * Initialization function for the App Task. This is called during * initialization and should contain any application specific initialization * (ie. hardware initialization/setup, table initialization, power up * notificaiton. * * Interface assumptions: None * * Return value: None * *****************************************************************************/void MApp_init(void) {&amp;nbsp; /* The initial application state */&amp;nbsp; gState = stateInit;&amp;nbsp; /* Initialize the MAC 802.15.4 extended address */&amp;nbsp; Init_MacExtendedAddress();&amp;nbsp; /* register keyboard callback function */&amp;nbsp; KBD_Init(App_HandleKeys);&amp;nbsp; /* initialize LED Module */&amp;nbsp; LED_Init();&amp;nbsp; /* Initialize the LPM module */&amp;nbsp; PWRLib_Init();&amp;nbsp; MSG_InitQueue(&amp;amp;mMlmeNwkInputQueue);&amp;nbsp; MSG_InitQueue(&amp;amp;mMcpsNwkInputQueue);&amp;nbsp; /* Enable MCU interrupts */&amp;nbsp; IrqControlLib_EnableAllIrqs();&amp;nbsp; /*signal app ready*/&amp;nbsp; Led2On();&amp;nbsp; Led1Off();&amp;nbsp; // Start running the AppTask.&amp;nbsp; TS_SendEvent(gAppTaskID_c, gAppEvtDummyEvent_c);}/***************************************************************************** *Mac Application Task event processor.&amp;nbsp; This function is called to * process all events for the task. Events include timers, messages and any * other user defined events * * Interface assumptions: None * * Return value: None *****************************************************************************/void AppTask(event_t events) {&amp;nbsp; /* Pointer for storing the messages */&amp;nbsp; void *pMsgIn;&amp;nbsp; /* Stores the status code returned by some functions. */&amp;nbsp; uint8_t rc;&amp;nbsp; /* Preset return code to contain the success code */&amp;nbsp; rc = errorNoError;&amp;nbsp; /* Try to get a message from MLME */&amp;nbsp; if (MSG_Pending(&amp;amp;mMlmeNwkInputQueue))&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsgIn = MSG_DeQueue(&amp;amp;mMlmeNwkInputQueue);&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsgIn = NULL;&amp;nbsp; switch (state) {&amp;nbsp; //-----------------------------------&amp;nbsp; case eState_start:&amp;nbsp;&amp;nbsp;&amp;nbsp; sentCnt = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; errorCnt = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; confCnt = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; seqNumber = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = config();&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rc == errorNoError)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state = eState_waitStartConfirm;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp; case eState_waitStartConfirm:&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Stay in this state until the Start confirm message arrives. */&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = waitForMessage(pMsgIn, gNwkStartCnf_c);&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rc == errorNoError) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state = eState_send;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp; case eState_send:&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isReadyToSend_test) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rc = send();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sentCnt++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isReadyToSend_test = FALSE;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; }&amp;nbsp; if (pMsgIn) {&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Messages must always be freed. */&amp;nbsp;&amp;nbsp;&amp;nbsp; MSG_Free(pMsgIn);&amp;nbsp; }&amp;nbsp; /* Call the MAC main function until the function returns false, indicating&amp;nbsp;&amp;nbsp; * there is no more work to do. */&amp;nbsp; //Mlme_Main();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Just to avoid the compiler warning */&amp;nbsp; (void)events;&amp;nbsp; // Let AppTask run again&amp;nbsp; TS_SendEvent(gAppTaskID_c, gAppEvtDummyEvent_c);}/************************************************************************************ ************************************************************************************* * Private functions ************************************************************************************* ************************************************************************************//***************************************************************************** * Handles all key events for this device. * Interface assumptions: None * Return value: None *****************************************************************************/static void App_HandleKeys(key_event_t events /*IN: Events from keyboard module&amp;nbsp; */) {&amp;nbsp; switch (events) {&amp;nbsp; case gKBD_EventSW1_c:&amp;nbsp; case gKBD_EventSW2_c:&amp;nbsp; case gKBD_EventSW3_c:&amp;nbsp; case gKBD_EventSW4_c:&amp;nbsp; case gKBD_EventLongSW1_c:&amp;nbsp; case gKBD_EventLongSW2_c:&amp;nbsp; case gKBD_EventLongSW3_c:&amp;nbsp; case gKBD_EventLongSW4_c:&amp;nbsp;&amp;nbsp;&amp;nbsp; //LED_ToggleLed(LED2);&amp;nbsp;&amp;nbsp;&amp;nbsp; //TS_SendEvent(gAppTaskID_c, gAppEvtDummyEvent_c);&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&amp;nbsp; }}void nextChannel_test(void) {&amp;nbsp; logicalChannel++;&amp;nbsp; if (logicalChannel &amp;gt; CHANNEL_MAX)&amp;nbsp;&amp;nbsp;&amp;nbsp; logicalChannel = CHANNEL_MIN;}void stop_test(void) {&amp;nbsp; state = eState_stopped;}/** * This function analyzes the supplied message to determine whether or not the * message is of the expected type. It does not, as the name implies, wait for&amp;nbsp; * a message, thus blocking the execution of the state machine.&amp;nbsp; *&amp;nbsp; * @return one of the following values: * &amp;lt;ul&amp;gt; *&amp;nbsp; &amp;lt;li&amp;gt;errorNoError: The message was of the expected type.&amp;lt;/li&amp;gt; *&amp;nbsp; &amp;lt;li&amp;gt;errorNoMessage: The message pointer is NULL.&amp;lt;/li&amp;gt; *&amp;nbsp; &amp;lt;li&amp;gt;errorWrongConfirm: The message is not of the expected type.&amp;lt;/li&amp;gt; * &amp;lt;/ul&amp;gt; */uint8_t waitForMessage(nwkMessage_t *pMsg, uint8_t msgType) {&amp;nbsp; /* Do we have a message— If not, the exit with error code */&amp;nbsp; if (pMsg == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorNoMessage;&amp;nbsp; /* Is it the expected message type– If not then exit with error code */&amp;nbsp; if (pMsg-&amp;gt;msgType != msgType)&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorWrongConfirm;&amp;nbsp; /* Found the expected message. Return with success code */&amp;nbsp; return errorNoError;}uint8_t config(void) {&amp;nbsp; /* Message for the MLME will be allocated and attached to this pointer */&amp;nbsp; mlmeMessage_t *pMsg;&amp;nbsp; /* Pointer which is used for easy access inside the allocated message */&amp;nbsp; mlmeStartReq_t *pStartReq;&amp;nbsp; /* Return value from MSG_send - used for avoiding compiler warnings */&amp;nbsp; uint8_t ret;&amp;nbsp; /* Allocate a message for the MLME*/&amp;nbsp; pMsg = MSG_AllocType(mlmeMessage_t);&amp;nbsp; if (pMsg == NULL) // Allocation of a message buffer failed. */&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorAllocFailed;&amp;nbsp; /* Set-up MAC PIB attributes. Please note that Set, Get,&amp;nbsp;&amp;nbsp; and Reset messages are not freed by the MLME. */&amp;nbsp; /* We must always set the short address to something&amp;nbsp;&amp;nbsp; else than 0xFFFF before starting a PAN. */&amp;nbsp; pMsg-&amp;gt;msgType = gMlmeSetReq_c;&amp;nbsp; pMsg-&amp;gt;msgData.setReq.pibAttribute = gMPibShortAddress_c;&amp;nbsp; pMsg-&amp;gt;msgData.setReq.pibAttributeValue = (uint8_t *)shortAddress;&amp;nbsp; ret = MSG_Send(NWK_MLME, pMsg);&amp;nbsp; /* This is a MLME-START.req command */&amp;nbsp; pMsg-&amp;gt;msgType = gMlmeStartReq_c;&amp;nbsp; /* Create the Start request message data. */&amp;nbsp; pStartReq = &amp;amp;pMsg-&amp;gt;msgData.startReq;&amp;nbsp; FLib_MemCpy(pStartReq-&amp;gt;panId, (void *)panId, 2);&amp;nbsp; pStartReq-&amp;gt;logicalChannel = logicalChannel;&amp;nbsp; pStartReq-&amp;gt;beaconOrder = 0x0F; // beacons off&amp;nbsp; pStartReq-&amp;gt;superFrameOrder = 0x0F; // turn off beacons&amp;nbsp; pStartReq-&amp;gt;panCoordinator = TRUE;&amp;nbsp; pStartReq-&amp;gt;batteryLifeExt = FALSE;&amp;nbsp; pStartReq-&amp;gt;coordRealignment = FALSE;&amp;nbsp; pStartReq-&amp;gt;securityEnable = FALSE;&amp;nbsp; /* Send the Start request to the MLME. */&amp;nbsp; ret = MSG_Send(NWK_MLME, pMsg);&amp;nbsp; if (ret == gSuccess_c)&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorNoError;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorInvalidParameter;}uint8_t send(void) {&amp;nbsp; uint8_t checksum = 0;&amp;nbsp; uint8_t i = 0;&amp;nbsp; nwkToMcpsMessage_t *pPacket;&amp;nbsp; /* Allocate packet *///&amp;nbsp; pPacket = MSG_Alloc(sizeof(nwkToMcpsMessage_t) - 1 + MAX_MSDU_SIZE);&amp;nbsp; pPacket = MSG_Alloc(gMaxRxTxDataLength_c);&amp;nbsp;&amp;nbsp;&amp;nbsp; if (pPacket == NULL)&amp;nbsp;&amp;nbsp;&amp;nbsp; return errorAllocFailed;&amp;nbsp; // Prepend with sequence number&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.pMsdu[0] = seqNumber;&amp;nbsp; for (i = 1; i &amp;lt; (MAX_MSDU_SIZE - 1); i++) {&amp;nbsp;&amp;nbsp;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.pMsdu[i] = 0x11; // dummy data&amp;nbsp; }&amp;nbsp; // Apped checksum to packet&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.pMsdu[MAX_MSDU_SIZE - 1] = checksum;&amp;nbsp; // Build MCPS-Data Request message&amp;nbsp; pPacket-&amp;gt;msgType = gMcpsDataReq_c;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.srcAddr[0] = shortAddress[0];&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.srcAddr[1] = shortAddress[1];&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.dstAddr[0] = 0xFF; // broadcast&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.dstAddr[1] = 0xFF; // broadcast&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.dstPanId[0] = 0xFF; // broadcast&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.dstPanId[1] = 0xFF; // broadcast&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.srcPanId[0] = panId[0];&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.srcPanId[1] = panId[1];&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.dstAddrMode = gAddrModeShort_c;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.srcAddrMode = gAddrModeShort_c;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.msduLength = MAX_MSDU_SIZE;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.msduHandle = seqNumber;&amp;nbsp; pPacket-&amp;gt;msgData.dataReq.txOptions = 0; // no ack, no security&amp;nbsp; seqNumber++;&amp;nbsp; /* Send the Data Request to the MCPS */&amp;nbsp; return MSG_Send(NWK_MCPS, pPacket);}/***************************************************************************** * The DeepSleepWakeupStackProc(void) function is called each time the&amp;nbsp; * application exits the DeepSleep mode . *&amp;nbsp; * Return value: *&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; None *****************************************************************************/void DeepSleepWakeupStackProc(void) {&amp;nbsp; return;}/****************************************************************************** * The following functions are called by the MAC to put messages into the * Application's queue. They need to be defined even if they are not used * in order to avoid linker errors. ******************************************************************************/uint8_t MLME_NWK_SapHandler(nwkMessage_t *pMsg) {&amp;nbsp; /* Put the incoming MLME message in the applications input queue. */&amp;nbsp; MSG_Queue(&amp;amp;mMlmeNwkInputQueue, pMsg);&amp;nbsp; return gSuccess_c;}uint8_t MCPS_NWK_SapHandler(mcpsToNwkMessage_t *pMsg) {&amp;nbsp; confCnt++;&amp;nbsp; isReadyToSend_test = TRUE;&amp;nbsp; if (pMsg-&amp;gt;msgData.dataCnf.status != gSuccess_c)&amp;nbsp;&amp;nbsp;&amp;nbsp; errorCnt++;&amp;nbsp; MSG_Free(pMsg);&amp;nbsp; return gSuccess_c;}uint8_t ASP_APP_SapHandler(aspToAppMsg_t *pMsg) {&amp;nbsp; /* If the message is not handled anywhere it must be freed. */&amp;nbsp; MSG_Free(pMsg);&amp;nbsp; return gSuccess_c;}/******************************************************************************/&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:54:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151576#M8295</guid>
      <dc:creator>MarcB</dc:creator>
      <dc:date>2020-10-29T08:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: List_RemoveHead goes into infinite loop in simple 802.15.4 app</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151577#M8296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;MarcB,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The Mcps-data.request has changed a bit. the msdu shall first be set up at as a pointer, before you start putting in data.&lt;/DIV&gt;&lt;DIV&gt;Please look at the new MyWirelessApp OR in the MACPHY reference manual.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is a small example:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void SendMyName(void) {&lt;BR /&gt;&amp;nbsp;uint8_t Mads[] = "Mads";&lt;BR /&gt;&amp;nbsp;nwkToMcpsMessage_t *pMsg;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;pMsg = MSG_Alloc(sizeof(nwkToMcpsMessage_t) + sizeof(Mads));&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;if&amp;nbsp;(pMsg == NULL)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; return;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgType = gMcpsDataReq_c;&lt;BR /&gt;&amp;nbsp;/* initialize pointer to Msdu */&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.pMsdu = (uint8_t*)(&amp;amp;(pMsg-&amp;gt;msgData.dataReq.pMsdu)) + sizeof(uint8_t*);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLib_MemCpy(pMsg-&amp;gt;msgData.dataReq.pMsdu, Mads, sizeof(Mads));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLib_MemCpy(pMsg-&amp;gt;msgData.dataReq.dstAddr, mCoordInfo.coordAddress, 8);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLib_MemCpy(pMsg-&amp;gt;msgData.dataReq.srcAddr, maMyAddress, 8);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLib_MemCpy(pMsg-&amp;gt;msgData.dataReq.dstPanId, mCoordInfo.coordPanId, 2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLib_MemCpy(pMsg-&amp;gt;msgData.dataReq.srcPanId, mCoordInfo.coordPanId, 2);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.dstAddrMode = mCoordInfo.coordAddrMode;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.srcAddrMode = mAddrMode;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.msduLength = sizeof(Mads);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.txOptions = gTxOptsAck_c;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMsg-&amp;gt;msgData.dataReq.msduHandle = mMsduHandle++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Send the Data Request to the MCPS */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)MSG_Send(NWK_MCPS, pMsg);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;BR,&lt;/DIV&gt;&lt;DIV&gt;Mads&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2008 13:39:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151577#M8296</guid>
      <dc:creator>Mads</dc:creator>
      <dc:date>2008-04-29T13:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: List_RemoveHead goes into infinite loop in simple 802.15.4 app</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151578#M8297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks Mads, that did solve my problem!&lt;BR /&gt;&lt;BR /&gt;Note that the MACPHY reference manual has not been updated with this change as of rev 1.6 (802154MPSRM.pdf).&lt;BR /&gt;&lt;BR /&gt;A couple of quick questions:&lt;BR /&gt;- Do you still allocate packets using the following "formula":&lt;BR /&gt;pPacket = MSG_Alloc(sizeof(nwkToMcpsMessage_t) - 1 + MY_PACKET_DATA_SIZE);&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;- Are there any similar changes on the reception side? In fact, is there a liste of API changes or release notes?&lt;BR /&gt;&lt;BR /&gt;Cheers!&lt;BR /&gt;Marc&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2008 21:12:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151578#M8297</guid>
      <dc:creator>MarcB</dc:creator>
      <dc:date>2008-04-29T21:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: List_RemoveHead goes into infinite loop in simple 802.15.4 app</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151579#M8298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;There should not be any special modifications needed for the indication.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I will check up on the documentation, which codebase are you using ?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Please note the latest beekit installer is 1.7.0 and latest mac codebase is 1.0.3.&lt;/DIV&gt;&lt;DIV&gt;You might have an older version of the reference manual.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Br,&lt;/DIV&gt;&lt;DIV&gt;Mads&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 May 2008 17:22:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/List-RemoveHead-goes-into-infinite-loop-in-simple-802-15-4-app/m-p/151579#M8298</guid>
      <dc:creator>Mads</dc:creator>
      <dc:date>2008-05-01T17:22:41Z</dc:date>
    </item>
  </channel>
</rss>

