Page 1 of 1

eclipse+gcc compiler and debugging micropython

Posted: Fri Mar 24, 2017 9:17 am
by fkeujjpdc
i want add the micropython to my exist project.my project develop by MDK,i must change to gcc,buf i want have a human debug environment. eclipse + gcc can develop STM32,but i have no idea add micropython to eclipse.

Re: eclipse+gcc compiler and debugging micropython

Posted: Tue Jun 20, 2017 10:08 am
by flindt
Assuming you are running eclipse-cdt, you need just a few steps for this.

1) Import the code as "existing makefile project" (Im using the sthal build to run on a STM32F429DISC board)
2) define a new build variable "BOARD" = "STM32F429DISC" in the project properties.
3) Build the project
4) Create an external tool config to run "st-util". Im running linux, so mine is in /usr/local/bin/st-util. Set the working directory to ${workspace_loc:/stmhal/build-STM32F429DISC}
5) Run the tool. In the console it should say : "src/gdbserver/gdb-server.c: Listening at *:4242..."
6) Setup a debug configuration and change the "startup" tab to this:
- use file : ${workspace_loc:/stmhal/build-STM32F429DISC/firmware.elf}
- load file : ${workspace_loc:/stmhal/build-STM32F429DISC/firmware.elf}
- enable "set breakpoint at : main" + "Resume"

And run the debug :)
Let me know if you get stuck - most problems here are easy, once you know the solution.

Re: eclipse+gcc compiler and debugging micropython

Posted: Thu Jun 29, 2017 4:05 pm
by ajie_dirgantara
flindt wrote:Assuming you are running eclipse-cdt, you need just a few steps for this.

1) Import the code as "existing makefile project" (Im using the sthal build to run on a STM32F429DISC board)
2) define a new build variable "BOARD" = "STM32F429DISC" in the project properties.
3) Build the project
4) Create an external tool config to run "st-util". Im running linux, so mine is in /usr/local/bin/st-util. Set the working directory to ${workspace_loc:/stmhal/build-STM32F429DISC}
5) Run the tool. In the console it should say : "src/gdbserver/gdb-server.c: Listening at *:4242..."
6) Setup a debug configuration and change the "startup" tab to this:
- use file : ${workspace_loc:/stmhal/build-STM32F429DISC/firmware.elf}
- load file : ${workspace_loc:/stmhal/build-STM32F429DISC/firmware.elf}
- enable "set breakpoint at : main" + "Resume"

And run the debug :)
Let me know if you get stuck - most problems here are easy, once you know the solution.
I've done all, except after flashing the firmware, it detect 6 HW breakpoint, raised error can't set hardware breakpoint and then stop debug process. why is this?

Re: eclipse+gcc compiler and debugging micropython

Posted: Mon Jul 24, 2017 7:24 am
by flindt
First check the output of the st-util. The easiest way to do this is to run it in a separate terminal.

Then try the same thing "manually" by using gdb directly - this will let you know whether it is an eclipse problem or not.
The gdb commands you need are:

Code: Select all

arm-none-eabi-gdb

target remote localhost:4242
load yourBinaryFile.elf
break main.c
continue
Post the output here.