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

[compilation] Correct path to stlink/chips subdirectory #1276

Closed
6 tasks done
letshin opened this issue Nov 4, 2022 · 3 comments · Fixed by #1279
Closed
6 tasks done

[compilation] Correct path to stlink/chips subdirectory #1276

letshin opened this issue Nov 4, 2022 · 3 comments · Fixed by #1279

Comments

@letshin
Copy link

letshin commented Nov 4, 2022

Hi - I am not sure if these are two separate issues but after compiling from this repo I get the following error with a E73-2G4M08S1EX (nRF52833) connected.
Commandline input:

st-info --probe

Commandline output:

/usr/share//stlink/chips: No such file or directory
Found 1 stlink programmers
  version:    V2J29S7
  serial:     50001000030000544334544E
  flash:      0 (pagesize: 0)
  sram:       0
  chipid:     0x000

Is it normal for "/usr/share//stlink/chips: No such file or directory" to appear?

Not sure if its related but while running PYOCD I get the following

Commandline input:

pyocd load s140_nrf52_7.2.0_softdevice.hex --target nrf52833

Commandline output:

0001139 C STLink error (9): Get IDCODE error [__main__]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/pyocd/__main__.py", line 161, in run
    status = cmd.invoke()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/subcommands/load_cmd.py", line 96, in invoke
    with session:
  File "/usr/local/lib/python3.8/dist-packages/pyocd/core/session.py", line 391, in __enter__
    self.open()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/core/session.py", line 529, in open
    self._board.init()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/board/board.py", line 139, in init
    self.target.init()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/core/soc_target.py", line 147, in init
    seq.invoke()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/utility/sequencer.py", line 213, in invoke
    resultSequence.invoke()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/utility/sequencer.py", line 208, in invoke
    resultSequence = call()
  File "/usr/local/lib/python3.8/dist-packages/pyocd/coresight/dap.py", line 439, in _connect
    probe_conn.connect(self._protocol)
  File "/usr/local/lib/python3.8/dist-packages/pyocd/coresight/dap.py", line 172, in connect
    self._connect_probe(protocol)
  File "/usr/local/lib/python3.8/dist-packages/pyocd/coresight/dap.py", line 189, in _connect_probe
    self._probe.connect(protocol)
  File "/usr/local/lib/python3.8/dist-packages/pyocd/probe/stlink_probe.py", line 159, in connect
    self._link.enter_debug(STLink.Protocol.SWD)
  File "/usr/local/lib/python3.8/dist-packages/pyocd/probe/stlink/stlink.py", line 327, in enter_debug
    self._check_status(response)
  File "/usr/local/lib/python3.8/dist-packages/pyocd/probe/stlink/stlink.py", line 365, in _check_status
    raise exceptions.ProbeError(error_message)
pyocd.core.exceptions.ProbeError: STLink error (9): Get IDCODE error

Expected/description: Able to detect connected chip and upload hex file.


NOTE: In order to offer sufficient and the best possible support, please read /CONTRIBUTING.md and follow the given instructions before submitting a ticket.

Bug reports and/or feature requests will be deleted, if they violate our contribution guidelines and if no issue-template is used! Thank you for your support.


  • I made serious effort to avoid creating duplicate or nearly similar issue

In order to allow developers to isolate and target your respective issue, please take some time to select the check boxes below and fill out each of the following items appropriate to your specific problem.

  • Programmer/board type: [STLINK/V2] (e.g STLINK /V1, /V2, /V2-onboard, /V2-clone, /V3)
  • Operating system an version: [Linux Ubuntu Server]
  • stlink tools version and/or git commit hash: [Latest version] (e.g v1.6.1/git-d0416149)
  • stlink commandline tool name: [st-info] (e.g st-info, st-flash, st-trace, st-util)
  • Target chip (E73-2G4M08S1EX): [enter here] (e.g STM32F103C8T6 (NUCLEO-F103RB))

Further we kindly ask you to describe the detected problem as detailed as possible and to add debug output if available, by using the following template:

Commandline output:

OUTPUT/ERROR of the commandline tool(s)

Expected/description:

short description of the expected value

@weiminshen99
Copy link
Contributor

I am facing the same problem on MacOS (see the error message below):

% st-flash --reset write build/main.bin 0x8000000
st-flash 1.7.0-217-gf93adb9
/usr/share//stlink/chips: No such file or directory
Failed to enter SWD mode
Failed to connect to target
make: *** [flash] Error 255

How do I fix this problem?

@weiminshen99
Copy link
Contributor

Good news. I fixed the problem by changing one line in CMakeLists.txt, because new Mac does not like people to change /usr/share, but /usr/local/share is OK:

-# Define install directory /usr/share
-set(CMAKE_INSTALL_SHAREDIR /usr/share/)
+# Define install directory /usr/local/share [not /usr/share on MacOS]
+set(CMAKE_INSTALL_SHAREDIR /usr/local/share/)

The whole thing is now installed and working on my MacOS. I also write a paragraph in README for "Installation on Mac". Please let me know if you want that too.

@letshin
Copy link
Author

letshin commented Nov 14, 2022

I was using it on linux, but didn't bother debugging. I instead returned it to Amazon and purchased a DAP_LINK adapter from eBay and used pyocd with it. This means I can't text your fix :(

@Nightwalker-87 Nightwalker-87 added this to the v1.7.1 milestone Dec 3, 2022
@Nightwalker-87 Nightwalker-87 changed the title [STLink-V23]: /usr/share//stlink/chips: No such file or directory [compilation]: Correct path to stlink/chips subdirectory Dec 18, 2022
@Nightwalker-87 Nightwalker-87 changed the title [compilation]: Correct path to stlink/chips subdirectory [compilation] Correct path to stlink/chips subdirectory Dec 18, 2022
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Dec 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.