Thingy 91 Blinky Example

So i purchased the thingy 91 eval board to try it out and see if it will be easy to work with.

I was able to follow the instructions and get vs code working properly and building, so i tried the blinky sample to see if I can blink the led light.

I managed to get it to build properly following the instructions and they explain how to flash it using the programmer in the nrf connect for desktop, it flashed properly and gave me the green progress saying it finished in 18 seconds.

I turn it off and on and I get nothing, no blinking light, no nothing.

Can someone please advise?

Parents
  • This tutorial assumes you are using a development board like the nRF52840 DK or nRF9160 DK, which define led0 and sw0 aliases in their devicetree. However, the Thingy:91 does not define led0.

    For Thingy91 use should use use the dk_buttons_and_leds.h library, which is specifically designed for the Thingy:91 and handles the LED and button.

    What worked for me:

    Modify main.c:

    Add

    #include <dk_buttons_and_leds.h>

    change main:
    int main(void)
    {
    int ret = dk_leds_init();
    if (ret != 0) {
    return ret;
    }

    while (1) {
    ret = gpio_pin_toggle_dt(&led);
    if (ret < 0) {
    return 0;
    }

    dk_set_led_on(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    dk_set_led_off(DK_LED1);
    k_msleep(SLEEP_TIME_MS);
    }
    return 0;
    }

    --- modify prj.conf

    CONFIG_GPIO=y
    CONFIG_DK_LIBRARY=y
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_BUILD_OUTPUT_BIN=y
    CONFIG_BUILD_OUTPUT_HEX=y
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_UART_CONSOLE=y

    --
    and use build/l1_e2/zephyr/zephyr.signed.hex
    as the file in Programmer.

    Unfortunately - a lot of changes in the first tutorial.

  • Hi  ,

    This tutorial assumes you are using a development board like the nRF52840 DK or nRF9160 DK, which define led0 and sw0 aliases in their devicetree. However, the Thingy:91 does not define led0.

    This is not correct, the nRF Connect SDK Fundamentals course works with all of the devices listed on the front page: nRF54L15 DK, nRF7002 DKnRF5340 DKnRF52840 DK, nRF52833 DK, nRF52 DK, nRF9160 DK, nRF9161 DK, nRF9151 DK, Thingy:53, Thingy:91 X or Thingy:91.

    Furthermore, the Thingy:91 board folder defines the led0 and sw0 aliases in the devicetree here. As you can see, alias led0 is assigned to the red LED, meaning the Blinky sample running on a Thingy:91 should cause the LED to blink red. 

    I just tested Lesson 1, Exercise 2 using the Thingy:91 (building for thingy91/nrf9160/ns) and it works as expected.

    If this is not working for you, what nRF Connect SDK version are you using, and what error are you getting?

    For Thingy91 use should use use the dk_buttons_and_leds.h library, which is specifically designed for the Thingy:91 and handles the LED and button.

    This is not correct either; the DK Buttons and LEDs library is not specifically designed for the Thingy:91. This library simply provides an API to easily interface with the buttons and LEDs on Nordic boards, without having to use the GPIO API directly.

    Since the Blinky sample aims to show how to toggle an LED using the GPIO API directly, the DK Buttons and LEDs library is not necessary.

    We strive to keep the exercises in the DevAcademy up to date, so if something is not working for you, we'd love feedback on how it is not working, what error you are seeing, what environment you are using, etc. As I said, I just tested Exercise 2 with a Thingy:91, and I'm not able to reproduce any issues.

Reply
  • Hi  ,

    This tutorial assumes you are using a development board like the nRF52840 DK or nRF9160 DK, which define led0 and sw0 aliases in their devicetree. However, the Thingy:91 does not define led0.

    This is not correct, the nRF Connect SDK Fundamentals course works with all of the devices listed on the front page: nRF54L15 DK, nRF7002 DKnRF5340 DKnRF52840 DK, nRF52833 DK, nRF52 DK, nRF9160 DK, nRF9161 DK, nRF9151 DK, Thingy:53, Thingy:91 X or Thingy:91.

    Furthermore, the Thingy:91 board folder defines the led0 and sw0 aliases in the devicetree here. As you can see, alias led0 is assigned to the red LED, meaning the Blinky sample running on a Thingy:91 should cause the LED to blink red. 

    I just tested Lesson 1, Exercise 2 using the Thingy:91 (building for thingy91/nrf9160/ns) and it works as expected.

    If this is not working for you, what nRF Connect SDK version are you using, and what error are you getting?

    For Thingy91 use should use use the dk_buttons_and_leds.h library, which is specifically designed for the Thingy:91 and handles the LED and button.

    This is not correct either; the DK Buttons and LEDs library is not specifically designed for the Thingy:91. This library simply provides an API to easily interface with the buttons and LEDs on Nordic boards, without having to use the GPIO API directly.

    Since the Blinky sample aims to show how to toggle an LED using the GPIO API directly, the DK Buttons and LEDs library is not necessary.

    We strive to keep the exercises in the DevAcademy up to date, so if something is not working for you, we'd love feedback on how it is not working, what error you are seeing, what environment you are using, etc. As I said, I just tested Exercise 2 with a Thingy:91, and I'm not able to reproduce any issues.

Children
No Data
Related