1

Background: I have made a standalone Arduino board using Atmega328PB. I have written code for a clock which lights LEDs based on the time. After a day or so it locks up. Sometimes it reboots. I would like to get debug software that will tell me where in the code it is locking up or crashing.
It could be a memory issue - stack and heap crashing(?). Compiler tells me sketch is using 62% of 32256 bytes storage space. Global variables use 34% of dynamic memory leaving 1332 bytes for local variables of 2048 bytes total.

Question: Is there relatively cheap ( < $100) debugging software that is not very complex I could use to solve this issue?

14
  • serial.print() instructions placed in the program and serial monitor
    – jsotola
    May 12, 2020 at 17:07
  • did you use String?
    – Juraj
    May 12, 2020 at 17:20
  • 1
    Atmel Studio and a real hardware debugger. It's hardware you need, not software. Also remove String from your code.
    – Majenko
    May 12, 2020 at 17:41
  • 1
    I am not using String in my code.
    – RickH
    May 12, 2020 at 17:52
  • 1
    @MichelKeijzers, it is a sad state of affairs with debugging the arduino .... i have been using an array of integers ... various points in the program increment one of the integers ... a button press dumps the array to serial ... it avoids time delays due to multiple serial.print() statements within the program
    – jsotola
    May 12, 2020 at 18:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.