AnsweredAssumed Answered

ST-Link Utility Behaves Different from IAR Debugger

Question asked by roofie01 on Dec 19, 2014
Latest reply on Dec 21, 2014 by roofie01
I am using an ST Discovery Board (MMB997C) and programming / debugging it with IAR Workbench. It has the STM32F4 processor. I have a small external PCB connected to the Discovery board using the SPI lines that has an SPI controlled device. (a PGA112)

When I run the IAR debugger, which flashes and runs the Discovery STM32F4. It operates correctly and as expected; both the SPI device and debug output. Upon initialization the PGA is set to a 2, and then the gain control loop increments the SPI controlled amplifier to the correct level - which is clearly visible as I observe the output of the gain amp. I then STOP the IAR debugger.

Then, I open the ST- Link utility and connect to the Discovery board. I can either reload the firmware or not, it makes no difference. In any case, it's exactly the same firmware I just ran in IAR.
I then select "ST LINK->Print via SWO Viewer" and click the START button. I see all of the expected debug output exactly as I do from the IAR debugger.

What is bizarre is that, the SPI control does not appear to work when using the ST LINK Utility. The printout is clearly showing the same statements, it is operating in the control loop. The very first thing I would expect it to do is set the PGA gain to a value of 2. It just seems to ignore any SPI commands while running in ST-Link utility!

So far, I've tried:

Changing the Target->Settings Mode to Normal, Connect Under Rest, and Hot Plug. None of them make any difference.

Target->Program, or "Program and Verify" No difference

Exiting the ST Link Utility completely, disconnecting physically, and restarting. No difference.

Here's what I did to to prove it is not controlling the SPI. I unplug the USB cable to remove power from the Discovery board. I cut power to the attached PCB that has the PGA 112 so it is reset to a gain of 0. I then power that back up, plug in the USB, reconnect the target from the ST Link Utility, and run it. The attached board does not receive any commands form the Discovery board while using the ST link utility!  It is perfectly fine when using the exact same code, but running from the IAR debugger though.

This is too weird...has anyone got a suggestion as to what is going on? I cannot imagine for the life of me what the problem is. What has SPI control got to do with whether it's running from the ST Link, or a debugger controlling the ST Link utility??