2020-05-27 11:53 AM
Hello,
I'm facing a problem that I can't explain. In most of my devices, the SWD connector is completely wired (ca. VCC/GND/SWDIO/SWCLK/NRST), and I never had any problem to debug those devices with SystemWorkbench and a STLINK-2 debugger.
One of my device doesn't have the NRST wired. So only SWDIO and SWCLK are connected to the MCU (STM32F051). When I use the debugger with it, the interrupts are not fired. The SysTick counter is not incremented at all, and so it is almost impossible to debug as I use HAL_Delay() (which relies on the SysTick) in my code. I've checked almost all the registers, and I didn't see anything special that could explain why the interrupts are not fired.
I wired the NRST line (it was not easy on a QFN chip with very short accessibles tracks), and the interrupts are fired in that case.
When NRST is not connected, I have to add "monitor halt;" during the initialization, otherwise it is not possible to flash the device. Software reset doesn't work neither, so I have to set the "Connect under reset" option. I don't know if "monitor halt" is the correct command in that case, but at least, I can flash and debug my code (without interrupts...).
If I remove the debugger and reset the MCU (by power cycling the power supply), interrupts works fine (I made a small code with HAL_Delay() to blink a LED).
I really don't understand why NRST change the interrupts behavior. I tried also on a Discovery board (STM32F0DISCO), and removed SB19 (NRST signal between CN3 and STM32F051R8), and I had the same problem.
My questions are :
1. Does someone can explain me this behavior difference ?
2. Does someone can tell me if it is possible to have the interruptions working without NRST line ?
Thank you in advance,
Paul
2020-05-28 06:09 AM
Attach the .MAP file.
Consider using different tools, see if issues follow.
What address does linker build for?
2020-05-28 08:09 AM
Hello,
You can find the .map file here : https://drive.google.com/open?id=1DPy-D2NnqmaTo5AFw_hglevpunOfRwSI
This map file has been generated using the gcc toolchain of SystemWorkbench (gcc 7.3.1, for debug: openocd 0.10, gdb 7.10.1).
I have the same issue when I use the toolchain of STMCubeIDE in version 1.3.0. I also tried with another toolchain (gcc version 8.2.1; gdb 8.2.50; openocd 0.10), and this problem persists.
I'm on MacOS. I don't think that this issue is related to my OS, but I can try on a Linux machine just to be sure.
About the linker, I didn't change the base address, so I'm linking the application at the base of the flash, address 0x8000000.