nRF52840

Sysprogs forums Forums VisualGDB nRF52840

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #12201
    vard
    Participant

    Hi Everyone,

    I was just wondering if someone had a chance to work with the new nRF52840.

    In VGDB debugger settings I get the following error:

    Debugged Device: nRF52840XXAA(unknown).

    I tried replacing the device with the nRF52832xxAA, then went back and changed it to default 52840 and ignored warnings.

    The code compiles, I can load it in the nRF52840 Preview Dev kit, but any code I load from the examples is crashing in pretty much the same way (signal handler called, Frame not in module).

    I am using VGDB 5.3 Preview 7 (build 1744)

    Any suggestions?

    Thank you!

    #12204
    support
    Keymaster

    Hi,

    VisualGDB takes the list of supported devices from the MCU.CSV file in the Segger Software directory.

    It looks like the nRF52840_xxAA device is supported, but not listed there. We will contact Segger support for clarification. As a workaround, please try adding an entry to the CSV file manually so that VisualGDB can recognize it.

     

    #12217
    vard
    Participant

     

    Thank you kindly for your reply,  I’ve added the nRF52840 line in the mcu.csv and the device is now being properly recognized by the debugger.

    My line in the MCU.csv file looks like this:

    Nordic Semi;nRF52840_xxAA;nRF52840_xxAA internal;0E0000FF;0;0;0;4BA00477;0;20000000;8000

    I believe 0x4BA00477 is the Cortex-M4 core type id, 0x20000000 is the SRAM start, but I’m not too sure about 0x0E0000FF though, I just copied it from nRF52832, and I don’t really know what it represents, I could not find anything at that location by just looking at the nRF52832 memory map or within the nRF52832 documentation.

    Still, going back to the nRF52840, no matter which example I run for the nRF52840, I always get the same error: Exception Thrown, received a SIGTRAP…

    The call stack always points to the same area:

    0x000208fe ; <UNDEFINED> instruction: 0xffffffff

     

    I am using the nRF52840 Preview Development Kit (DK) board PCA10056.

     

    Any other suggestions are greatly appreciated.

     

    Thank you!

    #12220
    support
    Keymaster

    Hi,

    We have just retested it with the nRF52840 (PCA10056) and could not reproduce any issues. Do you get this error with all projects (including the basic “Blinking LED”) or only with some specific projects?

    #12231
    vard
    Participant

    Thank you for your reply.

    It does that with any program. Please download my Blinki demo and try it out.

    Inside the folder you will also find a screenshot.png file with the error I get. The program never runs on the dev board, breakpoints are not executed. Please also note that the dev board is perfectly fine when programmed in other ways (hex directly to JLink, IAR compiler, etc.). I just cannot get it to program right with VSGDB.

    Many thanks!

    #12240
    support
    Keymaster

    Hi,

    Thanks, we have tried building and running your project on our nRF52840 board and it worked out-of-the-box.

    Please check if you are using the same SDK version with IAR. If not, the latest Nordic SDK might be incompatible with the preview board and would only work with the final version of it.

    #12241
    vard
    Participant

    Thank you very much for your reply, the SDK I used with IAR is nRF5_SDK_14.0.0_3bcc1f7.

    I took the nRF52840_Blinki.bin file generated by VSGDB and dropped it in the JLINK drive. The file was properly programmed and worked like a charm, so that means it was properly compiled and linked. The issue I’m having is that I cannot properly program the board using VSGDB and Segger, and that makes me think this is not an SDK issue, but rather a JLINK driver problem or a MCU.CSV definition problem.

    I have already talked about the exact line I embedded in the MCU.csv file and you had no comments, which makes me think my mcu definition line was correct.

    Next, I am using JLink_V616a, is this the same version you have tested my sample program with?

    Thanks again for all the help!

     

    #12242
    support
    Keymaster

    Hi,

    Strange, normally the MCU.CSV file should not affect the J-Link stub (you can try removing the line from it after you edited the VisualGDB settings to be 100% sure).

    Can you also confirm that the problem happens when you launch the segger gdb stub manually and connect gdb from command line? You can use the following gdb commands to test it:

    gdb <elf file>
    target remote :3333
    load
    continue
    #12243
    vard
    Participant

    I will try that next, but just as an FYI, I have tried to Program and Start Without Debugging and it failed to program the device: Debugging Failed: Failed to program 6 out of 6 sections.

    GDB Log:

    C:\SysGCC\arm-eabi\bin\arm-eabi-gdb.exe –interpreter mi C:\nRF_VSGDB\Blinky_2\VisualGDB\Debug\Blinky_2
    -gdb-version
    =thread-group-added,id=”i1″
    ~”GNU gdb (GDB) 7.12\n”
    ~”Copyright (C) 2016 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \”show copying\”\nand \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-pc-mingw32 –target=arm-eabi\”.\nType \”show configuration\” for configuration details.”
    ~”\nFor bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/&gt;.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”…\n”
    ~”Reading symbols from C:\\nRF_VSGDB\\Blinky_2\\VisualGDB\\Debug\\Blinky_2…”
    ~”done.\n”
    ~”GNU gdb (GDB) 7.12\n”
    ~”Copyright (C) 2016 Free Software Foundation, Inc.\n”
    ~”License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \”show copying\”\nand \”show warranty\” for details.\n”
    ~”This GDB was configured as \”–host=i686-pc-mingw32 –target=arm-eabi\”.\nType \”show configuration\” for configuration details.”
    ~”\nFor bug reporting instructions, please see:\n”
    ~”<http://www.gnu.org/software/gdb/bugs/&gt;.\n”
    ~”Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/&gt;.\n”
    ~”For help, type \”help\”.\n”
    ~”Type \”apropos word\” to search for commands related to \”word\”.\n”
    ^done
    -list-features
    ^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”]
    -gdb-set disassembly-flavor intel
    ^error,msg=”No symbol \”disassembly\” in current context.”
    -gdb-set print demangle off
    ^done
    -break-insert -f main
    ^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x0002246e”,func=”main()”,file=”LEDBlink.cpp”,fullname=”C:\\nRF_VSGDB\\Blinky_2\\Blinky_2\\LEDBlink.cpp”,line=”20″,thread-groups=[“i1″],times=”0″,original-location=”main”}
    target remote :51547
    &”target remote :51547\n”
    ~”Remote debugging using :51547\n”
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-created,id=”1″,group-id=”i1″
    ~”0x0002098e in ?? ()\n”
    *stopped,frame={addr=”0x0002098e”,func=”??”,args=[]},thread-id=”1″,stopped-threads=”all”
    ^done
    info shared
    &”info shared\n”
    ~”No shared libraries loaded at this time.\n”
    ^done
    mon reset
    &”mon reset\n”
    @”Resetting target\r\n”
    ^done
    load
    &”load\n”
    ~”Loading section .softdevice, size 0x22000 lma 0x0\n”
    +download,{section=”.softdevice”,section-size=”139264″,total-size=”254555″}
    ~”Loading section .isr_vector, size 0x200 lma 0x22000\n”
    +download,{section=”.isr_vector”,section-size=”512″,total-size=”254555″}
    ~”Loading section .text, size 0x163c lma 0x22200\n”
    +download,{section=”.text”,section-size=”5692″,total-size=”254555″}
    ~”Loading section .init_array, size 0x4 lma 0x2383c\n”
    +download,{section=”.init_array”,section-size=”4″,total-size=”254555″}
    ~”Loading section .fini_array, size 0x4 lma 0x23840\n”
    +download,{section=”.fini_array”,section-size=”4″,total-size=”254555″}
    ~”Loading section .data, size 0x4 lma 0x23844\n”
    +download,{section=”.data”,section-size=”4″,total-size=”254555″}
    ~”Start address 0x22b50, load size 145480\n”
    ~”Transfer rate: 14207 KB/sec, 10391 bytes/write.\n”
    ^done
    mon reset
    &”mon reset\n”
    @”Resetting target\r\n”
    ^done
    compare-sections
    &”compare-sections\n”
    ~”Section .softdevice, range 0x0 — 0x22000: MIS-MATCHED!\n”
    ~”Section .isr_vector, range 0x22000 — 0x22200: MIS-MATCHED!\n”
    ~”Section .text, range 0x22200 — 0x2383c: MIS-MATCHED!\n”
    ~”Section .init_array, range 0x2383c — 0x23840: MIS-MATCHED!\n”
    ~”Section .fini_array, range 0x23840 — 0x23844: MIS-MATCHED!\n”
    ~”Section .data, range 0x23844 — 0x23848: MIS-MATCHED!\n”
    &”warning: One or more sections of the target image does not match\nthe loaded file\n”
    &”\n”
    ^done

     

     

    GDB Server Log:

    C:\Program Files (x86)\SEGGER\JLink_V616a\JLinkGDBServerCL.exe -select USB -device nRF52840_XXAA -speed auto -if SWD -port 51547
    SEGGER J-Link GDB Server V6.16a Command Line Version

    JLinkARM.dll V6.16a (DLL compiled Jun 6 2017 12:42:51)

    —–GDB Server start settings—–
    GDBInit file: none
    GDB Server Listening port: 51547
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: off
    Init regs on start: off
    Silent mode: off
    Single run mode: off
    Target connection timeout: 0 ms
    ——J-Link related settings——
    J-Link Host interface: USB
    J-Link script: none
    J-Link settings file: none
    ——Target related settings——
    Target device: nRF52840_XXAA
    Target interface: SWD
    Target interface speed: auto
    Target endian: little

    Connecting to J-Link…
    J-Link is connected.
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 2 2017 12:22:13
    Hardware: V1.00
    S/N: 683669353
    Checking target voltage…
    Target voltage: 3.30 V
    Listening on TCP/IP port 51547
    Connecting to target…Connected to target
    Waiting for GDB connection…Connected to 127.0.0.1
    Reading all registers
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 4 bytes @ address 0x0002098E (Data = 0xF44FE7FD)
    Read 2 bytes @ address 0x0002098E (Data = 0xE7FD)
    Resetting target
    Downloading 16256 bytes @ address 0x00000000
    Downloading 16240 bytes @ address 0x00003F80
    Downloading 16208 bytes @ address 0x00007EF0
    Downloading 16240 bytes @ address 0x0000BE40
    Downloading 16208 bytes @ address 0x0000FDB0
    Downloading 16256 bytes @ address 0x00013D00
    Downloading 16208 bytes @ address 0x00017C80
    Downloading 16160 bytes @ address 0x0001BBD0
    Downloading 9488 bytes @ address 0x0001FAF0
    Downloading 512 bytes @ address 0x00022000
    Downloading 5692 bytes @ address 0x00022200
    Downloading 4 bytes @ address 0x0002383C
    Downloading 4 bytes @ address 0x00023840
    Downloading 4 bytes @ address 0x00023844
    Writing register (PC = 0x502b0200)
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 2 bytes @ address 0x0002246E (Data = 0xFFFF)
    Read 4 bytes @ address 0x00022B50 (Data = 0xFFFFFFFF)
    Resetting target
    Reading 1024 bytes @ address 0x00000000
    Reading 1024 bytes @ address 0x00000400
    Reading 1024 bytes @ address 0x00000800
    Reading 1024 bytes @ address 0x00000C00
    Reading 1024 bytes @ address 0x00001000
    Reading 1024 bytes @ address 0x00001400
    Reading 1024 bytes @ address 0x00001800
    Reading 1024 bytes @ address 0x00001C00
    Reading 1024 bytes @ address 0x00002000
    Reading 1024 bytes @ address 0x00002400
    Reading 1024 bytes @ address 0x00002800
    Reading 1024 bytes @ address 0x00002C00
    Reading 1024 bytes @ address 0x00003000
    Reading 1024 bytes @ address 0x00003400
    Reading 1024 bytes @ address 0x00003800
    Reading 1024 bytes @ address 0x00003C00
    Reading 1024 bytes @ address 0x00004000
    Reading 1024 bytes @ address 0x00004400
    Reading 1024 bytes @ address 0x00004800
    Reading 1024 bytes @ address 0x00004C00
    Reading 1024 bytes @ address 0x00005000
    Reading 1024 bytes @ address 0x00005400
    Reading 1024 bytes @ address 0x00005800
    Reading 1024 bytes @ address 0x00005C00
    Reading 1024 bytes @ address 0x00006000
    Reading 1024 bytes @ address 0x00006400
    Reading 1024 bytes @ address 0x00006800
    Reading 1024 bytes @ address 0x00006C00
    Reading 1024 bytes @ address 0x00007000
    Reading 1024 bytes @ address 0x00007400
    Reading 1024 bytes @ address 0x00007800
    Reading 1024 bytes @ address 0x00007C00
    Reading 1024 bytes @ address 0x00008000
    Reading 1024 bytes @ address 0x00008400
    Reading 1024 bytes @ address 0x00008800
    Reading 1024 bytes @ address 0x00008C00
    Reading 1024 bytes @ address 0x00009000
    Reading 1024 bytes @ address 0x00009400
    Reading 1024 bytes @ address 0x00009800
    Reading 1024 bytes @ address 0x00009C00
    Reading 1024 bytes @ address 0x0000A000
    Reading 1024 bytes @ address 0x0000A400
    Reading 1024 bytes @ address 0x0000A800
    Reading 1024 bytes @ address 0x0000AC00
    Reading 1024 bytes @ address 0x0000B000
    Reading 1024 bytes @ address 0x0000B400
    Reading 1024 bytes @ address 0x0000B800
    Reading 1024 bytes @ address 0x0000BC00
    Reading 1024 bytes @ address 0x0000C000
    Reading 1024 bytes @ address 0x0000C400
    Reading 1024 bytes @ address 0x0000C800
    Reading 1024 bytes @ address 0x0000CC00
    Reading 1024 bytes @ address 0x0000D000
    Reading 1024 bytes @ address 0x0000D400
    Reading 1024 bytes @ address 0x0000D800
    Reading 1024 bytes @ address 0x0000DC00
    Reading 1024 bytes @ address 0x0000E000
    Reading 1024 bytes @ address 0x0000E400
    Reading 1024 bytes @ address 0x0000E800
    Reading 1024 bytes @ address 0x0000EC00
    Reading 1024 bytes @ address 0x0000F000
    Reading 1024 bytes @ address 0x0000F400
    Reading 1024 bytes @ address 0x0000F800
    Reading 1024 bytes @ address 0x0000FC00
    Reading 1024 bytes @ address 0x00010000
    Reading 1024 bytes @ address 0x00010400
    Reading 1024 bytes @ address 0x00010800
    Reading 1024 bytes @ address 0x00010C00
    Reading 512 bytes @ address 0x00022000
    Reading 1024 bytes @ address 0x00022200
    Read 4 bytes @ address 0x0002383C (Data = 0xFFFFFFFF)
    Read 4 bytes @ address 0x00023840 (Data = 0xFFFFFFFF)

     

     

    Thanks!

    #12252
    support
    Keymaster

    Hi,

    Thanks for the detailed log. If the FLASH programming fails, it could be an indication of a damaged board, so simply getting a new one could be the easiest fix.

    Another option would be to try using J-FLASH or other Segger-specific tools for programming FLASH and see if they report any errors when you try to program the same ELF file.

    #12253
    vard
    Participant

    Well, as I said before, I can program it with IAR, no problems. Also, if I take the .bin file generated by VSGDB and drop it in the J_Link virtual drive that pops-up automatically when you insert the USB cable, the board gets programed and functions just fines. Same with any other examples from the SDK: if dropped in the J-Link drive, all programs will work.  So to me at least, this does not look like a defective board, but rather a communication issue between GDB and J-Link.

    I will try diferent ways of programming the board, see if I can learn anything else.

    Thanks!

    #12254
    vard
    Participant

    I just programmed the hex file generated by VSGDB using command line nrfjprog:

    nrfjprog -f NRF52 –program c:\nRF_VSGDB\Blinky_3\VisualGDB\Debug\Blinky_3.hex –chiperase

    No issues, board programs fine and the Blinky works fine.

    #12255
    support
    Keymaster

    Hi,

    The virtual drive could be using a different FLASH programming mechanism (e.g. different frequency) that does not trigger the bug, so it’s hard to say what exactly happens without an in-depth analysis of what is going on with the board. As the problem looks specific to one board instance, it could be easier to simply get another one.

    #12261
    vard
    Participant

    Agreed, I will return the board and get another one.

    Thank you very much for all your help!

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.