Problems with xboot on Xmega 128A1

57 views
Skip to first unread message

Loksorr

unread,
Jul 20, 2012, 6:56:12 AM7/20/12
to avr-...@googlegroups.com
Ok I am uncertain about this, so I'm asking around if anybody has any ideas.  I have encourted a strange bug and I cant really pinpoint what is going on.
Basicaly I have a program that runs on Xmega. It basically runs some DMX chanels. Changing colours on button press(PortA) and runs a simple "animation". The main function uses timer(TCE0) to clock the animation.

But here is my problem. If there are more than 2 buttons, the animation simply fails to run after program, even after reset(or powerdown). The butons still work mind you. But sometimes if you wait for long enough(5-10 min) and then reset the device it works. No matter how many resets you trigger after that. 
If I program the MCU with AVRISP mk2 it works. Now I am pretty certain it is my code, but I have no idea where to look  ... 

Any ideas?


Alex Forencich

unread,
Jul 20, 2012, 2:01:12 PM7/20/12
to avr-...@googlegroups.com
It works if you wait 5 minutes and reset it? That is very strange. I
have to say, I have no idea what could be causing that. Is that 5
minutes powered or unpowered? Are all your variables initialized? Does
the compiler produce any warnings? What other components are on the
board? Are you using interrupts?

Alex Forencich
> --
> You received this message because you are subscribed to the Google
> Groups "avr-xboot" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/avr-xboot/-/k-xa6FKx2LAJ.
> To post to this group, send email to avr-...@googlegroups.com.
> To unsubscribe from this group, send email to
> avr-xboot+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/avr-xboot?hl=en.

Loksorr

unread,
Jul 21, 2012, 7:12:10 AM7/21/12
to avr-...@googlegroups.com

The 5 min is powered. I can't say, that all of the variables are initialized. But I'll fine coumb throu it. The compiler does not produce any warnings.
The components:
4 X RS232 modules. Each on separate USART. If the system works all work.
1 X RS486 module on USART
1 X USB to USART (Com port emulation)
A few leds and buttons and usual stuff, programing port, step down, 2X voltage regulator, ...
(The full code fills 40% of xmega, but lowering the amount doesn’t seem to solve the problem. Most of that are some rather large tables, accessed with pgm_readword method. Could that be the problem?)

But the problem started after ading the part I expected the least problems from. Buttons...

All RS232 use interrupts. But the peripherals are not connected, so they shouldn’t happen. And interrupt for TCE0.


Even if I comment out the interrupts the problem remains. (I use #if in code, could that somehow mess it up?)


The uninitialized variables seem the best explanation right now. So I'll focus on those. Or something overriding TCE0 somehow.


Cheers.




Dne petek, 20. julij 2012 20:01:12 UTC+2 je oseba alex.forencich napisala:
> avr-xboot+unsubscribe@googlegroups.com.

Bradley Nelson

unread,
Jul 21, 2012, 12:33:10 PM7/21/12
to avr-...@googlegroups.com

Are you reusing one of the USARTS for XBoot programming?  I had issues with that at one point, where latent register settings from XBoot messed with the main program.

Also - are you using the interrupts option in XBoot?  I haven't looked at recent releases of XBoot, but if interrupts aren't being set from boot interrupt vectors back to main interrupt vectors, you could see similar issues.

Just throwing ideas in the mix - good luck.

Brad

To view this discussion on the web visit https://groups.google.com/d/msg/avr-xboot/-/F8xpTT13pmMJ.

To post to this group, send email to avr-...@googlegroups.com.
To unsubscribe from this group, send email to avr-xboot+...@googlegroups.com.

Loksorr

unread,
Jul 23, 2012, 6:41:55 AM7/23/12
to avr-...@googlegroups.com
Well. It now works (For now...) Try as I might I can't reproduce the error. After a couple of tests with burning with xboot and AVRISP it just picked itself up and I can't reproduce it now. (Even when undoing the code and compiling it...) So for now I'm chucking this to something to do with my program until I can recreate it.

Thanks for all the help.

PS. I am reusing the xboot USART in my program, but I had no problem before. 


Dne sobota, 21. julij 2012 18:33:10 UTC+2 je oseba Bradley Nelson napisala:
Reply all
Reply to author
Forward
0 new messages