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.

CC430F5137 Simpliciti 1.1.1 AP no response

Other Parts Discussed in Thread: SIMPLICITI, CC430F5137

Hello.

I'm using Simpliciti 1.1.1 (downloaded from here http://www.ti.com/tool/simpliciti) on CC430F5137 on CCS Version: 5.4.0.00091.

I've tried Peer-2-Peer project first - it worked fine, but I had to make some changes specified here http://e2e.ti.com/support/low_power_rf/f/155/p/79691/285098.aspx#285098.

Now I'm trying to launch "Access Point as Data Hub". I downloaded "main_AP_Async_Listen.c" into AP-device with address:

const addr_t lAddr = {0x00, 0x00, 0x00, 0x11};
// set device address
SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, (addr_t*) &lAddr);

I downloaded "main_manyEDs.c" into one ED-device with address

const addr_t lAddr = {0x00, 0x00, 0x00, 0x33};
// set device address
SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, (addr_t*) &lAddr);

Then I powered AP and ED. Led's on ED are blinking - it means that this cycle is running:

while (SMPL_SUCCESS != SMPL_Init(sCB))
{
toggleLED(1);
SPIN_ABOUT_A_SECOND;
}

It means, that "SMPL_Init(sCB)" don't returns "SMPL_SUCCESS". I tryed to sniff transmitted message with other device and RF-studio with same radio settings as ED has:


14:51:19.719 | 65535 | ff ff 00 00 00 33 03 01 d8 01 90 08 07 06 05 02 02
14:51:21.686 | 65535 | ff ff 00 00 00 33 03 01 d9 01 90 08 07 06 05 02 02
14:51:23.647 | 65535 | ff ff 00 00 00 33 03 01 da 01 90 08 07 06 05 02 02
14:51:25.622 | 65535 | ff ff 00 00 00 33 03 01 db 01 90 08 07 06 05 02 02
14:51:27.580 | 65535 | ff ff 00 00 00 33 03 01 dc 01 90 08 07 06 05 02 02
14:51:29.549 | 65535 | ff ff 00 00 00 33 03 01 dd 01 90 08 07 06 05 02 02
14:51:31.516 | 65535 | ff ff 00 00 00 33 03 01 de 01 90 08 07 06 05 02 02
14:51:33.480 | 65535 | ff ff 00 00 00 33 03 01 df 01 90 08 07 06 05 02 02
14:51:35.451 | 65535 | ff ff 00 00 00 33 03 01 e0 01 90 08 07 06 05 02 02

But AP doesn't enter in any subroutine of:

while (1)
{

     if (sJoinSem && (sNumCurrentPeers < NUM_CONNECTIONS))
     {

          .......

     }

     if (sPeerFrameSem)
     {

          ......

     }
     if (BSP_BUTTON1())
     {
          .......
     }
     else
     {
          ........
     }
     BSP_ENTER_CRITICAL_SECTION(intState);
     if (sBlinky)
     {
     ...........................
     }
     BSP_EXIT_CRITICAL_SECTION(intState);
}

}

What do I wrong? Which steps I have to do, to correct the mistake?

  • I have tried to establish connection again. But ED function SMPL_Init(sCB) always returns SMPL_NO_JOIN.

    I haven't any idea where to find resolving.....

  • Hi,

    From your post, it seems that the problem is that the AP doesn't send any reply to the Join Request sent by the EDs.

    Could you please check the RF connection as stated here:

    http://processors.wiki.ti.com/index.php/SimpliciTI_FAQ#Debugging_RF_Connection

    For example, set a breakpoint on the AP side in the ISR function (Mrfi_SyncPinRxIsr()  in mrfi_radio.c), and see whether a packet is received by the RF module when the ED sends the Join Request. Then check how the packet is processed in the ISR.

    As stated in the wiki, you might want to set lower optimization level to be able to debug properly.

  • Leo, thanks for your response. It's very useful. Now I can find the mistake.

    The mistake was in AP_smpl_config.dat file:
    --define=STARTUP_JOINCONTEXT_OFF didn't allow to send the acknowledgment from AP. Now it's fixed.

    But now there is another problem. ED doesn't sent it's acknowledgment to AP, that I suppose have to be. Because AP doesn't go into any subroutine of main cycle, that means sCB callback in AP doesn't happen.

    In generall it's very difficult to debug SimpliciTI projects without detailed information on it. ("SimpliciTI Sample Application User's Guide" and "SimpliciTI API" arew not enough to trace path of code execution)

    So I have a reasonable question, Where I can get workable AP_example for cc430f5137 device for CCS?

    Thanks for help ahead of time.

  • Hi,

    looking into the released code, i think you are using the  "Polling_with_AP" example. However in this case, i think you can also refer to the "AP_as_Data_Hub" example. In the "AP_as_Data_Hub" example, per default, the AP configuration sets STARTUP_JOINCONTEXT_ON.

  • Thank you for response, Leo. I appreciate your help.

    My purpose is to send data from several (~20) ED's to one AP.

    Which sources I have to use for AP: main_AP_Async_Listen.c, main_AP_Async_Listen_autoack.c or main_AP_RE.c?
    The same question for ED: main_manyEDs.c or main_manyEDs_autoack.c?

  • Vyacheslav,

    please use the files with _autoack.c ending, since this make things easier as the message acknowledgement is managed by the lower layer stack.

  • Leo, I used *aotuback files, as you sugested. I added UART in this project and some messages in key events.

    main_manyEDs_autoback.c:

    void main (void)
    {
         BSP_Init();
         uart_intfc_init();

         const addr_t lAddr = {0x00, 0x00, 0x00, 0x32};

         // set device address
         SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, (addr_t*) &lAddr);

         /* Keep trying to join (a side effect of successful initialization) until

         * successful. Toggle LEDS to indicate that joining has not occurred.
         */
         while (SMPL_SUCCESS != SMPL_Init(0))
         {
              toggleLED(1);
              toggleLED(2);
              SPIN_ABOUT_A_SECOND;
         }

         tx_send_wait("\r\nSimpliciTI - Simple Access Point with UART", sizeof("\r\nSimpliciTI - Simple Access Point with UART"));
         tx_send_wait("\r\nEnd Device.", sizeof("\r\nEnd Device."));
         tx_send_wait("\r\nSuccessful joined.", sizeof("\r\nSuccessful joined."));
         /* LEDs on solid to indicate successful join. */
         if (!BSP_LED2_IS_ON())
         {
              toggleLED(2);
         }
         if (!BSP_LED1_IS_ON())
         {
              toggleLED(1);
         }

         /* Unconditional link to AP which is listening due to successful join. */
         linkTo();

         while (1) ;
         }

         static void linkTo()
         {
         uint8_t msg[2];
         uint8_t button, misses, done;

         /* Keep trying to link... */
         tx_send_wait("\r\nTrying to link.", sizeof("\r\nTrying to link."));

         while (SMPL_SUCCESS != SMPL_Link(&sLinkID1))
         {
              toggleLED(1);
              toggleLED(2);
              SPIN_ABOUT_A_SECOND;
              tx_send_wait(".", sizeof("."));
         }

         tx_send_wait("\r\nSuccessful linked.", sizeof("\r\nSuccessful linked."));
         /* Turn off LEDs. */
         ..........     ............     ...............     ..................

    }

    In AP I set up some flags in nwk_frame.c and nwk.join.c subroutines to indicate status with UART messages.

    main_AP_Async_Listen_autoback.c:

        void main (void)
        {
            bspIState_t intState;

            //!
            int8_t sSample[25];

            memset(sSample, 0x0, sizeof(sSample));

            BSP_Init();
            uart_intfc_init();

            const addr_t lAddr = {0x00, 0x00, 0x00, 0x11};

            // set device address
            SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, (addr_t*) &lAddr);

            SMPL_Init(sCB);

            tx_send_wait("\r\nSimpliciTI - Simple Access Point with UART", sizeof("\r\nSimpliciTI - Simple Access Point with UART"));
            tx_send_wait("\r\nAccess Point.", sizeof("\r\nAccess Point."));
            tx_send_wait("\r\nWaiting for join.", sizeof("\r\nWaiting for join."));

            /* green and red LEDs on solid to indicate waiting for a Join. */
            if (!BSP_LED1_IS_ON())
            {
                    toggleLED(1);
            }


            /* main work loop */
            while (1)
            {
                    if(MrfiSyncPinRxIsrFlag){
                            tx_send_wait("\r\nMrfiSyncPinRxIsr", sizeof("\r\nMrfiSyncPinRxIsr"));
                            MrfiSyncPinRxIsrFlag = 0;
                    }

                    if(dispatchFrameFlag){
                            tx_send_wait("\r\ndispatchFrame", sizeof("\r\ndispatchFrame"));
                            dispatchFrameFlag = 0;
                    }

                    if(nwk_processJoinFlag){
                            tx_send_wait("\r\nnwk_processJoin", sizeof("\r\nnwk_processJoin"));
                            nwk_processJoinFlag = 0;
                    }

                    if(handleJoinRequestFlag){
                            tx_send_wait("\r\nhandleJoinRequest", sizeof("\r\nhandleJoinRequest"));
                            handleJoinRequestFlag = 0;
                    }

                    if(smpl_send_join_replyFlag){
                            tx_send_wait("\r\nsmpl_send_join_reply", sizeof("\r\nsmpl_send_join_reply"));
                            smpl_send_join_replyFlag = 0;
                    }

                    if(nwk_sendFrameFlag){
                            tx_send_wait("\r\nnwk_sendFrame", sizeof("\r\nnwk_sendFrame"));
                            nwk_sendFrameFlag = 0;
                    }

                    if (sJoinSem && (sNumCurrentPeers < NUM_CONNECTIONS))

                    {
                            tx_send_wait("\r\nJoin frame is received.", sizeof("\r\nJoin frame is received."));
                            /* listen for a new connection */
                          .......... .................. ................... .................

                   }


            if (sPeerFrameSem)
            {

                   ...............           ...................                   ................ 

            }
            if (BSP_BUTTON1())
            {
                   ...............           ...................                   ................ 
            }
            else
            {
                   ...............           ...................                   ................ 
            }
            BSP_ENTER_CRITICAL_SECTION(intState);
            if (sBlinky)
            {
                   ...............           ...................                   ................ 
            }
            BSP_EXIT_CRITICAL_SECTION(intState);

    }

    Results of message windows from ED and AP:

    ED:

    SimpliciTI - Simple Access Point with UART 
    End Device.
    Successful joined.
    Trying to link. . . . . . . . . . . . .

    AP:

    SimpliciTI - Simple Access Point with UART 
    Access Point.
    Waiting for join.
    MrfiSyncPinRxIsr
    dispatchFrame
    nwk_processJoin
    handleJoinRequest
    smpl_send_join_reply
    nwk_sendFrame
    MrfiSyncPinRxIsr
    dispatchFrame
    MrfiSyncPinRxIsr
    dispatchFrame
    MrfiSyncPinRxIsr
    dispatchFrame
    MrfiSyncPinRxIsr
    dispatchFrame

    It seems, ED joins with AP only, but doesn't link. And again, AP doesn't go in any subroutine of main loop, except UART flag reporting.
    
    
    I hope, Leo, you can help me resolve this problem.
  • I've used sniffer on CC1111 dongle. There is the "LinkTo" request from ED and there is the answer from AP. These two requests go one by one infinitely. Also, it's  strange, that in AP answer "Source address" is set to 00 00 00 32 - actually this is ED adress. Where can a mistake be hidden?

  • Hi Vyacheslav,

    did you take only the example code source file or did you import the whole "AP_as_Data_Hub" project?

    I would suggest the later. Please import the whole "AP_as_Data_Hub" project and not only taking the source code. It could be some settings are missing in your project if you only take the source code.

  • Leo, thanks for respponse and help. 

    My problem was resolved a week ago. Only thing I had to do is to run Project-Clean from main menu when I changed configuration from ED to AP.  After that all works fine.