 |
| Author |
Message |
|
|
Posted: Jul 09, 2012 - 03:55 PM |
|


Joined: Jul 18, 2011
Posts: 27
Location: Kouvola, Finland
|
|
I do new project with Atmel Studio 6. I have STK600 with Xmega128D3 device. File -> New Project (Atmel Boards) there isn't STK600 with Xmega128D3, so I select Xmega192D3.
Then I do my project, compile and program it to device. I didn't get any errors (or Warnings), but program didn't work.
Then I try to debug it with JTAG ICE. Then I got error "Unable to to start debug session" and nothing useful information.
I do a LOT of work and then I noticed, I haven't change right device type! Why Atmel Studio can't notice wrong device type (programming device)? And when it noticed (Debug), why it can't say it cleary, only cryptic error code.
JKo |
|
|
| |
|
|
|
|
|
Posted: Nov 13, 2012 - 04:23 PM |
|

Joined: Oct 31, 2012
Posts: 2
Location: Kyiv, Ukraine
|
|
Hi guys,
I can confirm that this issue exists in AS6.
In my case initially I created project (C executable) with device type Atmega328.
As I own Atmega328p device I changed later device type in my project to Atmega328p, compiled successfully (without compilation errors) and programed MCU.
With great surprise I found that program didn't work (it was quite easy - LED blinking with timer).
Recompilation program in WinAVR solved my problem (and later I created new project with device Atmega328p - also with success). When I compared assembler source (generated by AS6 in first project and with WinAVR) I saw that these two versions of same program compiled for the same MCU type Atmega328p (as I thought) use different start SRAM address for global variables:
- in first program (compiled with AS6 after changing device type from Atmega328 to Atmega328p ) address 0x60 is used
- in second program (compiled in WinAVR) address 0x100 is used
IMHO it is a Atmel Studio 6 bug, so be carefull when changing device type in your projects.
Regards,
Oleg |
|
|
| |
|
|
|
|
|
Posted: Nov 13, 2012 - 08:27 PM |
|

Joined: Oct 31, 2012
Posts: 2
Location: Kyiv, Ukraine
|
|
I have found what produced this strange behavior (ignoring changing device type) in my case - I enabled option "Garbage collect unused sections" in Optimization section of AVR/GNU Linker (as suggested in document regarding compilation arduino library under Atmel Studio).
As I discovered this enabled option force compiler to use SRAM from address 0x60 (without regard to chosed MCU type).
So it is not a AS6 bug, it is my fault. |
|
|
| |
|
|
|
|
|
|
|