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

Running avr-gdb in combination with pysimavr #40

Open
SebastianZug opened this issue Jan 1, 2019 · 0 comments
Open

Running avr-gdb in combination with pysimavr #40

SebastianZug opened this issue Jan 1, 2019 · 0 comments

Comments

@SebastianZug
Copy link
Contributor

Hi ponty,

best wishes for 2019 :-)

I used my hollidays for some experiments with AVR and intend control pysimavr via avr-gdb. For this purpose I extracted the following python code from the Button.py-example to initialize the simulation:

#!/usr/bin/python
from pysimavr.avr import Avr
from pysimavr.swig.simavr import avr_gdb_init, cpu_Stopped

mcu = "atmega328p"
freq = 8000000    

avr=Avr(mcu=mcu,f_cpu=freq)
avr.gdb_port = 1234;
avr_gdb_init(avr.backend)
avr.state = cpu_Stopped

try:
    while True:
        time.sleep(0.01)
        print("PC %s" % hex(avr.pc))
        print("Avr state: {}".format(avr.states[avr.state]));

finally: avr.terminate()
print "Aus Maus"

I compiled an older version of gdb (7.0.1) for avr target and run it with the following command but I did not realized a connection between simavr and avr-gdb. Any idea?

./avr-gdb
GNU gdb (GDB) 7.0.1
<some general information>
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=avr".
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
warning: Invalid remote reply: timeout
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

1 participant