Open stanimirsp5 opened 1 year ago
Hi,
one way to get a decent avr-gdb on a Mac is using homebrew! Install the homebrew system and then:
brew tap osx-cross/avr && brew install avr-gdb
You can copy the binary which you find following the link at /usr/local/bin/avr-gdb to the place where you need it, or you simply set the path to that link.
The hardware folder on a Mac can either be found in the Application itself (you need to open the corresponding folder) or it is below ~/Library/Arduino15 (or both).
Hi, @felias-fogg, thanks for your answer it was very helpful. I overcame my issues with the launch.json and I think everything is fine with the JSON file. This is the updated version link
Now my problem is that when I upload my code to Arduino and run the debugger it enters in loop and vs code begins constantly to load something.
I thought the problem may be with Baud rate
but I know that the debugger uses 115200 and the default baud rate for Arduino extention is 115200 too.
Hi @stanimirsp5,
I did not try it out yet - I still have to install VSC and the Arduino extension. However, the default baud rate of avr-gdb is 9600! So you need to tell avr-gdb to switch to 115200. Either use set serial baud 115200
after avr-gdb started and before you establish a connection with target remote ...
or call avr-gdb with the argument -b 115200
.
Has anyone succeded to run avr_debug on Mac? I'm using VS Code for Mac with Arduino extension and now I want to be able to debug my program but there are a lot of obstacles in configuring the launch.json file.
avr-gdb
. I searched for it in the Arduino IDE 2.0 directory but such a file doesn't exist. So I downloadedAVR 8-Bit Toolchain (OSX)
from microchip website. When I run it constantly throws that error.My next problem is with
miDebuggerServerAddress
. What value to set there? My Arduino runs on/dev/tty.usbmodem142401
serial port. When I set that value the vs code enters an endless loop.Also I can't turn off compiler optimizations because such path
hardware/arduino/avr
in Arduino IDE 2.0 directory on Mac doesn't existSo my biggest problem is with paths especially because documentation is strictly for Windows and it's very hard and time-consuming to search workarounds for Mac. So if anyone has succeeded in running the avr_debug on Mac, please tell me:
This is how my Arduino.ino file and my launch.json file looks like code snippet
Thanks for your time.