As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

Changes

Jump to: navigation, search

Tutorial B1 Building a SimpleSerial Project

5,943 bytes removed, 14:33, 28 September 2018
no edit summary
<h2> Building the Basic Example </h2>
<h3> {{CollapsibleSection|intro = === Building For the for CWLite with XMEGA Target </h3>===|content= Building for XMEGA}}
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.{{CollapsibleSection 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). <ol style|intro = =="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 <code>simpleserial-base</code> which is found at <code>chipwhisperer/hardware/victims/firmware/</code> of the chipwhisperer release to a new directory called <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><dl><dt>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.</dt></dl></li><li><p>Change the terminal to the newly copied directory. For example:</p>Windows:<pre>cd c:\chipwhisperer\hardware\victims\firmware\simpleserial-base-lab1</pre>Linux/macOS:<pre>cd chipwhisperer/hardware/victims/firmware/simpleserial-base-lab1</pre></li><li><p>Then, run <code>make</code> to build the system. Make sure you specify which platform you're using as your target. For example, for the ChipWhisperer Lite target, run</p><pre>make PLATFORM=CW303</pre><p>Which should have the following output:</p><pre>...Bunch of lines removed...Creating Extended Listing: simpleserial-base.lssavr-objdump -h -S -z simpleserial-base.elf &gt; simpleserial-base.lss Creating Symbol Table: simpleserial-base.symavr-nm -n simpleserial-base.elf &gt; 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 --------</pre></li>Ensure that the "Built for platform ___" matches your target device.</ol> <h3> Building for the ARM CWLite with Arm Target </h3>You'll need to have installed the GNU Embedded Toolchain for ARM. If you haven't yet, see the [[Installing_ChipWhisperer]] guide, specifically the '''Installing ARM Toolchain''' section, for details. Once you have a working compiler (check by typing 'arm-none-eabi-gcc' at the command line). <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 <code>simpleserial-base</code> which is found at <code>chipwhisperer/hardware/victims/firmware/</code> of the chipwhisperer release to a new directory called <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><dl><dt>Open a terminal with arm-none-eabi-gcc in the path. If using Windows the sidebar on the [[Installing_ChipWhisperer]] page</dt></dl></li><li><p>Change the terminal to the newly copied directory. For example:</p>Windows:<pre>cd c:\chipwhisperer\hardware\victims\firmware\simpleserial-base-lab1</pre>Linux/macOS:<pre>cd chipwhisperer/hardware/victims/firmware/simpleserial-base-lab1</pre></li><li><p>Then, run <code>make</code> to build the system. Make sure you specify which platform you're using as your target. For example, for the ChipWhisperer Lite target, run</p><pre>make PLATFORM=CWLITEARM CRYPTO_TARGET=TINYAES128C</pre><p>Which should have the following output:</p><pre>...Bunch of lines removed...Linking: simpleserial-base-CWLITEARM.elfarm-none-eabi-gcc -mcpu|content=cortex-m4 -I. -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DTINYAES128C -DF_CPU=7372800UL -Os -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir/simpleserial-base.o -I.././simpleserial/ -I.././hal -I.././hal/stm32f3 -I.././hal/stm32f3/CMSIS -I.././hal/stm32f3/CMSIS/core -I.././hal/stm32f3/CMSIS/device -I.././hal/stm32f4/Legacy -I.././crypto/ -I.././crypto/tiny-AES128-C -std=gnu99 -MMD -MP -MF .dep/simpleserial-base-CWLITEARM.elf.d objdir/simpleserial-base.o objdir/simpleserial.o objdir/stm32f3_hal.o objdir/stm32f3_hal_lowlevel.o objdir/stm32f3_sysmem.o objdir/aes.o objdir/aes-independant.o objdir/stm32f3_startup.o --output simpleserial-base-CWLITEARM.elf --specs=nano.specs -T .././hal/stm32f3/LinkerScript.ld -Wl,--gc-sections -lm -Wl,-Map=simpleserial-base-CWLITEARM.map,--cref -lm.Creating load file Building for Flash: simpleserial-base-CWLITEARM.hexarm-none-eabi-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature simpleserial-base-CWLITEARM.elf simpleserial-base-CWLITEARM.hex.Creating load file for EEPROM: simpleserial-base-CWLITEARM.eeparm-none-eabi-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \ --change-section-lma .eeprom=0 --no-change-warnings -O ihex simpleserial-base-CWLITEARM.elf simpleserial-base-CWLITEARM.eep || exit 0.Creating Extended Listing: simpleserial-base-CWLITEARM.lssarm-none-eabi-objdump -h -S -z simpleserial-base-CWLITEARM.elf > simpleserial-base-CWLITEARM.lss.Creating Symbol Table: simpleserial-base-CWLITEARM.symarm-none-eabi-nm -n simpleserial-base-CWLITEARM.elf > simpleserial-base-CWLITEARM.symSize after: text data bss dec hex filename 4588 8 1296 5892 1704 simpleserial-base-CWLITEARM.elf+--------------------------------------------------------+ Built for platform CW-Lite Arm (STM32F3)+--------------------------------------------------------</pre></li>Ensure that the "Built for platform ___" matches your target device.</ol>}}
{{CollapsibleSection
|intro = === Building for Other Targets ===
|content= Building for Other Targets}}
<h2> Modifying the Basic Example </h2>
Approved_users, administrator
366
edits

Navigation menu