I was able to compile the nRF Cloud AGPS sample but when I try to execute the newtmgr image upload after entering DFU mode I get an Error 3. After trying this a several of times (doing different things) I then thought I could update the binary from the link provided but wasn’t sure how to do that. Do I rename the downloaded nrf_cloud_agps_bb259bf.bin to app_update.bin in the build/zephyr directory?
Here is the end of the compile and where I got the newtmgr error. If you’d like to see more of the compile I can provide that:

Call Stack (most recent call first):
  C:/ncs/bootloader/mcuboot/zephyr/CMakeLists.txt:1 (include)

CMake Warning at C:/ncs/zephyr/CMakeLists.txt:1379 (message):
  __ASSERT() statements are globally ENABLED

-- Configuring done
-- Generating done
-- Build files have been written to: C:/ncs/nrf/samples/nrf9160/nrf_cloud_agps/build
[9/209] Performing build step for 'mcuboot_subimage'
Memory region         Used Size  Region Size  %age Used
           FLASH:       42280 B        48 KB     86.02%
        IDT_LIST:          72 B         2 KB      3.52%
[249/249] Linking C executable zephyr\zephyr.elf
[188/193] Linking C executable zephyr\zephyr_prebuilt.elf
           FLASH:       32256 B        48 KB     65.63%
            SRAM:        5488 B        64 KB      8.37%
[193/193] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      149092 B     441856 B     33.74%
            SRAM:       43000 B       128 KB     32.81%
        IDT_LIST:         120 B         2 KB      5.86%
[209/209] Generating zephyr/merged.hex
PS C:\ncs\nrf\samples\nrf9160\nrf_cloud_agps> newtmgr conn add serial type=serial connstring="dev=COM20,baud=1000000"
Connection profile serial successfully added
PS C:\ncs\nrf\samples\nrf9160\nrf_cloud_agps> newtmgr -c serial image upload build/zephyr/app_update.bin
 0 / 199092 [----------------------------------------------------------------------------------------------------------------------------------------]   0.00%Error: 3

Any help would be appreciated. Thank you, Steve D.

    I would like to add that I’m running Windows and did search for this error and found it addressed a couple years ago with a new repo, so that didn’t seem to be the issue here. Also, initially, when I did the git fetch and checked out the latest master I was in the wrong directory ( I was in the nrf_cloud_agps directory) so I then switched directories and and did the git fetch and check out again. If this is the underlying problem how would I fix this?

    SteveD0 Do I rename the downloaded nrf_cloud_agps_bb259bf.bin to app_update.bin in the build/zephyr directory?

    No need to rename. It should work from anywhere on your machine.

    SteveD0 199092

    It may be too large for the bootloader to handle. That’s your issue. Did you add functionality in the prj.conf?

    I added the configuration commands you provided (see below) at the bottom of the prj.conf. I just noticed when I went back to look at what I added and even though I saved it it has the green bar saying that the configuration lines are pending. I fiddled around and now the green bar between the numbers and the config lines is gone, but have the config commands staged and their seems to be a separate path on the source control. When I looked this up I think it wants me to commit, but when I enter “commit” it wants me to log into git with name and password. I didn’t do that because I felt it was going to change this not just in my build. What would you suggest?

    What I added to the prj.conf:

    CONFIG_NRF_CLOUD_CLIENT_ID_PREFIX="feather-"
    
    # Enable Zephyr application to be booted by MCUboot
    CONFIG_BOOTLOADER_MCUBOOT=y
    
    # COEX0 is used to enable the GPS LNA, but it has to be configured to do so.
    CONFIG_NRF9160_GPS_SET_COEX0=y
    CONFIG_NRF9160_GPS_COEX0_STRING="AT%XCOEX0=1,1,1565,1586"

    Also, after the green bars were gone I tried to run newtmgr again and now it responded with “Error: The system cannot find the file specified.”

    Might this have to do with the initial mistake I made fetching and checking out the latest master in the wrong directory?

    As you mentioned, it turns out this build needs 199 kB and I think you said the limit is 192. I’ll be ordering the nRF5340 PDK.
    Thanks, Steve

    The AGPS example should compile < 195kB. (Since the example binary works A-Ok) It’s hard to tell what could be wrong here without getting a diff of the project. Can you run git status and git log -n 1 within the ncs/nrf directory?

    Thanks!

    Yes. Here it is:

    PS C:\ncs\nrf> git status
    HEAD detached from bb259bfa
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
            modified:   samples/nrf9160/nrf_cloud_agps/prj.conf
    
    no changes added to commit (use "git add" and/or "git commit -a")
    PS C:\ncs\nrf> git log -n 1
    commit a83f2e623fe81f0eb3873f0138d32c10eb8b8d59 (HEAD)
    Author: Steve Doroff <Steve.Doroff@gmail.com>
    Date:   Mon Nov 2 11:15:17 2020 -0500
    
        Add nrf prefix
    PS C:\ncs\nrf>

    Ahh yea looks like you’ve made some changes. I don’t recommend directly committing to the nrf directory since when you update your changes won’t rebase along with the SDK. I’ll be sharing more about this in my upcoming blog article.

    I didn’t perform the commit of the changes until this morning, but I had the same Error 3 as yesterday, so maybe that is only part of the problem. Also, I don’t know VSC very well and I definitely don’t know it well as a source control tool. this morning I was just trying to see if anything worked, probably to my demise. I performed the staging and commit so it would add the additional configuration commands, so I guess unfortunately I committed the changes thinking that would fix the issue. Is there a way to undo what i did easily? Or, should I delete the entire nrf directory and re-perform the entire windows setup? If I did that would that create an issue in VCS? As I mentioned above, I don’t know that would solve the issue because when I first ran into Error 3 I hadn’t staged nor committed anything. It was the same process as when I was running blinky, button or fade_led, which all ran okay with just updating the config, running west, establishing the com port, going into DFU mode and then running newtmgr for update bin and reset.

      SteveD0 I committed the changes thinking that would fix the issue. Is there a way to undo what i did easily? Or, should I delete the entire nrf directory and re-perform the entire windows setup? If I did that would that create an issue in VCS?

      You can always roll back a change with Git by using the git reset command. I’m a fan of SourceTree which makes navigating things a little easier. 🙂

      SteveD0 It was the same process as when I was running blinky, button or fade_led, which all ran okay with just updating the config, running west, establishing the com port, going into DFU mode and then running newtmgr for update bin and reset.

      Got it. It may be your toolchain which is adding the extra size. What do you get when you run arm-none-eabi-gcc --version?

      PS C:\ncs\nrf> arm-none-eabi-gcc ‘–version’
      arm-none-eabi-gcc.exe (GNU Arm Embedded Toolchain 9-2020-q2-update) 9.3.1 20200408 (release)
      Copyright © 2019 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions. There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

      What I recommend is you uninstall that version of the toolchain and install this one. I changed the documentation last week to reflect this after testing was causing problems. I would try the AGPS example again with the new toolchain when it’s done.

      SteveD0 No worries. Go into your Add/Remove programs and look for the Arm Embedded Toolchain. Uninstall it like any other program that you’ve installed on your Windows PC.

      Got it - went to programs and applications and I’m now installing it.

      Got a “404: Not Found” from the link you provided.

      Terms and Conditions | Privacy Policy