As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com. |
Difference between revisions of "Building for XMEGA"
(Tag: VisualEditor) |
|||
Line 4: | Line 4: | ||
<ol style="list-style-type: decimal;"> | <ol style="list-style-type: decimal;"> | ||
− | <li>We want to use the existing SimpleSerial firmware as a base for our project, but we don't want to edit the existing firmware. Instead, we'll make a new project with a copy of this firmware. Copy the directory of the firmware you want to modify in the <code>chipwhisperer/hardware/vicitims/firmware</code> to a new folder. For example, if you want to modify the <code>simpleserial-base</code> firmware, copy the contents of the <code>simpleserial-base</code> folder to a new one. The name is arbitrary, but for this example, we'll call it <code>simpleserial-base-lab1</code>. You must keep it in the same directory, as it will reference other files within that directory for the build process.</li> | + | <li>We want to use the existing SimpleSerial firmware as a base for our project, but we don't want to edit the existing firmware. Instead, we'll make a new project with a copy of this firmware. Copy the directory of the firmware you want to modify in the <code>chipwhisperer/hardware/vicitims/firmware</code> to a new folder. For example, if you want to modify the <code>simpleserial-base</code> firmware, copy the contents of the <code>simpleserial-base</code> folder to a new one, while if you want to modify <code>simpleserial-aes</code>copy that folder instead. The name is arbitrary, but for this example, we'll call it <code>simpleserial-base-lab1</code>. You must keep it in the same directory, as it will reference other files within that directory for the build process.</li> |
− | <li | + | <li>Open a terminal with avr-gcc in the path. If using Windows the sidebar on the [[Installing_ChipWhisperer]] page - you can either add WinAVR to your system path, or you can run the 'winavr.bat' file suggested. |
− | + | ||
</li> | </li> | ||
<li><p>Change the terminal to the newly copied directory. For example:</p> | <li><p>Change the terminal to the newly copied directory. For example:</p> |
Revision as of 14:29, 28 September 2018
You'll need to have installed avr-gcc and avr-libc. You may have already done this by following the installation guide, or if using the ChipWhisperer-VM it comes prepared with avr-gcc already setup. See the Installing_ChipWhisperer guide for details.
Once you have a working compiler (check by typing 'avr-gcc' at the command line - if using Windows you may need to setup a special batch file to provide you with a avr-gcc command prompt).
- We want to use the existing SimpleSerial firmware as a base for our project, but we don't want to edit the existing firmware. Instead, we'll make a new project with a copy of this firmware. Copy the directory of the firmware you want to modify in the
chipwhisperer/hardware/vicitims/firmware
to a new folder. For example, if you want to modify thesimpleserial-base
firmware, copy the contents of thesimpleserial-base
folder to a new one, while if you want to modifysimpleserial-aes
copy that folder instead. The name is arbitrary, but for this example, we'll call itsimpleserial-base-lab1
. You must keep it in the same directory, as it will reference other files within that directory for the build process. - Open a terminal with avr-gcc in the path. If using Windows the sidebar on the Installing_ChipWhisperer page - you can either add WinAVR to your system path, or you can run the 'winavr.bat' file suggested.
Change the terminal to the newly copied directory. For example:
Windows:cd c:\chipwhisperer\hardware\victims\firmware\simpleserial-base-lab1
Linux/macOS:cd chipwhisperer/hardware/victims/firmware/simpleserial-base-lab1
Then, run
make
to build the system. Make sure you specify which platform you're using as your target. For example, for the ChipWhisperer Lite target, runmake PLATFORM=CW303
Which should have the following output:
...Bunch of lines removed... Creating Extended Listing: simpleserial-base.lss avr-objdump -h -S -z simpleserial-base.elf > simpleserial-base.lss Creating Symbol Table: simpleserial-base.sym avr-nm -n simpleserial-base.elf > simpleserial-base.sym Size after: AVR Memory Usage ---------------- Device: atxmega128d3 Program: 1524 bytes (1.1% Full) (.text + .data + .bootloader) Data: 224 bytes (2.7% Full) (.data + .bss + .noinit) Built for platform CW-Lite XMEGA -------- end --------
Ensure that the "Built for platform ___" matches your target device.