Ultra simple STM32 debugger

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Ultra simple STM32 debugger

Post by LightningStalker » Fri Nov 10, 2017 6:36 pm

Not working for me in Linux Mint 18.2. I click connect and it looks like it connects, none of the buttons has any effect, nothing in the bottom of the window.

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ultra simple STM32 debugger

Post by Pito » Fri Nov 10, 2017 8:26 pm

The same here under Win7 64bit. It starts, I can select the .elf (it saves it into debugger.cfg), I can connect/disconnect (regardless the stlink dongle is connected or not..), I see the buttons activated (after Halt), but no action or messages there visible. I also started the dbg/win/arm..-gdb.exe manually, but it did not help.
Pukao Hats Cleaning Services Ltd.

stevestrong
Posts: 1743
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Ultra simple STM32 debugger

Post by stevestrong » Sat Nov 11, 2017 8:14 am

Be sure that the BP (or the MM) has enabled the debug SWD pins.
If you build with the STLink upload option, then it is default enabled, otherwise not.

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ultra simple STM32 debugger

Post by Pito » Sat Nov 11, 2017 8:35 am

Do you mean this? :)
viewtopic.php?f=2&t=2775&start=20#p36940
Yes, it is alive now, here with Win7 64b.
It connects to the stlink, the stlink blinks.
I can set the .elf file. I cannot see any source, getting some info from Where, Threads, Registers..
Other buttons give me

Code: Select all

C:\Users\123ert\Desktop\Ultra_Simple_STM32_Debugger>java -jar Ultra_Simple_STM32_D
ebugger.jar
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException
: String index out of range: -4
        at java.lang.String.substring(Unknown Source)
        at main_form.extract_filepath(main_form.java:682)
        at main_form.send_gdb_cmd(main_form.java:455)
        at main_form.btn_haltActionPerformed(main_form.java:518)
        at main_form.access$500(main_form.java:34)
        at main_form$3.actionPerformed(main_form.java:132)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionP
rivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
The debugger.cfg shows:

Code: Select all

#Sat Nov 11 12:57:13 PST 2017
elf_file=C\:\\Users\\123ert\\Sloeber\\Ice40_Read_1\\Release\\Ice40_Read_1.elf
or

Code: Select all

elf_file=C\:\\Users\\123ert\\Desktop\\Ultra_Simple_STM32_Debugger\\Ice40_Read_1.elf
It seems there is an issue with the path format. It cannot find the .elf file.
Messed with backslashes, still no fun.
Last edited by Pito on Sat Nov 11, 2017 7:21 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Vassilis
Posts: 320
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: Ultra simple STM32 debugger

Post by Vassilis » Sat Nov 11, 2017 5:27 pm

@Pito
Your debugger.cfg file seems to be correct.
1. I guess you run the 'RunMe_windows.bat' file
2. When you click <connect> do the two st-link leds blink?

The .elf file contains the sub-file paths are used in the project. That means, (usually) you cannot compile your project in one computer and use the produced .elf file in other computer. I guess the debugger is running on the same computer where you have compiled your project.

@LightningStalker
Could you please check if the 'openocd/linux/openocd' and 'gdb/linux/arm-none-eabi-gdb' files are executable ?
If not, run in terminal the command 'sudo chmod +x filename' where 'filename' is the openocd file (and the arm-none-eabi-gdb file).
If you run the .jar file from terminal, make sure you are in that folder path because the jar uses that file path (relative path).

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ultra simple STM32 debugger

Post by Pito » Sat Nov 11, 2017 7:07 pm

1. yes I run 'RunMe_windows.bat'
2. there is only a single led on the stlink (clone) and it blinks when connected, there is an activity as I wrote above - ie. it shows registers..
3. I run it on the same computer
Pukao Hats Cleaning Services Ltd.

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Ultra simple STM32 debugger

Post by Pito » Sat Nov 11, 2017 10:21 pm

Update: my sketch prints out some data via usb serial to terminal.
1. after few minutes of clicking on buttons and several replugings/reconnecting the USSD, it suddenly shows a source file from core
2. I can step through with Next somehow, but mostly there is an error in java - the system cannot find the .ino, sometimes the exception as above
3. when it is working it shows the files from maple core..
4. pressing Reset (in USSD) shots down the usb as well as the USSD, needs to replug the usb and reconnect the USSD
5. sometimes clicking Halt<=>Resume grays out the Halt, such it cannot be halted anymore
Why the .ino is not to find?
Pukao Hats Cleaning Services Ltd.

User avatar
LightningStalker
Posts: 21
Joined: Fri Nov 03, 2017 5:00 am
Location: GRMI
Contact:

Re: Ultra simple STM32 debugger

Post by LightningStalker » Sat Nov 11, 2017 10:32 pm

Vassilis wrote:
Sat Nov 11, 2017 5:27 pm
@Pito
Your debugger.cfg file seems to be correct.
1. I guess you run the 'RunMe_windows.bat' file
2. When you click <connect> do the two st-link leds blink?

The .elf file contains the sub-file paths are used in the project. That means, (usually) you cannot compile your project in one computer and use the produced .elf file in other computer. I guess the debugger is running on the same computer where you have compiled your project.

@LightningStalker
Could you please check if the 'openocd/linux/openocd' and 'gdb/linux/arm-none-eabi-gdb' files are executable ?
If not, run in terminal the command 'sudo chmod +x filename' where 'filename' is the openocd file (and the arm-none-eabi-gdb file).
If you run the .jar file from terminal, make sure you are in that folder path because the jar uses that file path (relative path).
They are all executable. I did have to set the .jar executable at the beginning. I'm now noticing the light on the ST-Link flashes and I get this in the terminal:

Code: Select all

Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: -95
	at java.lang.String.substring(String.java:1967)
	at main_form.extract_filepath(main_form.java:683)
	at main_form.send_gdb_cmd(main_form.java:455)
	at main_form.btn_haltActionPerformed(main_form.java:518)
	at main_form.access$500(main_form.java:34)
	at main_form$3.actionPerformed(main_form.java:132)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
So I closed it and reopened it and suddenly it is working now? Very strange
I don't see any way to set breakpoints.
Oh and one other thing is that the text is really small on my screen and a bit difficult to read (4k monitor)

User avatar
Vassilis
Posts: 320
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: Ultra simple STM32 debugger

Post by Vassilis » Sun Nov 12, 2017 4:45 pm

Pito, replace the old jar file with the new one (v0.4.1)

p.s. I don't know if that helps but my first ST-Link has firmware V2.J27.S6 STM32+STM8 Debugger and the second V2.J28.S7 STM32+STM8 Debugger. Both of them work fine with the debugger
Ultra_Simple_STM32_Debugger.zip
(31.01 KiB) Downloaded 2 times
- EDIT - Added text resizing feature
Last edited by Vassilis on Sun Nov 12, 2017 5:36 pm, edited 1 time in total.

User avatar
Vassilis
Posts: 320
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: Ultra simple STM32 debugger

Post by Vassilis » Sun Nov 12, 2017 4:57 pm

LightningStalker wrote:
Sat Nov 11, 2017 10:32 pm
I don't see any way to set breakpoints.
At this moment breakpoints function is not supported. I will add this future if there is interest in the software.
LightningStalker wrote:
Sat Nov 11, 2017 10:32 pm
Oh and one other thing is that the text is really small on my screen and a bit difficult to read (4k monitor)
That is a good addition (text resizing). Done !
Last edited by Vassilis on Sun Nov 12, 2017 5:40 pm, edited 1 time in total.

Post Reply