| Author |
Message |
|
|
Posted: Dec 21, 2011 - 04:41 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
I have built a few hundred Xprotolabs, using the ATXMEGA32A4U. After programming them, about 5 to 10% are not entering the USB bootloader.
In the bootloader code, I turn on a red LED during USB activity, and turn it off in the main(). When the bootloader enters normally, the LED looks dim (really turning on and off every 1ms). When the bootloader fails, the LED seems to blink, and I get a message from Windows about and unrecognized USB device.
I replaced the micro on a board, and the bootloader worked.
Thoughts? |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Dec 22, 2011 - 02:30 AM |
|


Joined: Dec 11, 2007
Posts: 6980
Location: Cleveland, OH
|
|
I would have the software, at least for now for testing, output the clock on a pin.
I would check the clock on several working units, and on the failed units in particular.
Do the failed units work if you retry them, or try them on another CPU?
JC |
|
|
| |
|
|
|
|
|
Posted: Dec 22, 2011 - 04:58 AM |
|

Joined: Jan 09, 2007
Posts: 1919
Location: Arlington, Texas, U.S.A.
|
|
Also check power and reset and compare against the specs.
Some MCUs state a minimum and maximum rise-time for power and a minimum reset duration (noted the order-of-magnitude in the XMEGA A4U's reset duration spec).
If there's a reset anomaly that could get the MCU into an indeterminate state.
It may be running before the power has stabilized; check the BOD level and compare power versus reset versus time. |
|
|
| |
|
|
|
|
|
Posted: Dec 22, 2011 - 10:40 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
| Only the bootloader fails, the application code works as expected. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Dec 23, 2011 - 06:18 PM |
|

Joined: Sep 07, 2004
Posts: 2564
Location: New York State
|
|
How does the bootloader determine if it should wait for the hex file or jump to the application?
Does it check a pin, or wait for a specified time? |
|
|
| |
|
|
|
|
|
Posted: Dec 24, 2011 - 03:54 AM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
| I am using the bootloader provided by Atmel. I just inserted two lines of code to show USB activity with an LED. To enter the bootloader, I need to press a button during power up. Jumping to the application is later done with a command from the PC. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Dec 24, 2011 - 09:12 AM |
|


Joined: Jul 18, 2005
Posts: 62939
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
What happens if you switch to using Dean's DFU clone?
EDIT: oh wait, xmega, perhaps not then.. |
_________________
|
| |
|
|
|
|
|
Posted: Dec 24, 2011 - 09:37 AM |
|

Joined: Jan 09, 2007
Posts: 1919
Location: Arlington, Texas, U.S.A.
|
|
|
ganzziani wrote:
... during power up.
USB needs about 3v to be per spec; if I read the XMEGA datasheet correctly, it'll start running at about 1.6v.
I'd recommend reset active (or a greater BOD level?) until the voltage regulator to the XMEGA indicates power good. |
|
|
| |
|
|
|
|
|
Posted: Dec 24, 2011 - 07:43 PM |
|

Joined: Sep 07, 2004
Posts: 2564
Location: New York State
|
|
|
ganzziani wrote:
I am using the bootloader provided by Atmel.
There has been a bootloader floating around here for a few years sometimes called the AVR1605 bootloader. It probably has nothing to do with the one you are using, but I thought I'd mention it.
In the copy I downloaded there was a bunch of code at the beginning of main.c that set a bunch of pins in various configurations. This code didn't belong there and was setting pins without regard to the user's configuration. I think it could screw up the pin used to enter the bootloader, depending on which pin the user chose. Part of my cleanup of that program was to remove that code.
Actually now that I've thought about it, the bootloader entry pin wasn't working at all for me when I tried to use it 2 years ago. I don't think it was the extraneous code in main.c though. The pullup wasn't being activated. The code that was supposedly enabling the pullup didn't look right to me. I changed it to enable the pullup the way I know how to do it, and it's been working ever since. |
|
|
| |
|
|
|
|
|
Posted: Dec 26, 2011 - 12:03 AM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
Does the user application work *with USB*? It could be a short in the USB lines that is only affecting the code when the USB module is activated, or it could be something defective about the chip - for example, perhaps the signature row's 48MHz PLL calibration constant is missing or invalid.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Dec 26, 2011 - 12:59 AM |
|

Joined: Sep 07, 2004
Posts: 2564
Location: New York State
|
|
| Does it work okay when you are using a JTAGICE debugger? |
|
|
| |
|
|
|
|
|
Posted: Jan 13, 2012 - 05:18 AM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
|
gchapman wrote:
I'd recommend reset active (or a greater BOD level?) until the voltage regulator to the XMEGA indicates power good.
BOD is set at 3.0V, I also tried with 2.8V
steve17 wrote:
Does it work okay when you are using a JTAGICE debugger?
Nope, same behavior.
abcminiuser wrote:
Does the user application work *with USB*?
My application still does not have USB functionality... (crossing my fingers for a quick LUFA port... )
abcminiuser wrote:
It could be a short in the USB lines that is only affecting the code when the USB module is activated
I don't suspect it is the hardware, as replacing the micro made the bootloader work.
abcminiuser wrote:
it could be something defective about the chip - for example, perhaps the signature row's 48MHz PLL calibration constant is missing or invalid
I just checked the calibration data done at the factory, seems to be normal data, but I can try to mess with it. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Jan 13, 2012 - 03:11 PM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
We have the same problem here.
Bootloader fails, but application with USB runs fine.
Unfortunately Atmel don't add any project information in the bootloader's zip file.
I will setup a project soon and try to debug the bootloader to see what's going wrong. |
|
|
| |
|
|
|
|
|
Posted: Jan 13, 2012 - 05:19 PM |
|

Joined: Jan 09, 2007
Posts: 1919
Location: Arlington, Texas, U.S.A.
|
|
|
ganzziani wrote:
I am using the bootloader provided by Atmel. I just inserted two lines of code to show USB activity with an LED.
Which compiler did Atmel use to make their bootloader? Which compiler did you use to make your bootloader? Reason: There was an AVR bootloader that had to be compiled with the IAR AVR C compiler.
Sometimes one's electronics work better with a cell/battery. On a malfunctioning board, use a fresh CR2032 instead of the voltage regulator to power the XMEGA; use RESET via a pushbutton switch to enter the bootloader. Reason: sometimes USB power is too noisy (ferrite bead(s)?) due to inadequate AC/DC or DC/DC buck converter. |
|
|
| |
|
|
|
|
|
Posted: Jan 13, 2012 - 07:01 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
|
gchapman wrote:
Which compiler did Atmel use to make their bootloader? Which compiler did you use to make your bootloader?
The bootloader is meant to be compiled specifically with IAR. I used the free IAR kickstart version that allows programs up to 4k to be compiled (4k is just the size of the bootloader). |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 08:07 AM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
I took a defective unit and I tried the USB mass storage demo from the ASF, it works correctly, I get this message from windows upon programming:
USB Mass Storage Device - Ready to use
ATMEL "AT45DBX Data Fl USB Device - Ready to use
These are the calibration values from a defective part:
USBCAL0: 0x7E
USBCAL1: 0xF0
USBRCOSC: 0x1B
USBRCOSCA: 0x40
I tried reprogramming the bootloader again, and the problem persists, windows reports USB device not recognized.
What I am doing so far in production is to just replace the micros on the defective units, which is about 5% of the total. Of course, after replacing the chips, 5% of those fail again...
I am contacting Atmel support. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 08:17 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
Hi ganzziani,
i have setup an IAR project but the linker fails with the message "Too much object code ...".
There is no furter information in the linkers map file.
Can you give me an hint ?
Our disctributor has contact Atmel last week. No response until now.
Thanks Rainer |
|
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 02:48 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
| Hey Rainer, I don't remember running into any problems, I think I just opened the project located in:
Code:
C:\asf-2.8.1\common\services\usb\class\dfu_flip\device\bootloader\xmega\atxmega32a4u\iar
and compiled ok... |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 03:20 PM |
|


Joined: Jul 18, 2005
Posts: 62939
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
| Code that produces "too much object code" is often when insufficient optimisation has been specified, I imagine this could be as true for IAR as it is for GCC as they both have very agrressive optimisers. |
_________________
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 04:46 PM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
I received your support request yesterday ganzziani, but as I didn't have any more ideas I passed it along to the USB specialty group. They should have some more information about it, but they might want a sample unit to run some tests.
Damned odd that it fails only in the bootloader -- perhaps the release binaries aren't quite right for some reason. I tried to recompile it from the latest SVN today, but I got some other compile issues related to my particular setup and not the code itself.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 05:38 PM |
|

Joined: Aug 20, 2005
Posts: 1109
Location: Pool of Goo
|
|
so to be clear here..
To compile and/or modify the ATmel avr bootloaders as supplied in the ASF, one MUST install the IAR Kickstart edition on their pc and then use the IAR IDE/compiler?
If that is true... if AS5 is as the ATmel marketing/development team wants us to believe the "do all solution" for AVR's...one might ask why doesn't ATmel provide bootloader projects for the AVR chips to be compiled in AS5 error free and without the use of another compiler/ide?
missing something? |
|
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 07:45 PM |
|


Joined: Jul 18, 2005
Posts: 62939
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
If that is true... if AS5 is as the ATmel marketing/development team wants us to believe the "do all solution" for AVR's...one might ask why doesn't ATmel provide bootloader projects for the AVR chips to be compiled in AS5 error free and without the use of another compiler/ide?
They used to be an IAR house and all their code was written in IAR. They have switched allegiance to GCC (because they are building it into AS5) but that doesn't suddenly translate all existing legacy code from IAR to GCC |
_________________
|
| |
|
|
|
|
|
Posted: Jan 18, 2012 - 07:55 PM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
|
Quote:
They used to be an IAR house and all their code was written in IAR. They have switched allegiance to GCC (because they are building it into AS5) but that doesn't suddenly translate all existing legacy code from IAR to GCC
The XMEGA bootloader is IAR for size reasons at this stage I believe, although I'm sure it'll be ported to GCC in the future. ASF code is supposed to be compiler agnostic, although I'm not sure what the requirements for the applications are.
- Dean  |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Jan 19, 2012 - 07:15 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
Hi ganzziani,
i used "http://www.atmel.com/dyn/resources/prod_documents/AVR1916.zip" which doesn't contain any project information. So i created the project by myself.
Thanks for the hint with the asf.
Rainer |
|
|
| |
|
|
|
|
|
Posted: Jan 19, 2012 - 07:43 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
The current Kickstart version 6.11 has a problem with the project in asf 2.10 and asf 2.8.
It often fails with an "Tool Internal error" during compiling.
Rainer |
|
|
| |
|
|
|
|
|
Posted: Jan 19, 2012 - 11:08 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
After one succesfull build i was able to upload a non modified debug version of the bootloader (asf 2.10) to the controller for debugging with IAR and JTagICE3.
Now the device is allways recognized by Windows as Atmel USB Device Atxmega32A4U.
We get a small batch of 50 boards in about 2 week. I will do more test than.
Maybe we get a feedback from Atmel before. |
|
|
| |
|
|
|
|
|
Posted: Jan 31, 2012 - 08:21 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
We tested 10 further boards with bootloader 1.02.
2 boards are ok, 8 boards fails.
Our own USB application works on all 10 boards.
Is anybody else using this bootloader on the 32A4U device ?
Thanks and regards
Rainer |
|
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 09:47 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
We have now tested 50 boards.
The bootloader (ASF 2.10) fails on 2 boards.
If we test them in a climate cabinet at temperatures above 40 degree both boards work fine.
Other boards, which are ok at 20 degree, fails at temperatures below 10 degree.
One board works ok at -10 and +60 degree.
(It's to much work to test all boards in this range)
The statment "fail" relate only to the function of the USB bootloader. |
|
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 11:42 AM |
|

Joined: Sep 07, 2004
Posts: 2564
Location: New York State
|
|
| It seems strange that the USB bootloader fails but the USB works okay otherwise. Any theories on how that could be? |
|
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 12:17 PM |
|


Joined: Sep 23, 2002
Posts: 292
Location: New Hampshire
|
|
| Just a theory, but perhaps the bootloader isn't configuring the DFLL to sync the clock to the USB SOF? It's the temperature dependence that makes me think it could be this. I don't have access to the ASF on this computer, or I'd check. |
|
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 01:07 PM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
Try changing sysclk_opt.c so that the DFLL calibration values are loaded from the signature row correctly - seems they use a hard-coded value which may be incorrect for some parts.
- Dean
EDIT: Passed this on to the USB team, they agree this is probably the source of the problem. |
_________________ Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 06:18 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
| I received a response to my Atmel support ticket, they received one of my boards with a defective bootloader and found out that the calibration values where not loaded. They will update the bootloader code soon. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Feb 06, 2012 - 06:34 PM |
|


Joined: Jan 23, 2004
Posts: 9878
Location: Trondheim, Norway
|
|
|
|
|
|
|
Posted: Feb 06, 2012 - 06:47 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
|
|
|
|
|
Posted: Mar 15, 2012 - 11:13 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
| Has anyone get an update from Atmel regarding this topic ? |
|
|
| |
|
|
|
|
|
Posted: Mar 15, 2012 - 01:26 PM |
|


Joined: Jun 16, 2006
Posts: 621
Location: Sarasota, FL
|
|
| Yes, it is fixed. Although I got the source code files directly from support. They told me that the fix will be available on the next ASF release. PM me if you want me to send you the files I have. |
_________________ www.gabotronics.com
|
| |
|
|
|
|
|
Posted: Mar 16, 2012 - 11:38 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
Hi ganzziani,
thanks for the information. I have send you a pm. |
|
|
| |
|
|
|
|
|
Posted: Mar 20, 2012 - 08:28 AM |
|

Joined: Apr 05, 2007
Posts: 20
Location: Germany
|
|
| Thanks for the code. I have tested it with 2 "faulty" boards and now they are ok. |
|
|
| |
|
|
|
|
|