Skip to main content
Visitor II
March 3, 2019
Question

Cannot import variables in STM Studio. Error opening ST-Link connection.

  • March 3, 2019
  • 5 replies
  • 7268 views

Hello All,

I am hoping to reach out to the community for help with an error that I am experiencing with STM Studio. I recently installed STM Studio, part #: STM-STUDIO-STM32, version: 3.6.0.

When I try to import a variable to view I get an error message (picture attached) stating:

GDB cmd [print /x &(AHBPrescTable[0])] failed:

Error: Address of symbol "AHBPrescTable" is unknown.

I get two subsequent errors when I try to send the variable to the viewer:

Error opening ST-Link connection

Failure opening connection with target

I have downloaded and installed Java Runtime Environment: jre-8u201-windows-x64

I am using:

OS: Windows 10 x64 bit

IDE: Atollic TrueStudio v9.1.0

Debugger/Programmer: ST-LINK V2

Chip: STM32F030R8T6 (ARM core M0)

I had a similar error connecting to the ST-Link when I first tried using Atollic TrueStudio. The issue at that time was that Windows Defender was blocking st-link_gdb server.

I have tried running STM Studio with Windows Defender turned off, but it did not fix the problem in this case. Any insight and solutions you can provide are most appreciated! Thank you.

    This topic has been closed for replies.

    5 replies

    Visitor II
    March 4, 2019

    Some constructs of variables are not supported by STMStudio, just click ok and continue.

    I get 10 or so of those errors when I'm importing the elf of my projects.

    I believe this is due to some things being optimized by the compiler, where they do exist in the symbol table, without actually being linked. I never bothered to look into this further.

    cdmechAuthor
    Visitor II
    March 7, 2019

    Hello Jeroen3,

    Thank you for your kind reply. I must apologize for my delayed response. I have managed to push past the initial errors (about 3 of them) as you suggested. I got my variable populated under "Display Variables settings", but when I press the "play" button, I get a few more errors. These say: Error opening ST-Link connection and Failure opening connection with target (picture attached). I feel like this has something to do with the SWD, but I cannot say for sure. Have you encoutered these errors before? Thank you

    Visitor II
    March 4, 2019

    You could check the map file to see where it's supposed to end up.

    With the SPL, the AHBPrescTable used to be "const volatile".

    cdmechAuthor
    Visitor II
    March 7, 2019

    Hello AvaTar,

    Thank you for your kind reply. I must apologize for my delayed response. Please forgive my ignorance, but can I ask what a map file is? Where might I find the map file related to my program? Also, might I ask what SPL stands for? Thanks again.

    Visitor II
    March 7, 2019

    SPL was ST's "Standard Peripheral Library", before Cube. You can still download them for older MCU variants (F1,F2,F0,L0, L1, many F3 and F4),

    The map file is a text file created by the linker for human consumption.

    It lists all linker objects (variables, functions, etc. ) that go in your code, with addresses and sizes.

    Not sure if TrueStudio creates it by default, you might enable it in the project options. And I'm neither sure of the name TrueStudio gives it. It is, as said a readable text file, and can become quite large.

    Check if it contains a reference to your variable(s) - if not, they are probably optimized out.

    cdmechAuthor
    Visitor II
    March 8, 2019

    Hello Community,

    While I do not have a perfect solution, I did get STM Studio somewhat working. It seems one issue is that only one source is allowed to link with the microcontroller at a time. During previous tests, Atollic TrueStudio was still linking while I was trying to link with STM Studio. The initial error messages remain, but they can be bypassed.

    GDB cmd [print /x &(AHBPrescTable[0])] failed:

    Error: Address of symbol "AHBPrescTable" is unknown.

    Visitor II
    June 11, 2019

    Hey Community,

    This is for anyone who is still getting the (Error opening ST-Link connection and Failure opening connection with target) errors with STM Studio.

    What worked for me when using Keil uVision 5 (not True Studio, although there probably is a similar option in True Studio) is to go into "Options for Target" --> "Debug Tab" --> "ST-Link Debugger Settings" --> "Pack Tab" --> "Untick the Enable Checkbox". This made STM Studio work straight away.

    Good luck!

    Visitor II
    October 30, 2020

    Could you explain me the way in True Studio because I can't find. I can debug and the board gives me the right answer all the time but I can't access Stm Studio

    Visitor II
    November 19, 2019

    Thanks All. It was really helpful...