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

Setting up Software for B1 ARM

209 bytes added, 19:29, 27 September 2018
no edit summary
Note in previous software versions, this tutorial took you through manual setup. This can still be done (using the GUI), but instead now the API has been made more powerful, so the example configuration script will be used instead.
To do so, simply scroll down and select the "setup_cwlite_xmega_aessetup_cwlite_stm32f_aes.py" file: [[File:cwsetup_scriptselection_xmegaconfig_cwliterunStm32f aes.pngPNG|thumb]]
You'll notice the contents of the script contain the following setup:<syntaxhighlight lang="python" line="1">
scope.gain.gain = 45
scope.adc.samples = 30005000scope.adc.offset = 12500
scope.adc.basic_mode = "rising_edge"
scope.clock.clkgen_freq = 7370000
scope.io.tio2 = "serial_tx"
scope.io.hs2 = "clkgen"
 target.baud=38400</syntaxhighlight>This configuration block does the following (for lines 1 through 1012):
Line 1: Sets the input ADC gain
Line 2: Sets the number of samples to record as 3000 5000 samples long (this is normally used for the AES algorithm).
Line 3: Sets an offset of 1250 0 samples from the trigger to when we start recording samples.
Line 4: Sets the trigger as being a "rising edge" trigger.
Line 7: Sets the trigger pin as GPIO4 (we previously set the trigger condition as rising edge, so this pin will be the one a rising edge is expected on).
Line 8: Configures GPIO1 as the RX (Input). This is what the XMEGA ARM target expects.
Line 9: Configures GPIO2 as the TX (Output). This is what the XMEGA ARM target expects.
Line 10: Sets the "High-Speed 2" (HS2) pin as having the 7.37MHz clock output.
Line 12: Sets the serial communication speed with the target at 38400 baud. <p>You can now program the ARM device! To do so, open the STM32F Programmer from the ''Tools'' menu:</p>
<p></p>
[[File:Stm32f programmer.png|thumb]]
<ol start="14" style="list-style-type: decimal;">
<li><p>You can now program the XMEGA device! To do so, open the XMEGA Programmer from the ''Tools'' menu:</p>
<p>[[File:cw1173_xmegaproga.png|image]]</p></li>
<li><p>Hit the ''Check Signature'' button and confirm the device is detected. If not you may have issues with the clock setup.</p>
<p>[[File:cw1173_xmegaprogb.png|image]]</p></li>
<li><p>Using the ''Find'' button, navigate to the <code>simpleserial-base-cw303CWLITEARM.hex</code> which you built earlier with the <code>make</code> command. You can then press the ''Erase/Program/Verify'' button, and confirm the file is programmed into the XMEGA device:</p>
<p>[[File:cw1173_xmegaprogc.png|image]]</p>
<p></p></li><li><p>If the software freezes and the verification fails after a long period of time, set the Read Block Size to 64 instead of 256.</p></li><li><p>Note the programmer dialog not only shows the successful programming status, but also shows when the <code>.hex</code> file was last modified. Always confirm this matches with when you last remember compiling the program -- if it is widely different this suggests you have selected the wrong file!</p>
<p>Finally we can check communications with the programmed file:</p></li></ol>
<ol start="17" style="list-style-type: decimal;">
<li>Close the XMEGA STM32F programmer dialog.</li>
<li>Open the status monitor under <i>Tools > Encryption Status Monitor</i>.</li>
<li>Resize the monitor window. The monitor will show sent &amp; received data to the target.</li>
<li>Hit the ''Run 1'' button ([[File:Capture One Button.PNG|image]]). You may have to hit it a few times, as the very first serial data is often lost. You should see data populate in the ''Text Out'' field of the monitor window. Note that each byte of the ''Text In'' is incremented in the ''Text Out'' field.</li></ol>
Approved_users, administrator
366
edits

Navigation menu