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.

CC2531: Z-Stack Red/Green Leds, Buttons

Part Number: CC2531
Other Parts Discussed in Thread: Z-STACK,

What is the meaning of the red/green leds and the buttons of a CC2531 with Z-Stack?

When I connect CC2531 (Z-Stack) green led is on for a minute or until I press the button beside.

As long the green led is on Z-Tool don't find the device, when it goes off after a minute or button beside pressed, Z-Tool can connect.

If I press the other button as long green is on, red goes on (green of) and stays on, Z-Tool also don't find device with red led on.

I couldn't find information about leds and buttons. 

  • It depends what FW you run on CC2531EMK. Do you know what FW you run on CZc2531?
  • It's the Z-Stack Firmware.
  • Hi,

    This is the behavior of the serial bootloader (SBL).

    If the valid ZNP image exists, I believe the SBL will either:
    - jump to location of ZNP image when SW2 is pressed
    - jump to location of ZNP image automatically after 1 minute



    Regards,
    Toby
  • I was guessing something like that already.
    Question what the red led/button/state means keeps open.
  • You can refer to the following codes from serial boot loader. led1 is green and led2 is red.

    void main(void)
    {
      uint8 time_spent_validating;
      uint8 bootloaderForcedByMainApp = FALSE;
      uint32 mainAppCommandLocal = mainAppCommand;

      vddWait(VDD_MIN_RUN);

      mainAppCommand = MAIN_APP_CMD_NONE;
        
      if (mainAppCommandLocal == MAIN_APP_CMD_FORCE_BOOTLOADER)
      {
        bootloaderForcedByMainApp = TRUE;
      }
      else if ((mainAppCommandLocal == MAIN_APP_CMD_PASS_THROUGH) || ((SLEEPSTA & LRESET) == RESETWD))
      {
        // If reset due to WatchDog Timer - Transfer control to the main application immediately.
        // WatchDog Timer reset causes the hardware to disconnect the USB. Withought this jump here,
        // the SBL code will try to initiaize the CDC too early, which causes undesired behavior on the host
        // (e.g. on beaglebone black - the host gets stuck)
        asm("LJMP 0x2000\n");
      }

      sblInit(bootloaderForcedByMainApp);
     
      HAL_TURN_ON_LED1();
      HAL_TURN_ON_LED2();
     
      if ((!bootloaderForcedByMainApp) && (sbImgValid(&time_spent_validating)))
      {
        HAL_TURN_OFF_LED2();
        
        if (sblWait(SBL_WAIT_TIME > time_spent_validating ? SBL_WAIT_TIME - time_spent_validating : 0))
        {
          HAL_TURN_OFF_LED1();
          
          sbReportState(SB_STATE_EXECUTING_IMAGE);
          
          while(sblIsUartTxPending())
          {
            sbUartPoll();
          }
          
          SLEEP(0x2600); //Give the last bytes in the HW TX fifo (if any) enough time to be transmitted

          while (SB1_PRESS || SB2_PRESS);
          
          sblUnInit();
          
          // Simulate a reset for the Application code by an absolute jump to location 0x2000.
          asm("LJMP 0x2000\n");
        }
      }
     
      HAL_TURN_OFF_LED1();
      HAL_TURN_ON_LED2();
     
      vddWait(VDD_MIN_NV);
      sblExec();

      sblUnInit();

      asm("LJMP 0x2000\n");
    }

  • YK, thanks for posting the relevant code.

    Ingo, if you'd like to view the rest of the bootloader code, you can see it in "Z-Stack 3.0.2\Projects\zstack\Utilities\BootLoad\CC2531\source".