As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

CW308T-STM32F/Debugging with ST Link

From ChipWhisperer Wiki
< CW308T-STM32F
Revision as of 11:06, 11 March 2020 by Adewar (Talk | contribs) (Created page with "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, wh...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

It's also possible to work on the example projects using 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 'Ac6 STM32 MCU Project'. When you get to Target Configuration, click the Mcu tab and select the microcontroller that you want to target:

STM32 New Project.PNG

STM32 MCU-Selection.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).:

STM32 Import.PNG

3. Set up the build command. In File > Properties, go to C/C++ Build > Behavior and remove 'all' 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:

STM32 Behaviour.PNG

STM32 Build-Settings.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. 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':

STM32 Debugging.PNG

2. Click Apply and 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!