AS7: debug main program after launching bootloader?

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

I'm sure this has been asked before, but after 40 minutes of searching, I turn to the community for help...

 

Context: I have two AS7 applications: a bootloader (starts at 0x00000) and the main app (starts at 0x10000).  The bootloader loads the main app without trouble, but there's a problem in the main app I'd like to debug. 

 

I can launch the bootloader under the AS7 debugger, but how do I load the main program's symbols and debug info so I can debug it after the bootloader jumps to it?

 

(Aside #1: I know this is possible under Eclipse, and I assume that there must be a way to do this under AS7.)

(Aside #2: If there are better keywords to include in the title so others can find this, let me know and I'll change it!)

 

This topic has a solution.

- rdp

 

Last Edited: Wed. Sep 1, 2021 - 06:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I did try that and wrote this 

I usually just don't have the bootloader flashed if I need to debug/develop the application but I just tested flashing the application using the bootloader and then debug with option "skip programming" and that seems ok.

in a thread here:

https://community.atmel.com/foru...

 

"and then debug" there means debug the application btw.

 /Lars

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

In my case (a SAME54), the reset vectors for the main app start at 0x10000 and depend upon the bootloader to call this:

  SCB->VTOR = ((uint32_t)entry_point & SCB_VTOR_TBLOFF_Msk);

to set up the vector. 

 

So if the bootloader isn't present, is there a way to get AS7 do the equivalent thing?

- rdp

 

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

I don't know but why do you need that? Have the bootloader flashed (+ let it flash the app) and do as a suggested above or relocate the app while you are working on it and debug normally.

/Lars

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


@lajon: Based on your comment, I figured it out:

In my case (a SAME54), the reset vectors for the main app start at 0x10000

That's exactly what the "Override Vector Table Offset Register" setting is for under Project => Tool menu is for:

 

 

I set that to 0x10000 and it works like a champ.  Thank you.

 

- rdp

 

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

I don't know but why do you need that? Have the bootloader flashed (+ let it flash the app) and do as a suggested above or relocate the app while you are working on it and debug normally.

In this particular case, I had a version of the app that worked standalone, and a punitively identical version that didn't work when loaded under the bootloader.  I needed to eliminate the bootloader as a cause for failure.  But see proposed solution...

- rdp