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

GDB hangs with "Ignoring packet error, continuing..." #21

Open
japaric opened this issue Jan 17, 2018 · 1 comment
Open

GDB hangs with "Ignoring packet error, continuing..." #21

japaric opened this issue Jan 17, 2018 · 1 comment

Comments

@japaric
Copy link
Member

japaric commented Jan 17, 2018

STR

  • Uncomment the first monitor tpiu line in .gdbinit.
 # # send captured ITM to the file itm.fifo
 # # (the microcontroller SWO pin must be connected to the programmer SWO pin)
 # # 8000000 must match the core clock frequency
-# monitor tpiu config internal itm.fifo uart off 8000000
+monitor tpiu config internal itm.fifo uart off 8000000

 # # OR: make the microcontroller SWO pin output compatible with UART (8N1)
 # # 2000000 is the frequency of the SWO pin
  • Create a named piped named itm.fifo in the directory where OpenOCD is invoked
$ cd ~/tmp
$ openocd (..)

$ # on another terminal
$ cd ~/tmp
$ mkfifo itm.fifo
  • Launch GDB using xargo run
$ xargo run
Reading symbols from target/thumbv7em-none-eabihf/debug/cortex-m-quickstart...done.
cortex_m_rt::reset_handler ()
    at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:330
330     unsafe extern "C" fn reset_handler() -> ! {
semihosting is enabled
Ignoring packet error, continuing...
Ignoring packet error, continuing...

Note that when you reach this point OpenOCD will become unresponsive and you'll have to kill it and start a new OpenOCD process before you can invoke xargo run / start GDB.

Cause

The monitor tpiu config internal itm.fifo uart off 8000000 line hangs because the named pipe is not open (I assume).

Workaround

Open the itm.fifo file before calling xargo run.

$ itmdump -f itm.fifo

$ # on another terminal
$ xargo run

Note that itmdump v0.2.0 sometimes ends when you terminate the GDB session. In that case you'll have to re-run the itmdump command before the next time you call xargo run / start GDB.

The other alternative is used a plain text file instead of a named pipe. This problem only occurs with named pipes. If you use a plain text file you can use itmdump's follow mode (-F) to get a named pipe like behavior.


I can't think of a way to avoid this problem or improve the error message from our side so at least I'm documenting the problem here. I'll add it to the troubleshooting guide as well.

@ssendev
Copy link
Contributor

ssendev commented Jul 22, 2019

I avoided this problem by using /tmp/itm insteead of itm.fifo as file where /tmp is a tmpfs which means it won't cause wear on my SDD. Potential downside is that it might use up the RAM but even at theoretical max output it would eat less than a GB per hour and it's always possible to just run rm /tmp/itm; cargo run to reduce the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants