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

1,844 bytes removed, 18:16, 11 March 2020
Example Projects
|Status = Released
}}
 
{{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 ==
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}} === Running ST Example with ST-Link ===If 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. === 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-tools/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 new Mcu project by going to ''File > New > C Project'' and selecting ''<nowiki/>'<nowiki/>''Ac6 STM32 MCU Project'''.'' When you get to Target Configuration, click the Mcu tab and select the microcontroller that you want to target: [[File:STM32 New Project.PNG|400px]] [[File:STM32 MCU-Selection.PNG|400px]] 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).: [[File:STM32 Import.PNG|400px]] 3. Set up the build command. In ''File > Properties'', go to ''C/C++ Build > Behavior'' and remove 'all''<nowiki/>''' from 'Build' and deselect 'Enable parallel build'. Next, click the ''Builder Settings'' tab and deselect 'Use default build command' and 'Generate Makefiles Automatically'. Enter the command you would normally enter on the command line and change 'Build directory' to the folder you want to build in: [[File:STM32 Behaviour.PNG|400px]] [[File:STM32 Build-Settings.PNG|400px]] 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. Go to ''in File > Properties'' select Run/Debug Settings and create a new debug configuration. Under Debugger, click 'Show generator options...' and setup your Connection Setup based on your debugger. Change 'Reset Mode' to 'Software System reset': [[File:STM32 Debugging.PNG|400px]]
2. Click Apply and enter debugging mode. {{CollapsibleSection|intro = === Running ST Example with ST-Link ===|content= CW308T-STM32F/ST_Link}}
{{CollapsibleSection|intro = === Building and Debugging via ST'''Caveat''': the Is System Workbench ===|content= CW308T-STM32F/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 ==
Approved_users, administrator
366
edits

Navigation menu