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 B2 Viewing Instruction Power Differences

2,576 bytes removed, 14:43, 28 September 2018
no edit summary
<ol style="list-style-type: decimal;">
<li><p>Copy Like with the directory <code>simpleserial-base</code> which is found at <code>chipwhisperer\hardware\victims\firmware\</code> previous tutorial, you'll need to have a copy of the chipwhisperer release firmware you want to a new directory called <code>simpleserial-base-lab2</code>modify and be able to build for your platform. You must keep it The instructions are repeated in the same directorydrop down menus below, as it will reference other files within that directory for but if you're comfortable with the build processprevious example, feel free to skip them.</p><p>If Alternatively, if you 're not too attached to your code, you can just completed modify your firmware from [[Tutorial_B1_Building_a_SimpleSerial_ProjectTutorial B1 Building a SimpleSerial Project]], you can simply reuse that code (this builds upon it).</p></li<h2> Building the Basic Example </h2>{{CollapsibleSection|intro = === Building for CWLite with XMEGA Target ===|content= Building for XMEGA}} {{CollapsibleSection|intro = === Building for CWLite with Arm Target ===|content= Building for Arm}} {{CollapsibleSection|intro = === Building for Other Targets ===|content= Building for Other Targets}}<h2> Modifying the Basic Example </h2> <li><p>At this point we want to modify the system to perform a number of operations. We won't actually use the input data. To do so, open the file <code>simpleserial-base.c</code> with a text editor such as Programmer's Notepad (which ships with WinAVR).</p></li>
<li><p>Find the following code block towards the end of the file, which may look different if you just completed [[Tutorial_B1_Building_a_SimpleSerial_Project]].</p>
<source lang="c">/**********************************
/* End user-specific code here. *
********************************/</source></li>
<li><p></p></li><li><p>Change the terminal to the directory with your source, and run the same <code>make</code> command you did in [[Tutorial_B1_Building_a_SimpleSerial_Project]] earlier to build the system. Remember you can press the up arrow on the keyboard to get recently typed commands in most OSes:</p>
<pre>make PLATFORM=CW303</pre>
<p>Which should have the following output, you will '''want to check the build platform is what you expect''':</p>
<pre>...Bunch of lines removed...
Creating Extended Listing: simpleserial-base.lss
avr-objdump -h -S -z simpleserial-base.elf &gt; simpleserial-base.lss
 
Creating Symbol Table: simpleserial-base.sym
avr-nm -n simpleserial-base.elf &gt; simpleserial-base.sym
 
Size after:
AVR Memory Usage
----------------
Device: atxmega128d3
 
Program: 1568 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>
or, if you have the CWLite with ARM:
<pre>make PLATFORM=CWLITEARM CRYPTO_TARGET=TINYAES128C</pre>
<pre>...Bunch of lines removed...
Linking: simpleserial-base-CWLITEARM.elf
arm-none-eabi-gcc -mcpu=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 for Flash: simpleserial-base-CWLITEARM.hex
arm-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.eep
arm-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.lss
arm-none-eabi-objdump -h -S -z simpleserial-base-CWLITEARM.elf > simpleserial-base-CWLITEARM.lss
.
Creating Symbol Table: simpleserial-base-CWLITEARM.sym
arm-none-eabi-nm -n simpleserial-base-CWLITEARM.elf > simpleserial-base-CWLITEARM.sym
Size 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>Following the instructions given in [[Tutorial_B1_Building_a_SimpleSerial_Project]], program the AVR, XMEGA, or STM32 (ARM) with your new code. Note you __do not__ need to close the programming window. If you will be doing frequent modifications to the source code, this can simplify your life since you only need to hit the '''Program''' button in AVRStudio to download new code.</li>
<li>Ensure the hardware is setup as in [[Tutorial_B1_Building_a_SimpleSerial_Project]]. If using the CW1002, ensure the SMA cable is also connected as described in the previous tutorial.</li></ol>
Approved_users, administrator
366
edits

Navigation menu