Skip to main content
Version: 0.18.x

Nut Development Getting Started - Basics

Step 1. Environment Preparation​

1. STM32CubeIDE​

img

1.1 Program Introduction​

STM32CubeIDE is an integrated development environment (IDE) developed by STMicroelectronics specifically for the STM32 series microcontrollers. It is based on the Eclipse framework and integrates code writing, compiling, debugging, and configuration functions, aiming to simplify the development process of STM32 microcontrollers.

In this project, you can edit Nuts (the device under test) to analyze information status under different modes.

1.2 Program Download and Installation​

Official download link for STM32CubeIDE: STM32CubeIDE: Multi-OS Development Tool - STMicroelectronics;

img

Using Windows as an example

The version used in this project is STM32CubeIDE 1.16.1, installation package size (1GB), download time approximately (10 minutes), may vary depending on network speed.

img

After confirming the selected options, click Install

image-20250410084929760

Select options and create desktop shortcut

img

During installation, you can temporarily specify a configuration folder to configure subsequent projects. If the project has already been created, just select the folder of the corresponding project to call it.

img

After startup, manually disable automatic updates

(Automatic upgrades of STM32CubeIDE software can cause project compatibility issues, it is recommended to disable automatic updates)

2. GIT​

img

2.1 Program Introduction​

Git is a distributed version control system widely used in software development and document management, serving the purpose of managing code in this project.

2.2 Program Download and Installation​

Official download link: Git - Downloading Package (git-scm.com)

img

Choose the corresponding operating system on the Git official website to download

For Windows, select and install

img

3.1 Program Introduction​

A tool software launched by ST company specially used for communication and debugging with STM32 microcontrollers. In this project, it can be used for programming Nuts (the device under test).

3.2 Program Download and Installation​

img

Confirm the program and start downloading and installing

img

img

Installation complete

Step 2. Project Creation and Import​

1. Open Git CMD and enter the command to clone the repository​

git clone --recurse-submodules https://github.com/cracknuts-team/nut_st_workspace.git
note

Note that this operation sets nut_st_workspace as the working repository

tip

If you are syncing using the Gitee repository, please follow these steps:

  1. Sync the main repository code

    git clone https://gitee.com/cracknuts-team/nut_st_workspace.git
    git submodule

    Keep the output of git submodule above, it will be used below and looks like:

    -88fc810bfa5852609bb2cf71011fa8b9a0860cae process/mbedtls
  2. Clone the submodule code

    cd nut_st_workspace/process/mbedtls
    git clone https://gitee.com/cracknuts-team/mbedtls.git .

    Using the submodule commit ID obtained in the first step: 88fc810bfa5852609bb2cf71011fa8b9a0860cae, checkout that commit:

    git checkout -b temp 88fc810bfa5852609bb2cf71011fa8b9a0860cae

These two steps complete code synchronization with the Gitee repository.

💡TIP: Note that code synced this way should not commit submodule commits to the main repository

2. Run STM32CubeIDE software​

Select Import Project

Import the project cloned via Git

img

View nut_st_workspace file path and select the project

img

After importing, the interface shows all items

Check and confirm link configuration

Check and confirm Include Path configuration

img

Check and confirm Src path configuration

img

tip

The above steps should be checked and confirmed

Step 3. Hardware Preparation​

important

Nut board, ST-LINK programmer

Connect the Nut board with the ST-LINK programmer: SWCLK connects to DCK, SWDIO connects to DIO, GND connects to GND, and 3.3V connects to VCC.

img

note

After connecting the pins in order, insert the USB port into the PC for the next step.

Step 4. Compile and Burn​

1. Project Compilation​

Run the STM32CubeIDE program and select the project to compile, the example shown is the STM32F103C8 chip project.

img

important

After running Run AS - ensure no compilation errors, the status shown in the software bottom window indicates normal

img

img

warning

Check the generated .hex file

2. Nut Burning​

Run the STM32 ST-LINK Utility program to connect the Nut.

img

warning

Confirm connection status

Open the file, find the corresponding chip model file under the nut_st_workspace path and confirm selection.

img

note

Example is nut_stm32f103c8

img

Prompt after successful file opening

img

Start burning

img

Burning successful, ready to install to Cracker.