Debugging issues with ASF Example Project (breakpoint unable to be hit)

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone!

 

I'm making the jump from 8 bit AVR controllers to the SAM series of microcontrollers and I'm still trying to fill in knowledge gaps.  I prefer to go with the baremetal C approach rather than the ASF files so I'm working on sorting through the millions of sub calls of the ASF to get to the core register calls so I can actually use the datasheet. 

 

I'm working with the SAM E70 development board and opened a project called "IOPORT_EXAMPLE3", which basically reads the value of the button and displays it on the LED.  Pretty straight easy project that should take 5 minutes on an 8 bit AVR but apparently, it's a lot more complicated to do something this basic on the SAM controllers (at least in terms of setting up the clocks, but that's probably to be expected). 

Anyway, when trying to dive into the code, I tried to put a few breakpoints in and it doesn't appear to let me set breakpoints on them (it says breakpoint unable to be hit):

 

 

Are you unable to set breakpoints on ASF's or is this likely an optimization setting related to this project?  Any help you can give me to help dissect this a bit further would be appreciated!  I'm actually able to follow the "go to implementation" to find where the code calls go but I'd like to understand why my debug mode doesn't appear to want to let me debug anything of value. 

 

Thanks!

This topic has a solution.

Last Edited: Wed. Jul 4, 2018 - 07:20 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is a common problem that breakpoints are not applied to inline macros.
I think that it is common to insert a nop instruction and set a break point.

 

    asm("nop");

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks so much for the suggestion, it looks like that helped get some consistent breakpoints.  I couldn't get your command to work so I used the following (from another thread but the same concept):

 

#define _NOP() do { __asm__ __volatile__ ("nop"); } while (0)

_NOP();

 

That seemed to work for me.  Thanks for the suggestion, I wouldn't have even thought to try that!