Can BMP debug without 'load' command.

alex
Posts: 19
Joined: Tue Jul 28, 2015 2:12 am

Can BMP debug without 'load' command.

Postby alex » Thu Aug 25, 2016 4:59 pm

I mean just keep the .elf in the PC without flash it into the mcu, is it possible?

User avatar
Rick Kimball
Posts: 754
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Can BMP debug without 'load' command.

Postby Rick Kimball » Thu Aug 25, 2016 7:17 pm

Sure, just foo.elf file on the arm-none-eabi-gdb command line when you connect

$ arm-none-eabi-gdb ... all other gdb args .. myprog.elf

Just don't use the load if myprog.elf is the actual code loaded on the chip.
-rick

alex
Posts: 19
Joined: Tue Jul 28, 2015 2:12 am

Re: Can BMP debug without 'load' command.

Postby alex » Fri Aug 26, 2016 4:34 am

Rick Kimball wrote:Sure, just foo.elf file on the arm-none-eabi-gdb command line when you connect

$ arm-none-eabi-gdb ... all other gdb args .. myprog.elf

Just don't use the load if myprog.elf is the actual code loaded on the chip.


I mean if gdb or BMP can take place of the mcu's flash in some way.
I know gdb can load .elf to mcu's RAM by change link script (eg the .ld).

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Can BMP debug without 'load' command.

Postby RogerClark » Fri Aug 26, 2016 6:01 am

BTW.
Running in ram used to be an option in the board menu's but as the sketch now generally takes at least 12 to 15k there is so little ram left in the smaller boards, that it wasn't worth supporting

But if you look in the old leaflabs github libmaple repo you can probably find the linker settings for it (albeit that would include the bootloader, which you are not using), but it would be a start.

alex
Posts: 19
Joined: Tue Jul 28, 2015 2:12 am

Re: Can BMP debug without 'load' command.

Postby alex » Fri Aug 26, 2016 10:20 am

RogerClark wrote:BTW.
Running in ram used to be an option in the board menu's but as the sketch now generally takes at least 12 to 15k there is so little ram left in the smaller boards, that it wasn't worth supporting

But if you look in the old leaflabs github libmaple repo you can probably find the linker settings for it (albeit that would include the bootloader, which you are not using), but it would be a start.


I knew how to running in ram already, to changed the .ld file like this for a 48KB ram mcu
MEMORY
{
rom (rx) : ORIGIN = 0x20000000, LENGTH = 36K
ram (rwx) : ORIGIN = 0x20009000, LENGTH = 12K
}
and change SCB_VTOR in code
SCB_VTOR = 0x20000000;

What I want to know is can I make BMP and gdb to act as "fake external flash".


Return to “Black Magic Probe & other”

Who is online

Users browsing this forum: No registered users and 1 guest