From: Tommy M. <tom...@ho...> - 2021-05-26 13:05:18
|
> GDB automatically uses hardware breakpoints for all flash regions, so simple "tb" works. OK - I presumed that the only flash bank defined was at 0x08000000 but you seem to be implying that the aliased/remapped version at 0x00000000 is also known to be flash and so hardware breakpoints will be used by default/automatically. ________________________________ From: Tommy Murphy <tom...@ho...> Sent: Wednesday 26 May 2021 14:02 To: Paul Fertser <fer...@gm...> Cc: Andreas Fritiofson <and...@gm...>; Christoph Kukulies <ku...@ku...>; openocd-user lists.sourceforge.net <ope...@li...> Subject: Re: [OpenOCD-user] Relocating an stm32f407 image to 0x00000000 - no flash bank found > And setting $pc this way seems unnecessary, > after "load" the target gets implicit "reset halt" so $pc should be > auto-loaded from the second word of the flash automatically. I don't understand - where is the load command and how can you do load when the program in question is (already) stored in and running from flash? With regard to the initialization of the PC, sorry - I forgot that this was Arm (and thus the initial PC and SP loaded from the start of the vector table) and my mind defaults to RISC-V these days which is different. ________________________________ From: Paul Fertser <fer...@gm...> Sent: Wednesday 26 May 2021 13:28 To: Tommy Murphy <tom...@ho...> Cc: Andreas Fritiofson <and...@gm...>; Christoph Kukulies <ku...@ku...>; openocd-user lists.sourceforge.net <ope...@li...> Subject: Re: [OpenOCD-user] Relocating an stm32f407 image to 0x00000000 - no flash bank found Hey Tommi, Sorry for nitpicking but... On Wed, May 26, 2021 at 12:19:26PM +0000, Tommy Murphy wrote: > monitor reset init > set $pc=_start > (Or whatever the program entry address is if not _start) I would recommend against both these commands. First thing to remember is that anything you do with "mon" you're doing behind GDB's back, so some actions would require a resync (can be done manually with "mon gdb_sync" and then "si"). And setting $pc this way seems unnecessary, after "load" the target gets implicit "reset halt" so $pc should be auto-loaded from the second word of the flash automatically. So both commands are just not needed. > thb main > (Temporary hardware - because running from flash - breakpoint at main()) GDB automatically uses hardware breakpoints for all flash regions, so simple "tb" works. Also, there's a command "start" which places a temp breakpoint on main() and then restarts the target. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fer...@gm... |