Data Abort Exception with PROS

I’m trying to code a way of testing auton code in opcontrol so I can test an auton selector since I don’t have a comp switch with me right now and the controller doesn’t allow you to use the auton selector, it just jumps straight into auton. However, when I press the button right now, the brain shows “DATA ABORT EXCEPTION” on the screen after the auton is run. What am I doing wrong? Here is the code: https://github.com/2112A-code-team/ogegiog-Code. The code to run auton on a button press is in opcontrol.cpp, the actual auton and auton selector are in autonomous.cpp and a little bit in initialize.cpp.

Debugging guide: in case of a segfault or data abort exception, the first step is to make sure you run your program with the PROS terminal connected. When the exception occurs, you should see a section that starts with “BEGIN STACK TRACE” and contains a list of numbers. These numbers are the addresses of the instructions on the call stack at the time of the exception. Make a note of them. Now we can translate the addresses into filenames and even line numbers. Close the PROS terminal connection if you haven’t already, and run the following command: (For windows:)

"%PROS_TOOLCHAIN%\bin\arm-none-eabi-addr2line" -faps -e .\bin\hot.package.elf

If in the VSCode extension’s PROS Integrated Terminal,

arm-none-eabi-addr2line -faps -e .\bin\hot.package.elf

(For linux/macos:)

arm-none-eabi-addr2line -faps -e ./bin/hot.package.elf

then you can paste in the addresses from earlier. Note: You may also need to change hot.package.elf to cold.package.elf if you get a bunch of question marks. Also if you don’t have the hot or cold packages, run with monolith.elf instead. This should give you the location of the line that triggered the exception.

Above is the default guide to identifying what is causing data abort exceptions. it gives you the full code flow that triggers the exception. typically, the thing that triggers data abort exceptions is doing something bad with memory. hopefully this guide can help you pinpoint where it is going wrong, and from there you can identify what you are doing that would cause it to happen.

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.