Code Not Running After Upload [SOLVED]

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

I'm excited to be able to move forward with developing on a new microcontroller (ATSAM4S4A-MU). It's been a fun run, and I'm finally starting to get the hang of it. However I've been having two issues so far:

1) Code I upload to the chip wont run without first disconnecting and then re-connecting power. Is there any way to fix this so it runs right after upload?

2) I have implemented the USB CDC example on this chip and I was successfully able to toggle some LED's on my board over UART. However, the device disconnects and then reconnects after only a few seconds whether I'm using the bus or not. HOWEVER, I am able to get it to run without disconnecting at all when I use AS7's debug feature. I have ruled the possibility of an electrical issue as the device will still disconnect when the ICE programmer is hooked up but not debugging. Also, when I start debugging and then disconnect the ICE programmer the program runs stable as well. My figuring is that it has to do with some sort of state the device is left in after programming (like not being reset properly). Any advice?

Specs: Win10, Atmel ICE, AS7, ATSAM4S4A-MU.

Code (the code editor isn't working sorry for the crappy screenshot). Initially I posted this in AVRFreaks so sorry for the double post.

 

Solution: Nobody tells you that the watch dog timer is enabled by default. Disable the WDT to get things to work.

 

 

Attachment(s): 

;Conrad Farnsworth

Last Edited: Tue. Mar 27, 2018 - 03:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I have the same issues. After uploaded with ICE programmer the code is not running and finding way to fix this.
I try to set the configuration of the ICE programmer but not work, I think something wrong about configs.
Right now, I use re-connecting power to running code. But is not work in mass production.​​​​​​​
Specs: Win10, Atmel ICE, AS7, ATSAMR35J18B.

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

parinyaonline wrote:
Hi, I have the same issues.

If it's the same issue, then it will have the same solution - so have you done that?

 

 

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...