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

CW308T-STM32F/ChipWhisperer Bootloader

467 bytes added, 17:58, 11 March 2020
no edit summary
{{Warningbox|These instructions have been updated for ChipWhisperer 5. If you're using and earlier version, see https://wiki.newae.com/V4:CW308T-STM32F/ChipWhisperer_Bootloader}}
The STM32Fx devices have a built-in bootloader, and the ChipWhisperer software as of 3.5.2 includes support for this bootloader.
Important notes before we begin:
* You MUST setup a clock and the serial lines for the chip. This is easily done by selecting a start-up script such as the "AES SimpleSerial on XMEGA" startup script.
* On the STM32F1, you MUST adjust the clock frequency to by 8MHz. The bootloader does not work with our usual 7.37 MHz clock frequency. '''You must This 8MHz frequency does not apply to the code that you're running on the device. Once you're done programming, you'll need to set the clock frequency back to F_CPU (likely 7.37MHz after programming the device.)'''
To access the bootloader you can perform these steps. They vary based on if you have a "Rev 02" board or a "Rev 03 or Later" board. The revision number is printed on the bottom side as part of the PCB part number (STM32F-03 is Rev -03 for example).
== Rev -03 or Later ==
# Select Run the "Serial STM32F Programmer"following python code once you have the scope and target set up:<syntaxhighlight lang=python>#: [[File:arm_programmerprog = cw.programmers.png]]STM32FProgrammer# Select the cw.program_target(scope, prog, "<path to fw hex-file and press the >"Program/Verify" button.)# The device should program, it may take a moment to fully program</verify on larger devices:#: [[File:arm_programmed.png]]syntaxhighlight>
{{Warningbox|If you get verify errors, it's possible during the shunt resistor is causing power to dip too lowprogramming process:* Retry the programming process with a lower baud rate:<syntaxhighlight lang=python>prog = cw. This can be solved by programmers.STM32FProgrammercw.program_target(scope, prog, "<path to fw hex file>", baud=38400)</syntaxhighlight>* If using a CW308 based STM, try mounting a jumper between the "SH-" and "SH+" pins at J16 (to the left of the SMA connector) on the UFO board. Retry programming with the jumper mounted. }}
== Rev -02 Boards ==
The Rev -02 boards did not have all programming connections present. They require some additional steps:
# Select Setup the "Serial STM32F Programmer"device as usual:#: [[File:arm_programmer<syntaxhighlight lang=python>scope = cw.png]]scope()target = cw.target(scope)scope.default_setup()</syntaxhighlight>
# Mount a jumper between the H1 and PDIC pins (again this is ONLY for the -02 rev).
#: [[File:STMF32F-02 programmer jumper.jpg|400px]]
# Reset the ARM device either by pressing the reset button (newer UFO boards only), or by toggling power:
#: [[File:arm_togglepower<syntaxhighlight lang=python>import timescope.png]]io.target_pwr = Falsetime.sleep(1)scope.io.target_pwr = True</syntaxhighlight># Select Program the device:#:<syntaxhighlight lang=python>prog = cw.programmers.STM32FProgrammercw.program_target(scope, prog, "<path to fw hex-file and press the >"Program)</Verify" button.syntaxhighlight># The device should program, it may take a moment to fully program/verify on larger devices:#: [[File:arm_programmed.png]]
# Remove the jumper between the H1/H2 pins.
# Reset the ARM device either by pressing the reset button (newer UFO boards only), or by toggling power:
#: [[File:arm_togglepower.png]]<syntaxhighlight lang=python>import time{{Warningbox|If you get verify errors, it's possible the shunt resistor is causing power to dip too lowscope. This can be solved by mounting a jumper between the "SH-" and "SH+" pins at J16 io.target_pwr = Falsetime.sleep(to the left of the SMA connector1) on the UFO boardscope. Retry programming with the jumper mountedio. }}target_pwr = True</syntaxhighlight>
Approved_users, administrator
366
edits

Navigation menu