Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupts are disabled when debugging on chip using st-util: STM32F071V6T6 #266

Closed
zyura opened this issue Sep 24, 2014 · 10 comments · Fixed by #341
Closed

Interrupts are disabled when debugging on chip using st-util: STM32F071V6T6 #266

zyura opened this issue Sep 24, 2014 · 10 comments · Fixed by #341

Comments

@zyura
Copy link

zyura commented Sep 24, 2014

Firmware works fine when uploaded to target using st-flash but when uploading and debugging the same code using st-util as gdb server all interrupts become disabled.

st-util output:

2014-09-24T23:39:15 INFO src/stlink-common.c: Loading device parameters....
2014-09-24T23:39:15 INFO src/stlink-common.c: Device connected is: F07x device, id 0x20016448
2014-09-24T23:39:15 INFO src/stlink-common.c: SRAM size: 0x4000 bytes (16 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes
2014-09-24T23:39:15 INFO gdbserver/gdb-server.c: Chip ID is 00000448, Core ID is 0bb11477.
2014-09-24T23:39:15 INFO gdbserver/gdb-server.c: Target voltage is 2877 mV.
2014-09-24T23:39:15 INFO gdbserver/gdb-server.c: Listening at *:4242...
2014-09-24T23:39:24 ERROR gdbserver/gdb-server.c: [FP_CTRL] = 0x00000041 expecting 0x00000261
2014-09-24T23:39:24 INFO gdbserver/gdb-server.c: GDB connected.

I'm using STM32F4DISCOVERY board's st-link (target voltage is not connected to the st-link MCU by default).

Maybe this chip is not supported yet (FP_CTRL mismatch)?

Is there any quick workaround?

@prattmic
Copy link
Contributor

It is expected that interrupts do not fire when single stepping through instructions. They should fire if execution is continued (perhaps with breakpoints set).

@zyura
Copy link
Author

zyura commented Sep 24, 2014

I understand that well. The problem is that interrupts are completely disabled (no systick, no timers, nothing) even when execution is continued.

But everything is fine with the same code when I disconnect the debugger and reset the target (even without flashing it with st-flash).

@prattmic
Copy link
Contributor

Ah, I am not sure then.

@zyura
Copy link
Author

zyura commented Sep 24, 2014

Just checked with IAR under Windows, debugging works fine - all interrupts work as expected.

Please suggest any workaround for st-util...

@zyura
Copy link
Author

zyura commented Sep 27, 2014

Latest OpenOCD also works fine, so it seems that this is a bug in st-util

@rmu75
Copy link

rmu75 commented Oct 5, 2014

got the same problem with STM32F051 - systick not running while connected to gdb via st-util.

@xor-gate
Copy link
Member

xor-gate commented May 5, 2016

The gdb-server stubs in st-util are currently very minimal and semi-hardcoded currently compared to scripted OpenOCD. For full gdb-server stubs you should use OpenOCD (for now). Sorry!

@xor-gate xor-gate closed this as completed May 5, 2016
@fishpepper
Copy link

I think i am running into the same issue with an stm32f072. When i flash the device with st-flash all interrupts seem to be disabled. When i remove the st link and reset my board everything works.

@fishpepper
Copy link

fishpepper commented Sep 18, 2016

this fixed it for me (it seems like my cheap st link clone has no proper reset connection?!)

diff --git a/src/common.c b/src/common.c
index 74fa104..c053c36 100644
--- a/src/common.c
+++ b/src/common.c
@@ -629,6 +629,7 @@ int stlink_load_device_params(stlink_t *sl) {

 int stlink_reset(stlink_t *sl) {
     DLOG("*** stlink_reset ***\n");
+    stlink_write_debug32(sl, 0xE000ED0C, (0x5FA << 16) | (1 << 2));
     return sl->backend->reset(sl);
 }

i got it from this issue: #220

@Nightwalker-87
Copy link
Member

Closed by #341.

@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 3, 2021
@Nightwalker-87 Nightwalker-87 changed the title Interrupts are disabled when debugging on chip using st-util: STM32F071 V6T6 Interrupts are disabled when debugging on chip using st-util: STM32F071V6T6 Apr 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants