SAMD21 - Constant Resetting

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all, 

 

I was investigating the use of Schumatech's BOSSA to program my Adafruit Feather M0 with RFM69 Packet Radio (SAMD21 MCU) without the use of the Arduino IDE. I have confirmed my USB cable is reliable through multiple uses of the IDE. 

 

After performing an erase using the BOSSA tool my device (tried this on two) fell into a mode where when a double click on the RESET button was registered it would (while the LED did the typical bootload pulse) mount to my PC then immediately dismount (I have attached an image of the problem). Following this, the LED would flash at a steady rate. This can all be seen in this video here.

 

I was then under the impression I may have potentially erased the bootloader, so I decided to undertake the process of Restoring the Bootloader using Atmel Studio and a J-Link. I have been able to erase then re-program the bootloader using the SWD interface (remembering to disable the BOOT_PROT fuse). However, now a different issue is prevalent with the device mounting and dismounting constantly. I attempted to enter the bootloader via the manual (double click reset) method and it seems to have done this correctly (pulsing LED), however, the device appears to be dismounting from my PC constantly. Both these issues can be seen in this video here. I also feel it's important to note that when (even erased) I am unable to use the J-Link consistently, for example: if I were to repeatedly erase (or any command: program, verify, program fuses, etc) the MCU only a few would go through. It seems as if the device is constantly resetting itself.

 

With this thought I went and looked at the voltage supply to the MCU, a constant 3V3 from the regulated USB 5V. To confirm this I supplied 3V3 directly from my power supply - the same issues continued to occur. I then assessed the reset button to determine if this was being pulled low for whatever reason - it's not. I think this eliminates a power-on reset issue.

 

Overall, I am not sure where to go from here as I am fairly confident there is no issue with the bootloader firmware. Have I caused a problem with the hardware? Any help at all is greatly appreciated.

 

Thank you,

 

JS

 

EDIT:

 

Hello again,

 

I have done some additional testing. I have modified my linker script to not include an offset for the bootloader (application will be entered immediately on boot). I then program my application (Blink example) and the application is entered (LED turns on) but then it is reset almost immediately. It's evident that there is a hardware issue that is constantly pulling the MCU into reset. Does anyone have any ideas as to what could be the issue?

 

Thanks,

 

JS

This topic has a solution.
Last Edited: Thu. Mar 18, 2021 - 09:10 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I have been able to determine the issue to my problem. When I erased the bootloader with Bossa and reprogrammed using Atmel Studio 7 the fuses had been modified. Either one of the aforementioned either enabled the Watchdog or decreased its period. This resulted in the bootloader not kicking the Watchdog, issuing a reset. I was able to fix this by modifying the WDT_EN/WDT_ALWAYS_ON Fuses in Atmel Studio 7.

 

Thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's good to hear - and thanks for feeding back the solution.

 

Now please mark the solution - see Tip #5 in my signature, below:

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...