2

I use OpenOCD + GDB to debug the firmware. When I type load it loads the code to the FLASH memory:

Loading section ExtFlashSection, size 0x3fe000 lma 0x90000000
Loading section .isr_vector, size 0x1f8 lma 0x8000000
Loading section .text, size 0x19978 lma 0x8000200
Loading section .rodata, size 0x52d0 lma 0x8019b78
Loading section .ARM, size 0x8 lma 0x801ee48
Loading section .init_array, size 0x10 lma 0x801ee50
Loading section .fini_array, size 0x4 lma 0x801ee60
Loading section TextFlashSection, size 0x8 lma 0x801ee64
Loading section FontFlashSection, size 0x30b1c lma 0x801ee6c
Loading section .data, size 0x9c lma 0x804f988
Start address 0x80005f0, load size 4512284
Transfer rate: 89 KB/sec, 2926 bytes/write.

However, I want the ExtFlashSection to be not loaded, because I load it manually by external tool (it extracts the contents from the ELF and flashes). I tried adding NOLOAD attribute to that section, but then it is not present in the final ELF file (so I can not extract it).

How to tell GDB or OpenOCD to discard the contents of ExtFlashSection?

Piotr Jedyk
  • 361
  • 1
  • 10
  • Did you find a solution? I want to do the opposite, only load 1 section. I checked ELF sizes with/without NOLOAD and I am surprised to find you are correct that the section contents are not there. This does not match what is stated in the docs. I suppose we could just maintain 2 different ELF files? – PizzaBeer May 19 '20 at 09:08
  • 1
    @PizzaBeer I did not. I just wrote Makefiles to link two copies of ELF -- one with NOLOAD and one without. – Piotr Jedyk May 20 '20 at 10:07

0 Answers0