load command inside gdb CLI doesn't flash new image into device

I use `west debug` to start `gdb` for debugging nRF5340DK

when I use `west build` to update the image, I use `load` command inside gdb CLI, the new `zephyr.elf` is loaded, then `mon reset` and `continue` but the execution (changed text inside LOG_) still remains, I think the load doesn't flash the device as intended.

(gdb) mon flash download=1
Flash download enabled
(gdb) load
Loading section rom_start, size 0x154 lma 0x8000
Loading section text, size 0x4464c lma 0x8154
Loading section .ARM.exidx, size 0x8 lma 0x4c7a0
Loading section initlevel, size 0xa8 lma 0x4c7a8
Loading section device_area, size 0xa0 lma 0x4c850
Loading section sw_isr_table, size 0x228 lma 0x4c8f0
Loading section app_shmem_regions, size 0x8 lma 0x4cb18
Loading section _static_thread_data_area, size 0x2c lma 0x4cb20
Loading section ctors, size 0xc lma 0x4cb4c
Loading section log_const_area, size 0xc0 lma 0x4cb58
Loading section log_backend_area, size 0x10 lma 0x4cc18
Loading section zephyr_dbg_info, size 0x41 lma 0x4cc28
Loading section shell_area, size 0x30 lma 0x4cc6c
Loading section shell_root_cmds_area, size 0x30 lma 0x4cc9c
Loading section shell_subcmds_area, size 0x14 lma 0x4cccc
Loading section shell_dynamic_subcmds_area, size 0xc lma 0x4cce0
Loading section rodata, size 0xb594 lma 0x4ccf0
Loading section datas, size 0x5c0 lma 0x58a84
Loading section device_states, size 0x10 lma 0x59044
Loading section log_mpsc_pbuf_area, size 0x44 lma 0x59054
Loading section log_msg_ptr_area, size 0x4 lma 0x59098
Loading section log_dynamic_area, size 0x60 lma 0x5909c
Loading section k_mem_slab_area, size 0x20 lma 0x590fc
Loading section k_mutex_area, size 0x14 lma 0x5911c
Loading section k_sem_area, size 0x18 lma 0x59130
Loading section net_buf_pool_area, size 0x34 lma 0x59148
Loading section kobject_data, size 0x5d0 lma 0x5917c
Loading section .last_section, size 0x4 lma 0x5974c
Start address 0x00017f20, load size 331593
Transfer rate: 477 KB/sec, 7055 bytes/write.
(gdb) mon reset
Resetting target
(gdb) c
Continuing.

Parents
  • Hi,

    Could you provide all commands that you used in sequential order and relevant commands' output? Where did you run mentioned commands from?

    Which command did you run to get showed loading section? Is the loading section that you showed complete? If not, could you please provide a complete one?

    Best regards,
    Dejan


  • I first use

    west debug

    to start gdb, then it loaded and flash firmware into nRF5340.

    then inside gdb command line,

    I used the commands ( they are all under gdb command line prompt ) as the code I referenced in my first post.

  • Under Debian bookworm

    My workspace likes:

    ROOT / applications / app / src

                                              / CMakeLists.txt

                                              / boards / ... overlay/conf

               / ncs / nrf

                        / zephyr

                        / nrfxlib

                        / bootloader

                        / ...

    I ran "west debug" under my application root directory, which "app" in above directory structure.

  • Hi,

    Thank you for additional information.

    when I use `west build` to update the image, I use `load` command inside gdb CLI, the new `zephyr.elf` is loaded, then `mon reset` and `continue` but the execution (changed text inside LOG_) still remains, I think the load doesn't flash the device as intended.

    Could you rephrase "but the execution (changed text inside LOG_) still remains"?
    What do you expect to happen and what actually happens?

    Best regards,
    Dejan

  • Normally, when I started a gdb session, and I changed and rebuilt my code, I don't need to quit and restart my gdb session, I just need to use gdb load command to both : reload symbols and re-flash the device, and use mon reset and continue to use the new firmware.

    But now, the load command only reload symbols but didn't flash the device use the new binary. I have to quit gdb session and use west debug to start gdb again, or not quit current gdb session, but use west flash in another terminal to do flashing the device to use the new firmware ( still need to use gdb load command to reload the symbols)

  • Hi,

    If you have multi-image build, "load" should not be used since it only loads the current .elf file but not the other such as tf-m or mcuboot.

    Could you check if the same issue happens when you use nrf52840-dk?

    Best regards,
    Dejan

  • I don't have nrf52840-DK in hand.

    I am using single application core, not multi image build.

Reply Children
Related