• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Help updating bootloader with Atmel-ICE

Scheduled Pinned Locked Moved
Duet Hardware and wiring
2
12
360
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    p8blr
    last edited by p8blr 14 Mar 2022, 21:04

    Hello, I have a 3HC board that is not connecting with CAN and I'm worried that the bootloader is corrupt so I'm trying to re-flash it with an Atmel-ICE. The issue is that I'm getting this error:

    5.png

    I'm following this guide: https://duet3d.dozuki.com/Wiki/Updating_the_bootloader_on_Duet_3_expansion_and_tool_boards

    I'm able to read, erase, change USER_WORD_0.NVMCRTL_BOOTPROT to 0, etc. so I think I've got it wired correctly. Do I have the wrong bootloader .elf file? I tried the .bin file as well and had the same issue.

    I'm getting the file from here: https://github.com/Duet3D/Duet3Bootloader/releases

    What am I doing wrong?

    Thanks!!

    undefined 1 Reply Last reply 14 Mar 2022, 21:19 Reply Quote 0
    • undefined
      dc42 administrators @p8blr
      last edited by dc42 14 Mar 2022, 21:19

      @p8blr that error usually means that you haven't removed the bootloader protection, or that you did but it was immediately reinstated because you didn't disconnect the CAN bus and then erase the firmware first. Check the value of USER_WORD_0.NVMCRTL_BOOTPROT again.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      undefined 1 Reply Last reply 15 Mar 2022, 13:23 Reply Quote 0
      • undefined
        p8blr @dc42
        last edited by p8blr 15 Mar 2022, 13:23

        @dc42 I don't have the can bus connected at all. Here's the steps I took:

        3hc connected to ice.jpg
        1.PNG
        2.PNG
        3.PNG
        4.PNG
        5.png
        6.PNG

        Thanks

        undefined 1 Reply Last reply 15 Mar 2022, 13:29 Reply Quote 0
        • undefined
          dc42 administrators @p8blr
          last edited by 15 Mar 2022, 13:29

          @p8blr if you go back to the fuses page after programming fails, does it still show the bootloader protection as 0kb ?

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          undefined 1 Reply Last reply 15 Mar 2022, 13:46 Reply Quote 0
          • undefined
            p8blr @dc42
            last edited by 15 Mar 2022, 13:46

            @dc42 Yes it still shows 0 kbytes.

            undefined 1 Reply Last reply 15 Mar 2022, 16:00 Reply Quote 0
            • undefined
              dc42 administrators @p8blr
              last edited by 15 Mar 2022, 16:00

              @p8blr your USER_WORD_0 and USER_WORD_1 values look wrong to me. Your screen shot doesn't show the full values, however USER_WORD_1.RAMECC_ECCDIS should be checked, and my USER_WORD_0 value is 0xFE9a9239 which is nothing like your 0x3C000000. My USER_WORD_1 value is 0xAEECFFB1 and USER_WORD_2 is 0xFFFFFFFF.

              USER_WORD_0 include some factory calibration values in bits 15 to 25, and unfortunately it looks like those have got cleared to zero in your chip. However I don't think that matters much because those only affect the brown-out threshold.

              Duet WiFi hardware designer and firmware engineer
              Please do not ask me for Duet support via PM or email, use the forum
              http://www.escher3d.com, https://miscsolutions.wordpress.com

              undefined 1 Reply Last reply 15 Mar 2022, 16:10 Reply Quote 0
              • undefined
                p8blr @dc42
                last edited by 15 Mar 2022, 16:10

                @dc42 Doesn't the guide say to: Find USER_WORD_0.NVMCRTL_BOOTPROT and set it to 0kbytes, though?

                Here's all my fuse values as they are right now:
                7.PNG
                8.PNG
                9.PNG
                10.PNG
                11.PNG

                Thanks

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by 15 Mar 2022, 17:11

                  @p8blr I think you need to at least set userword2.nvmregionlocks to 0xFFFFFFFF.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  undefined 1 Reply Last reply 15 Mar 2022, 17:30 Reply Quote 0
                  • undefined
                    p8blr @dc42
                    last edited by 15 Mar 2022, 17:30

                    @dc42 So I managed to get the board to work, but still can't get it to verify. I did several things and I'm not sure which thing I did made it work.

                    I connected a known good 3HC that I had and saved the Flash and User Page files. Then I connected the bad board and programmed the User Page with the Document.userpage file I backed up. I then tried to program the Flash with the Document.hex file I backed up and that failed verification like before. So I unchecked "Verify Flash after programming" re-programmed it, connected it to CAN and it worked. I was able to detect it with M115 and updated the firmware with M997.

                    Here's my settings after doing what I did:
                    12.PNG
                    13.PNG
                    14.PNG

                    Does it matter that it fails verification but works?

                    undefined 1 Reply Last reply 15 Mar 2022, 19:51 Reply Quote 0
                    • undefined
                      dc42 administrators @p8blr
                      last edited by dc42 15 Mar 2022, 19:51

                      @p8blr perhaps the security bit has somehow got set and isn't being cleared by chip erase as is supposed to happen. If the bootloader is working and M122 confirms the bootloader version number then I guess it is OK. The firmware itself won't start up if it fails to verify its own CRC.

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      undefined 1 Reply Last reply 16 Mar 2022, 15:02 Reply Quote 0
                      • undefined
                        p8blr @dc42
                        last edited by 16 Mar 2022, 15:02

                        @dc42 Would it be wise to attempt to update the bootloader over CAN now that I have it connected?

                        undefined 1 Reply Last reply 16 Mar 2022, 16:21 Reply Quote 0
                        • undefined
                          dc42 administrators @p8blr
                          last edited by 16 Mar 2022, 16:21

                          @p8blr only if you want to. My guess is that the bootloader has installed OK but cannot be read back via the ICE because the MCU thinks the security bit is set.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          10 out of 12
                          • First post
                            10/12
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA