This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to quickly verify the download before stepping in GDB

I have a simple project which uses S110, so I flashed the S110 and the bin, but the result is not as expected (blinking LEDs), is there any quick way to verify before needing to step into GDB?

=== flash of soft device was good: ====

Downloading file [s110_nrf51822_7.1.0_softdevice.bin]...Info: J-Link: Flash download: Flash programming performed for 1 range (87040 bytes) Info: J-Link: Flash download: Total time needed: 15.166s (Prepare: 0.708s, Compare: 0.099s, Erase: 0.000s, Program: 14.292s, Verify: 0.005s, Restore: 0.060s) O.K.

Reset delay: 0 ms Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

=== flash of my bin was good too: ===

Downloading file [_build/led.bin]...Info: J-Link: Flash download: Flash download into internal flash skipped. Flash contents already match Info: J-Link: Flash download: Total time needed: 0.752s (Prepare: 0.616s, Compare: 0.076s, Erase: 0.000s, Program: 0.000s, Verify: 0.000s, Restore: 0.059s) O.K.

Reset delay: 0 ms Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.

Parents
  • Here is the command I use to start up the gdb gasket:

    sn=12345678
    port=20034
    JLinkGDBServer -strict -SettingsFile $dir/jlink.settings \
            -select USB=$sn -device nrf51822 -if SWD -speed 2000 -port $port -vd
    

    The settings file contains:

    [FLASH]
    AllowCaching     = 0
    CacheExcludeAddr = 0x00000000
    CacheExcludeSize = 0x00040000
    VerifyDownload   = 1
    

    You can then load your firmware directly from gdb via the 'load' command, the gdb server will print:

    Downloading 4096 bytes @ address 0x00018000 - Verified OK
    ...
    

    I have several connected jlinks, so the serial number makes sure you are talking to the right debugger.

    FYI, with the -dk a speed of 4000 works just fine, but it doesn't work with my standalone jlink. The standalone jlink also can't seem to handle the higher speed serial interface (230400 works but 460800 cause the jlink to reset after a while).

  • Found out that I had a typo in the ld script name - meant to be gcc_nrf51_s110_xxaa.ld, but was typo of gcc_nrf51_s110_xxab.ld.

    Works now. Thanks!

Reply Children
No Data
Related