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
Program: 4750 bytes (1.8% Full)
(.text + .data + .bootloader)
Data: 308 bytes (1.9% Full)
(.data + .bss + .noinit)
Any ideas would be appreciated.