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.

CC1312R: ApiMac_attribute_logicalChannel: does ApiMac_mlmeStartReq() reset this somehow?

Part Number: CC1312R
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I have developed a router application. The router joins a collector in the same way a sensor would. It then sets up a network of its own on the same channel with pan coordinator set to false. All works well and has done for some time but I am now trying to get the entire network to work on a different channel other than logical channel 0. For some reason, in my router application, a call to ApiMac_mlmeStartReq() seems to set ApiMac_attribute_logicalChannel to zero. By the time the stack has called startCnfCb(), ApiMac_attribute_logicalChannel is equal to zero when it should be another channel, channel 1 in my current case.

There are no beacons or frequency hopping in my application.

So my question is: does ApiMac_mlmeStartReq() somehow set ApiMac_attribute_logicalChannel to zero?

If I add:

        case Cllc_coordStates_startCnf:
        {

            ApiMac_mlmeSetReqUint8(ApiMac_attribute_logicalChannel,
                                   coordInfoBlock.channel);

everything works as expected. Why is this necessary? I have checked and ApiMac_mlmeStartReq() is set up correctly.

Thanks,

Andy

  • Hi,

    Setting the logicalChannel field for the ApiMac_mlmeStartReq_t should be sufficient (verified on collector from 3.40 SDK).

    Can you share a code snippet of your calling ApiMac_mlmeStartReq

    Regards,
    Toby

  • Hi,

    Many thanks for your response. Here is the code snippet. I don't perform any scans immediately before calling this as it's being set up manually with information taken from the Sensor join process. 

    static void sendStartReq(bool startFH)
    {
        ApiMac_mlmeStartReq_t startReq;
        memset(&startReq, 0, sizeof(ApiMac_mlmeStartReq_t));
    
        /* read network parameters fill them in start req */
        startReq.startTime = 0;
        startReq.panId = coordInfoBlock.panID;
        startReq.logicalChannel = coordInfoBlock.channel;
        startReq.channelPage = CONFIG_CHANNEL_PAGE;
        startReq.phyID = CONFIG_PHY_ID;
        startReq.beaconOrder = CONFIG_MAC_BEACON_ORDER;
        startReq.superframeOrder = CONFIG_MAC_SUPERFRAME_ORDER;
        startReq.panCoordinator = false;
        startReq.batteryLifeExt = false;
        startReq.coordRealignment = false;
        startReq.realignSec.securityLevel = false;
        startReq.startFH = startFH;
        startReq.mpmParams.offsetTimeSlot = CLLC_OFFSET_TIMESLOT;
        startReq.mpmParams.eBeaconOrder = CLLC_EBEACONORDER;
        startReq.mpmParams.NBPANEBeaconOrder = CLLC_NBPANEBEACONORDER;
        startReq.mpmParams.pIEIDs = NULL;
    
        /* send Start Req to MAC API */
        ApiMac_mlmeStartReq(&startReq);
    }

    As I mentioned previously, if I insert the following it works as expected. It'd be nice to know why this is required.

    ApiMac_mlmeSetReqUint8(ApiMac_attribute_logicalChannel, coordInfoBlock.channel);

    Thanks,

    Andy

  • When you say that this information is taken from the join process, is this the join process performed the first time (in channel 0)? In other words, what values do you see in coordInfoBlock (specifically in coordInfoBlock.channel)? This needs to match the channel you intend to join on.

  • Hi,

    Using SysConfig I have set all devices to channel 1 only. That are no other channels are enabled. I program a completely new network with all flash fully erased prior to loading the hex file. The Router will perform a scan for a network on channel 1 only, in exactly the same way a Sensor would. It then joins a parent, this might be the Pan-Coordinator or another Router. After it has joined, my application starts a non-Pan-Coordinator within the Router application. As it already has all network information from the Sensor-type network join just performed, I manually start the non-Pan-Coordinator side. This works perfectly when the channel is set to zero in SysConfig, but setting to channel 1 does not work as the ApiMac_attribute_logicalChannel value is set to zero after ApiMac_mlmeStartReq() is called.

    I have the Pan_coordinator set to channel 1 too of course, and this works fine, so it's clearly something I'm not doing correctly in the Router application, but I cannot think what. It would be helpful to know what can change ApiMac_attribute_logicalChannel  to zero.

    I've taken screen shots to show this. Below is a debug capture showing the values when calling ApiMac_mlmeStartReq(), and then a screenshot showing that ApiMac_attribute_logicalChannel is set to zero after the ApiMac_mlmeStartReq() callback which runs the startCnf in processState().

    Thanks,

    Andy

  • Thanks for clarifying, realized I had .panCoordinator == true when starting the collector on a non-zero channel.

    If you take a look at the definition of struct ApiMac_mlmeStartReq_t, .logicalChannel is one of the fields which is ignored if .panCoordinator == false (so you see the default value of 0 in the startCnf).

    According to the spec, the MLME start request primitive is used to either start a new PAN or begin a new superframe configuration (for beacon-mode). So from this, it makes sense that the parameters which are relevant to starting a new PAN are ignored if panCoordinator == false.

    It should be fine to set the channel manually, as you have currently tried.