{{Warningbox|ChipWisperer v5.1.3 before commit 3557 and arm-none-eabi-gcc before q2-2018 can produce non-working binaries for the STM32F3. The only fix is to update either ChipWhisperer or gcc}}
== Supported Devices ==
== Hardware AES ==
The STM32F21x, and STM32F41x/43x have hardware crypto modules (AES, DES, TDES) along with hardware hash (SHA1, MD5). Hardware crypto for the STM32F4 has been integrated into the Hal build system on the develop branch. To use the hardware crypto, call HW_AES128_Init() at the beginning of your program. You can update the key with HW_AES128_LoadKey(), encrypt plaintext with HW_AES128_Enc(), and decrypt data with HW_AES128_Dec(). == CAN Connection == A 6-pin header is present for devices which have CAN hardware support (not all devices have this). A CANoodler can be plugged in to provide the physical transceiver. This header is not normally mounted, unless the board is part of an 'automotive bundle'. The header is left unmounted as it can impede sweeping a probe over the surface of the chip.
== Programming Connection ==
SimpleSerial builds for each of the STM32Fx Devices. Each device is a separate HAL. These HAL modules have been copied from ST's HAL (not the CUBE) and greatly reduced in size by deleting unused files (such as headers for unused devices), and combining several C-source files into a single low-level C-file.
Many example projects are available via Jupyter Notebooks: https://chipwhisperer.readthedocs.io/en/latest/tutorials.html. Note that all of these examples were created for the CWLITEARM (equivalent STM32F3) target. You will need to make changes based on which target you have to run the tutorials. For some tutorials, changing the PLATFORM variable in the first block to the one you're using is enough to get the tutorial working:
<syntaxhighlight lang=python>
SCOPETYPE = "OPENADC"
PLATFORM = "CW308_STM32F4" #For STM32F4 target, was originally "CWLITEARM"
</syntaxhighlight>
=== Building ST Example on Command Line ===
[[File:Stm32-make.png]]
{{CollapsibleSection|intro = === Programming via ChipWhisperer Bootloader ===|content= CW308T-STM32F/ChipWhisperer_Bootloader}}
{{:CollapsibleSection|intro = === Running ST Example with ST-Link ===|content= CW308T-STM32F/ChipWhisperer_BootloaderST_Link}}
=== Running ST Example with ST-Link ==={{CollapsibleSectionIf instead of using the bootloader, you want to use a ST-Link you can instead plug your programmer into the 20 pin JTAG connector (J6 on the UFO board):[[File:Stm32-jtag.jpg|600px]]Then, the details of this step will depend on your programmer. If you're using an ST-Link programmer, open the ST-Link utility and connect to the device:[[File:Stm32-connect.png]]Load your `.hex` file and program the device with the Program and Verify button:[[File:Stm32-program.png]]After this, you're ready to go - you can use the ChipWhisperer terminal to talk to your target. You might need to reset the target before you do anything else. intro = === Building and Debugging via ST's System Workbench ===It's also possible to work on the example projects using [http://www.st.com/en/development|content= CW308T-toolsSTM32F/sw4stm32.html ST's System Workbench IDE]. This IDE also supports debugging, which is helpful for working out all the kinks in your firmware.To build the ChipWhisperer examples in System Workbench:1. Create a ''Makefile Project with Existing Code'' and enter the firmware's location in Existing Code Location:[[File:Stm32-st-1.png]]2. Link the external files into the project. To do this, under ''File > Import'', select ''File System''. In the `chipwhisperer\hardware\victims\firmware` directory, select all of the relevant files and folders (Makefile in base folder, Makefile in HAL folder, STM32Fx HAL folder). Ensure that make links to these files (instead of directly importing them):[[File:Stm32-st-2.png]]3. Set up the build command. In ''File > Properties'', go to ''C/C++ Build'' and deselect 'Use default build command'. Enter the command you would normally enter on the command line:[[File:Stm32-st-3.png]]4. Build the project and confirm that the build works from the output in the IDE console.Then, if you want to set up debugging:1. Find ST's list of debugging targets (check around `C:\STMicro\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.12.1.201703061527\resources\openocd\scripts\board`). Make a config file for your target. This file's contents should be something like (adjust for your board):<pre># This is an CW308T_STM32F0 board with a single STM32F071R8Tx chip.# Generated by System Workbench for STM32source [find ../interface/stlink-v2-1.cfg]set WORKAREASIZE 0x2000transport select "hla_swd"set CHIPNAME STM32F071R8Txsource [find ../target/stm32f0x_stlink.cfg]# use hardware reset, connect under resetreset_config srst_only srst_nogate</pre>2. In ''Run > Debug Configurations'', make a new ''Ac6 STM32 Debugging'' configuration. Under the 'Debugger' tab, select ''Use local script'' and select your custom script:[[File:Stm32-st-4.png]]3. Enter debugging mode. '''Caveat''': the I/O register map in the debugger appears to use the last known device (ie: if you debugged an STM32F4 project before your Makefile project, it sticks with F4's registers). Check that the registers' addresses are correct before you trust them!Debugging_with_ST_Link}}
== Schematic ==
|-
|F2HWC
|STM32F215RET6|10-ohm|51-ohm
|-
|F3
|-
|F4HWC
|STM32F415RGT6|10-ohm|51-ohm
|}
=== Rev -03 Schematic ===
The current revision of the target is -03. The following shows this schematic:
[[File:CW308T_STM32F_03.png|1100px]]
=== Rev -02 Schematic ===
The original board sold was the -02 revision. The revision is part of the part number, for example these boards will be marked STM32F-02. The -02 revision also does not have the CAN connector: