I have JTAG flashed images with no bootloader support, and now i’d like to add the serial bootloader support back.
I added the flag to prj.conf

# Bootloader
CONFIG_BOOTLOADER_MCUBOOT=y

and i flashed using west. I also tried flashing merged.hex using nrf connect programmer.
I can’t get boot mode to come up by holding MD and pressing reset.

the application works, but serial boot loader does not.

I’ve even tried this with nfed/samples/blinky

Any thoughts? How can I get this back to ‘factory’ default using JTAG - to where serial bootloader works with newtmgr again?

(I’m using a sparkfun board, but also have a circuit dojo feather nrf9160 … i’ll try that next)

David

    davidahoward1 it’s likely working but if you’re using an older version of NCS the changes I’ve committed upstream haven’t hit NCS yet. You can apply this patch:

    https://community.jaredwolff.com/assets/files/2021-06-24/1624561174-992035-nrf9160-feather-bootloader-patch.diff

    to bootloader/mcuboot which will add that functionality back. You will also have to create an .overlay for the sample you’re working with:

    / {
    	aliases {
    		bootloader-led0 = &blue_led;
        };
    };
    
    // Full speed ahead
    &uart0 {
    	status = "okay";
    	current-speed = <1000000>;
    	tx-pin = <6>;
    	rx-pin = <5>;
    };

    Add add it to your CMakeLists.txt similar how I did it here: https://www.jaredwolff.com/optimize-zephyr-config-and-overlays/#mcuboot

    I’m applying the patches and will test tonight! Hopefully I have good news by AM when I need to report on progress to my EMEA product/sales group.
    Thanks for quick reply 😉

    David

      I’m struggling a bit… when trying to build I get:

      /opt/nordic/ncs/v1.5.1/bootloader/mcuboot/boot/zephyr/main.c:149:2: error: #error “Unsupported board: led0 devicetree alias is not defined”
      149 | #error “Unsupported board: led0 devicetree alias is not defined”
      | ~~
      /opt/nordic/ncs/v1.5.1/bootloader/mcuboot/boot/zephyr/main.c: In function ‘led_init’:
      /opt/nordic/ncs/v1.5.1/bootloader/mcuboot/boot/zephyr/main.c:157:28: error: ‘LED0_GPIO_LABEL’ undeclared (first use in this function); did you mean ‘DT_GPIO_LABEL’?
      157 | led = device_get_binding(LED0_GPIO_LABEL);
      | ^~~~~~~~~~~~~~
      | DT_GPIO_LABEL

      I can see that my custom overlay is being added

      – Adding .overlay for mcuboot.
      – /opt/nordic/ncs/v1.5.1/nfed/samples/blinky/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay

      not sure what is messed up 🙁

        davidahoward1 did you at the CMakeLists.txt entry as well? The mcuboot overlay is one thing that doesn’t get automatically added.

        # Adding custom overlay
        message(STATUS "Adding .overlay for mcuboot.")
        list(APPEND mcuboot_DTC_OVERLAY_FILE
          "${CMAKE_CURRENT_SOURCE_DIR}/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay"
          )

        Specifically add this. This will allow Zephyr to find your MCUBoot .overlay and fix the LED error

          one thing i noticed, but didn’t solve it;
          main.c

          #define LED0_NODE DT_ALIAS(bootloader_led0)

          but in the overlay referenced in your email bootloader-led0 = &blue_led;

          ‘_’ vs ‘-’

          I’ll keep digging

          for now i got it to boot and switch to bootloader mode working by just changing the alias in main.c
          but alas I still can’t get newtmgr to work

          //!dh #define LED0_NODE DT_ALIAS(bootloader_led0)
          #define LED0_NODE DT_ALIAS(led0)

          jaredwolff this goes in the CMakeLists.txt file located where? the samples/blinky dir?
          this is what I put in ncs/v1.5.1/nfed/samples/blinky/CMakeLists.txt

          \# Adding custom overlay
          message(STATUS "Adding .overlay for mcuboot.")
          message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay")
          list(APPEND mcuboot_DTC_OVERLAY_FILE
            "${CMAKE_CURRENT_SOURCE_DIR}/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay"
            )

          and I put the .overlay file in ncs/v1.5.1/nfed/samples/blinky/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay

          / {
          	aliases {
          		bootloader-led0 = &blue_led;
              };
          };
          
          // Full speed ahead
          &uart0 {
          	status = "okay";
          	current-speed = <1000000>;
          	tx-pin = <6>;
          	rx-pin = <5>;
          };

            i need to study the docs for zephyr on devicetree and overlays apparently… 🙁

            davidahoward1 this is what I put in ncs/v1.5.1/nfed/samples/blinky/CMakeLists.txt

            Looks like you put it twice. Here’s what your CMakeLists.txt should look like for the blinky sample:

            # SPDX-License-Identifier: Apache-2.0
            
            list(APPEND mcuboot_DTC_OVERLAY_FILE
            “${CMAKE_CURRENT_SOURCE_DIR}/conf/mcuboot/circuitdojo_feather_nrf9160ns.overlay”
            )
            
            cmake_minimum_required(VERSION 3.13.1)
            find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
            project(blinky)
            
            target_sources(app PRIVATE src/main.c)

              jaredwolff
              I’m good to go! thanks, it looks like i have the cmake file order bad; I had the list(APPEND …) after cmake_min…target_sources e.g. appended to file rather than prepended.

              I’m up and running now

              Thanks for being patient with me - great customer support!

              David Howard
              P.S. you will notice I bought another feather yesterday … and likely will order several more next week.
              I love this device!

              P.P.S. It would be really cool if on the next version you supported connection to a primary/non-rechargeable battery
              e.g. lithium thionyl

                davidahoward1 I’m up and running now

                Woo that’s awesome

                P.S. you will notice I bought another feather yesterday … and likely will order several more next week.
                I love this device!

                I saw. Thank you! It’s on the way. 😀

                davidahoward1 P.P.S. It would be really cool if on the next version you supported connection to a primary/non-rechargeable battery
                e.g. lithium thionyl

                Do you have an example of the connector you’re looking for?

                Terms and Conditions | Privacy Policy