I was looking for the programmer option for the CW-Lite target board, and I ran the XMEGAProgrammer.py file, which promptly erased my target.
I want to program it back, but I need the hex file. I think I found the source code in hardware/victims/firmware/xmega-serial. The get_crypto.sh script didn’t work for me, but I figured it out, and managed to get it to build.
However, if I change the target to atxmega128d4 in the makefile, it won’t compile:
avr-gcc -c -mmcu=atxmega128d4 -I. -gdwarf-2 -DAVRCRYPTOLIB -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/simpleserial.lst -I../crypto/avr-crypto-lib/aes -I../crypto -std=gnu99 -MMD -MP -MF .dep/simpleserial.o.d simpleserial.c -o objdir/simpleserial.o
In file included from simpleserial.c:21:0:
AES_driver.h:135:33: error: unknown type name 'AES_INTLVL_t'
AES_INTLVL_t int_lvl);
^
AES_driver.h:138:29: error: unknown type name 'AES_INTLVL_t'
void AES_interruptlevel_set(AES_INTLVL_t int_lvl);
^
In file included from simpleserial.c:22:0:
../crypto/aes-independant.h:33:1: warning: multi-line comment [-Wcomment]
//#define DEFAULT_KEY 0x1f,0x3e,0xa0,0x47,0x76,0x30,0xce,0x21, \
^
In file included from simpleserial.c:21:0:
simpleserial.c: In function 'main':
AES_driver.h:108:39: error: 'AES' undeclared (first use in this function)
#define AES_software_reset() ( AES.CTRL = AES_RESET_bm )
^
simpleserial.c:103:2: note: in expansion of macro 'AES_software_reset'
AES_software_reset();
^
AES_driver.h:108:39: note: each undeclared identifier is reported only once for each function it appears in
#define AES_software_reset() ( AES.CTRL = AES_RESET_bm )
^
simpleserial.c:103:2: note: in expansion of macro 'AES_software_reset'
AES_software_reset();
^
AES_driver.h:108:50: error: 'AES_RESET_bm' undeclared (first use in this function)
#define AES_software_reset() ( AES.CTRL = AES_RESET_bm )
^
simpleserial.c:103:2: note: in expansion of macro 'AES_software_reset'
AES_software_reset();
^
makefile:585: recipe for target 'objdir/simpleserial.o' failed
Am I using the right code and target? Do I need to change something else?