Download - OpenJTAG on Soliddigi Spruce STM32 Arduino Board

Transcript
Page 1: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

1 / 15

OpenJTAG and OpenOCD under Eclipse

1. Install OpenOCD

Next

www.soliddigi.com SOLID Digital Technologies Inc.

Page 2: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

2 / 15

Next, unselect “Add the make utils to the PATH variable” under “Make utils”:

Click “next” to continue until finish the installation.

www.soliddigi.com SOLID Digital Technologies Inc.

Page 3: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

3 / 15

2. Download in command line mode:

Copy openocd.cfg to directory “eclipse_projects”.

Connect openjtag to the Spruce, and in command line run:

Next “telnet localhost 4444”

Type the following command:

www.soliddigi.com SOLID Digital Technologies Inc.

Page 4: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

4 / 15

Poll: poll spruce status

Halt:stop the spruce board

Stm32x mass_erase 0: mass erase flash

Flash write_image hex with file full path: write program to flash

Reset: reset the spruce

Note: stop the development board, mass erase, and then write the program to flash.

3. Download and debug under Eclipse:

3.1 Configure the connection of Openocd

In menu, Run->External tools->External tools Configurations

Click the following in sequence, Name、Location、Working Directory and then

Arguments, click apply

Name openocd

Location openocd-ftd2xx.ex’s full path

Working Directory workspac’s full path

Arguments -f openocd.cfg’s full path

www.soliddigi.com SOLID Digital Technologies Inc.

Page 5: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

5 / 15

Open Build options, remove “Build before launch” and click “apply”

www.soliddigi.com SOLID Digital Technologies Inc.

Page 6: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

6 / 15

3.2 Debug configuration:

Click the project name ->Run->debug configuration->double click Zylin Embedded

debug(Native), the following window will show up

www.soliddigi.com SOLID Digital Technologies Inc.

Page 7: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

7 / 15

Select “Debugger” and add location of the debug tool: CodeSourcery->Sourcery

G++ Lite->bin->arm-none-eabi-gdb.exe.

(Default: C:\Program Files\CodeSourcery\Sourcery G++

Lite\bin\arm-none-eabi-gdb.exe)

www.soliddigi.com SOLID Digital Technologies Inc.

Page 8: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

8 / 15

Open “Commands” option and add the following commands:

target remote localhost:3333

monitor halt

monitor poll

monitor stm32x mass_erase 0

load

monitor reset init

break Reset_Handler

break main

continue

www.soliddigi.com SOLID Digital Technologies Inc.

Page 9: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

9 / 15

4. Download and debug

Click Debug button in eclipse to enter into debug panel, click to open

openocd,and the following information will show up when connected to openjtag:

www.soliddigi.com SOLID Digital Technologies Inc.

Page 10: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

10 / 15

Click and select “Debug

Configuration”

www.soliddigi.com SOLID Digital Technologies Inc.

Page 11: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

11 / 15

www.soliddigi.com SOLID Digital Technologies Inc.

Page 12: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

12 / 15

Select the file to be debug, and single click “Debug” to begin debug.

www.soliddigi.com SOLID Digital Technologies Inc.

Page 13: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

13 / 15

Waiting for the program to be downloaded to spruce:

www.soliddigi.com SOLID Digital Technologies Inc.

Page 14: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

14 / 15

After downloading, click to run the program, and single click or F5

to single step debug.

We can double click to set breakpoints and debug.

www.soliddigi.com SOLID Digital Technologies Inc.

Page 15: OpenJTAG on Soliddigi Spruce STM32 Arduino Board

15 / 15

www.soliddigi.com SOLID Digital Technologies Inc.