I looked at the available gcc optimization settings recently and noticed there's one that's said to "optimize the debugging experience". Unfortunately, it isn't included in boards.txt for any Adafruit's products. So I added it to my boards.txt for several Adafruit M4-based products that I use (but not all of them; I had no idea there were so many). Note that this feature will work for ANY processor, not just the M4
The modification involved adding two lines for each board that I changed. These lines should be grouped with similar lines under the options for each processor that you modify, Note that the prefix at the beginning of the line must be changed for each board.
Here's an example for the Metro M4 Express:
Code: Select all
adafruit_metro_m4.menu.opt.noOpt=NoOptimize (-Og) debugging
adafruit_metro_m4.menu.opt.noOpt.build.flags.optimize=-Og
Code: Select all
adafruit_grandcentral_m4.menu.opt.noOpt=NoOptimize (-Og) debugging
adafruit_grandcentral_m4.menu.opt.noOpt.build.flags.optimize=-Og
My modified boards.txt is attached to this post. You can use it in Windows by copying it to C:\Users\[yourWindowsUsernameHere]\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.3 and restarting the Arduino IDE.