Thingy91 and buttons

Hi! I'm using a Thingy91 and following the Nordic Academy course. The blinky example works fine, but when I try the second exercise, it seems like the buttons aren’t responding as expected. Since the Thingy91 has unique requirements, I’m compiling the code in VSCode and using nRF Connect to flash it. I’ve configured mcuboot according to the instructions on https://devzone.nordicsemi.com/guides/cellular-iot-guides/b/getting-started-cellular/posts/how-to-program-any-project-to-the-thingy-91-with-dfu and I’m uploading the app_signed.hex file. I’ve tried using button references from sw0 to sw3, but the output is always the same, no response.

  • Are you building for the thingy 91? Because I don't think it has 4 switches in it's board files (but I will have to check tomorrow).

    Also, I need to check whether the bootloader in the Thingy91 is open (not signed) so that it can accept all images, or if it only accepts a set of pre-built images.

    Let me get back to you tomorrow.

    Best regards,

    Edvin

  • Ok, so for development purposes, I really recommend that you stick to a DK when you want to go through these courses. Usually, it is possible to do much of the same things on the different Thingy boards, but it usually requires more knowledge, and it is easier to get stuck. 

    So for the Thingy91, it is sw0, or button0 that is connected to the big button under the silicone lid. You can tell from ncs\nrf\boards\nordic\thingy91\thingy91_nrf9160_common.dts, where you can see that button0 is the one connected to P0.26 on line 21, and that sw0 is an alias for button0 on line 75. So from a software perspective, it is sw0 and button0, even though it is marked as SW3 on the PCB. 

    No other buttons are defined, so I would expect it to give you some build errors if you were trying to use some other buttons than button0 or sw0. 

    What board are you building for?

    And what does the SWD switch, mentioned here:

    https://docs.nordicsemi.com/bundle/ug_thingy91/page/UG/thingy91/hw_description/hw_figures.html

    is in the nRF91 position. 

    Are you able to successfully flash using the description found here?
    https://academy.nordicsemi.com/flash-instructions-for-the-thingy91/

    Best regards,

    Edvin

  • Hi Edvin,

    I’m building from the nRF9160, with the board target set to nrf9160dk_nrf9160_ns in the build configuration. The SWD switch is set to the Thingy91 position, and I’m able to flash it successfully using the Programmer app in nRF Connect. However, it seems the button isn’t responding as expected.

    Thanks for your help,

    Fátima

  • If you are building with board target nrf9160dk_nrf9160_ns, then all the buttons and LEDs will point to the wrong place. You should build with the board target: thingy91/nrf9160/ns (or thingy91_nrf9160_ns if you are not using v2.7.0 or v2.8.0.)

    When you are building for the nrf9160dk_nrf9160_ns, none of the pins that are connected to buttons on the DK are connected to the GPIO that is connected to the button on the Thingy91.

    But as I mentioned, I really recommend that you get some sort of DK (development kit) instead of the Thingy for application development. It will be a lot easier for you to see the logs, debug and flash the applications.

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you! It seems I was working with an earlier SDK version that didn’t include the correct configuration for the Thingy91. After switching to the appropriate setup, everything is functioning as expected.

    As for the development kit suggestion, I understand its advantages. However, I’m specifically working with the Thingy91 because my focus is on IoT applications using cellular connectivity.

    Thank you again for your support!

    Best regards,
    Fátima

Related