Possible bug in Atmel Studio with Xmega debugging?

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

Hi,

 

I am currently trying to get the Contiki OS running on an ATxmega256A3U (AVR Dragon programming tool).  It is currently not supported by the OS, so I am in the process of porting and have got it compiling both under Linux and Atmel Studio 7 using the external makefile feature.  And I am am able to program the output file in both AVRDUDE under Linux and from with Atmel Studio under the Tools -> Device Programming menu item.

 

But when I try to launch a debug session, it "erases the device", and starts "loading the executing", but doesn't pass 0% on the loading and I get the following error in a popup message box:

       Error to launch program

       Error: Error writing to memory at 00000000-00000003

 

I was initially compiling using Cygwin/Atmel Studio and getting this error and thought it was because the file paths in the debug symbols in the executable where cygwin/linux paths not windows style ones and it didn't like it, so got it compiling in Atmel Studio but then hit this road block.

 

I am trying to do in Atmel Studio because avarice does not support xmega devices, so this seems to make it impossible to launch a debug session under Linux.  But have no idea why I am getting this error.

 

All the object files get created with commands similar to the following:

 

avr-gcc -DCONTIKI=1 -DCONTIKI_TARGET_=1 -DNETSTACK_CONF_WITH_RIME=1  -DUIP_CONF_IPV6_RPL=0 -Wall -mmcu=atxmega256a3u -gdwarf-2 -fno-strict-aliasing -DF_CPU=8000000UL -DAUTO_CRC_PADDING=2 -Os -ffunction-sections -fdata-sections -MMD -c ..\..\platform\wireless-node\.\slip_uart_e1.c -o obj_wireless-node\slip_uart_e1.o

 

 

And Linked together with

 

avr-ar rcf contiki-wireless-node.a obj_wireless-node\slip_uart_e1.o ....

 

avr-gcc -DCONTIKI=1 -DCONTIKI_TARGET_=1 -DNETSTACK_CONF_WITH_RIME=1  -DUIP_CONF_IPV6_RPL=0 -Wall -mmcu=atxmega256a3u -gdwarf-2 -fno-strict-aliasing -DF_CPU=8000000UL -DAUTO_CRC_PADDING=2 -Os -ffunction-sections -fdata-sections -mmcu=atxmega256a3u -Wl,-Map=contiki-wireless-node.map -Wl,--section-start=.bootloader=0x1F800 -Wl,--gc-sections -o wireless-node.elf wireless-node.co symbols.o contiki-wireless-node.a 

 

 

AVR Memory Usage
----------------
Device: atxmega256a3u

Program:    4750 bytes (1.8% Full)
(.text + .data + .bootloader)

Data:        308 bytes (1.9% Full)
(.data + .bss + .noinit)

 

 

Any ideas would be appreciated.

 

Thanks, Martin

 

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

777veg777 wrote:
I am trying to do in Atmel Studio because avarice does not support xmega devices, so this seems to make it impossible to launch a debug session under Linux.
Might not take much effort to add XMEGA256A3U to AVaRICE.

https://sourceforge.net/p/avarice/code/HEAD/tree/trunk/avarice/doc/avarice.1

...

currently has support for the following devices:

...

atxmega256a3

...

 

"Dare to be naïve." - Buckminster Fuller

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

By default, starting a debug session causes the image to be programmed into flash prior to entering debug mode.  This can be disabled by going to Project -> Properties -> Tool and setting Programming settings to Skip programming:

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

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

Thanks guys! Both are great suggestions.  

 

I did the "Skip Programming" and seemed to get me debugging straight away!  But will probably still have a look at avarice at some point as I do much prefer Linux over Windows.

 

Muchly appreciated!!

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

I did the "Skip Programming" and seemed to get me debugging straight away!

Of course any changes made to your code will also be "skipped" unless you manually program the chip after every change.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly