VisualGDB / J-Link / Cortex-M0 issue

Sysprogs forums Forums VisualGDB VisualGDB / J-Link / Cortex-M0 issue

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20736
    zzattack
    Participant

    I’ve encountered problems when trying to debug a Cortex-M0 project using a SEGGER J-Link device. The microcontroller is a STM32F091CC and debugging works perfectly fine over SWD with ST-Link devices.

    Programming works fine and the debugging session seems to start, but breakpoints are never hit and there’s all sorts of errors in the GDB session output window.

    I’ve tried several combinations of versions, J-Link 6.30, 6.31 and 6.32, and VisualGDB 5.3 and 5.4 preview.

     

     

    [code]
    VisualGDB is licensed to Frank Razenberg at Razenberg Engineering
    c:\sysgcc\arm-eabi\bin\arm-eabi-gdb.exe –interpreter mi C:\Users\Frank\Desktop\multichip\obd2-device\obd2\VisualGDB\Debug\obd2
    -gdb-version
    =thread-group-added,id=”i1″
    GNU gdb (GDB) 8.0.1
    Copyright (C) 2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type “show copying”
    and “show warranty” for details.
    This GDB was configured as “–host=i686-w64-mingw32 –target=arm-eabi”.
    Type “show configuration” for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/&gt;.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/&gt;.
    For help, type “help”.
    Type “apropos word” to search for commands related to “word”…
    Reading symbols from C:\Users\Frank\Desktop\multichip\obd2-device\obd2\VisualGDB\Debug\obd2…
    done.
    GNU gdb (GDB) 8.0.1
    Copyright (C) 2017 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type “show copying”
    and “show warranty” for details.
    This GDB was configured as “–host=i686-w64-mingw32 –target=arm-eabi”.
    Type “show configuration” for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/&gt;.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/&gt;.
    For help, type “help”.
    Type “apropos word” to search for commands related to “word”.
    OK
    -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
    No symbol “disassembly” in current context.
    -gdb-set print demangle off
    OK
    -break-insert -f main
    ^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x08017ed8″,func=”main”,file=”C:/Users/Frank/Desktop/multichip/obd2-device/Src/main.c”,fullname=”C:\\Users\\Frank\\Desktop\\multichip\\obd2-device\\Src\\main.c”,line=”103″,thread-groups=[“i1″],times=”0″,original-location=”main”}
    target remote :57180
    &”target remote :57180\n”
    Remote debugging using :57180
    =thread-group-started,id=”i1″,pid=”42000″
    =thread-created,id=”1″,group-id=”i1″
    0x08012274 in GSM_Delay (GSM=0x2000074c <GSM>, timeout=100) at C:/Users/Frank/Desktop/multichip/obd2-device/gsm/gsm.c:3113
    3113 } while (GSM->Time – start < timeout);
    *stopped,frame={addr=”0x08012274″,func=”GSM_Delay”,args=[{name=”GSM”,value=”0x2000074c <GSM>”},{name=”timeout”,value=”100″}],file=”C:/Users/Frank/Desktop/multichip/obd2-device/gsm/gsm.c”,fullname=”C:\\Users\\Frank\\Desktop\\multichip\\obd2-device\\gsm\\gsm.c”,line=”3113″},thread-id=”1″,stopped-threads=”all”
    info shared
    OK
    &”info shared\n”
    No shared libraries loaded at this time.
    OK
    mon reset
    &”mon reset\n”
    Resetting target
    OK
    load
    &”load\n”
    Loading section .isr_vector, size 0xbc lma 0x8000000
    +download,{section=”.isr_vector”,section-size=”188″,total-size=”1112444″}
    +download,{section=”.isr_vector”,section-sent=”188″,section-size=”188″,total-sent=”188″,total-size=”1112444″}
    Loading section .text, size 0x23aa0 lma 0x80000c0
    +download,{section=”.text”,section-size=”146080″,total-size=”1112444″}
    Loading section .exidx, size 0x8 lma 0x8023b60
    +download,{section=”.exidx”,section-size=”8″,total-size=”1112444″}
    Loading section .init_array, size 0x4 lma 0x8023b68
    +download,{section=”.init_array”,section-size=”4″,total-size=”1112444″}
    Loading section .fini_array, size 0x4 lma 0x8023b6c
    +download,{section=”.fini_array”,section-size=”4″,total-size=”1112444″}
    Loading section .data, size 0x1e0 lma 0x8023b70
    +download,{section=”.data”,section-size=”480″,total-size=”1112444″}
    Start address 0x802097c, load size 146764
    Transfer rate: 23887 KB/sec, 9784 bytes/write.
    OK
    -data-evaluate-expression “sizeof(void *)”
    ^done,value=”4″
    -data-evaluate-expression “sizeof(int)”
    -data-evaluate-expression “sizeof(short)”
    ^done,value=”4″
    ^done,value=”2″
    -data-evaluate-expression “sizeof(long)”
    ^done,value=”4″
    -data-evaluate-expression “sizeof(long long)”
    ^done,value=”8″
    -data-evaluate-expression “sizeof(char)”
    ^done,value=”1″
    -data-evaluate-expression “sizeof(wchar_t)”
    ^done,value=”4″
    -data-evaluate-expression “sizeof(float)”
    ^done,value=”4″
    -data-evaluate-expression “sizeof(double)”
    ^done,value=”8″
    -data-evaluate-expression “sizeof(long double)”
    ^done,value=”8″
    info target
    &”info target\n”
    Symbols from “C:\Users\Frank\Desktop\multichip\obd2-device\obd2\VisualGDB\Debug\obd2”.
    Remote serial target in gdb-specific protocol:
    Debugging a target over a serial line.
    While running this, GDB does not access memory from…
    Local exec file:
    `
    C:\Users\Frank\Desktop\multichip\obd2-device\obd2\VisualGDB\Debug\obd2′, file type elf32-littlearm.
    Entry point: 0x802097c
    0x08000000 – 0x080000bc is .isr_vector
    0x080000c0 – 0x08023b60 is .text
    0x08023b60 – 0x08023b68 is .exidx
    0x08023b68 – 0x08023b6c is .init_array
    0x08023b6c – 0x08023b70 is .fini_array
    0x20000000 – 0x200001e0 is .data
    0x200001e0 – 0x200073e0 is .bss
    OK
    -data-evaluate-expression “&_estack”
    ^done,value=”0x20008000″
    -var-create – * “*((void **)0x20007ffc)”
    ^done,name=”var1″,numchild=”0″,value=”0x80209ad <Reset_Handler+48>”,type=”void *”,has_more=”0″
    -var-assign “var1″ 0x3b2a0780
    ^done,value=”0x3b2a0780”
    -data-evaluate-expression “\*\(\(void\ \*\*\)0x20007ffc\)”
    ^done,value=”0x3b2a0780″
    info signals
    &”info signals\n”
    Signal Stop Print Pass to program Description

    SIGHUP Yes Yes Yes Hangup
    SIGINT Yes Yes No Interrupt
    SIGQUIT Yes Yes Yes Quit
    SIGILL Yes Yes Yes Illegal instruction
    SIGTRAP Yes Yes No Trace/breakpoint trap
    SIGABRT Yes Yes Yes Aborted
    SIGEMT Yes Yes Yes Emulation trap
    SIGFPE Yes Yes Yes Arithmetic exception
    SIGKILL Yes Yes Yes Killed
    SIGBUS Yes Yes Yes Bus error
    SIGSEGV Yes Yes Yes Segmentation fault
    SIGSYS Yes Yes Yes Bad system call
    SIGPIPE Yes Yes Yes Broken pipe
    SIGALRM No No Yes Alarm clock
    SIGTERM Yes Yes Yes Terminated
    SIGURG No No Yes Urgent I/O condition
    SIGSTOP Yes Yes Yes Stopped (signal)
    SIGTSTP Yes Yes Yes Stopped (user)
    SIGCONT Yes Yes Yes Continued
    SIGCHLD No No Yes Child status changed
    SIGTTIN Yes Yes Yes Stopped (tty input)
    SIGTTOU Yes Yes Yes Stopped (tty output)
    SIGIO No No Yes I/O possible
    SIGXCPU Yes Yes Yes CPU time limit exceeded
    SIGXFSZ Yes Yes Yes File size limit exceeded
    SIGVTALRM No No Yes Virtual timer expired
    SIGPROF No No Yes Profiling timer expired
    SIGWINCH No No Yes Window size changed
    SIGLOST Yes Yes Yes Resource lost
    SIGUSR1 Yes Yes Yes User defined signal 1
    SIGUSR2 Yes Yes Yes User defined signal 2
    SIGPWR Yes Yes Yes Power fail/restart
    SIGPOLL No No Yes Pollable event occurred
    SIGWIND Yes Yes Yes SIGWIND
    SIGPHONE Yes Yes Yes SIGPHONE
    SIGWAITING No No Yes Process’s LWPs are blocked
    SIGLWP No No Yes Signal LWP
    SIGDANGER Yes Yes Yes Swap space dangerously low
    SIGGRANT Yes Yes Yes Monitor mode granted
    SIGRETRACT Yes Yes Yes Need to relinquish monitor mode
    SIGMSG Yes Yes Yes Monitor mode data available
    SIGSOUND Yes Yes Yes Sound completed
    SIGSAK Yes Yes Yes Secure attention
    SIGPRIO No No Yes SIGPRIO
    SIG33 Yes Yes Yes Real-time event 33
    SIG34 Yes Yes Yes Real-time event 34
    SIG35 Yes Yes Yes Real-time event 35
    SIG36 Yes Yes Yes Real-time event 36
    SIG37 Yes Yes Yes Real-time event 37
    SIG38 Yes Yes Yes Real-time event 38
    SIG39 Yes Yes Yes Real-time event 39
    SIG40 Yes Yes Yes Real-time event 40
    SIG41 Yes Yes Yes Real-time event 41
    SIG42 Yes Yes Yes Real-time event 42
    SIG43 Yes Yes Yes Real-time event 43
    SIG44 Yes Yes Yes Real-time event 44
    SIG45 Yes Yes Yes Real-time event 45
    SIG46 Yes Yes Yes Real-time event 46
    SIG47 Yes Yes Yes Real-time event 47
    SIG48 Yes Yes Yes Real-time event 48
    SIG49 Yes Yes Yes Real-time event 49
    SIG50 Yes Yes Yes Real-time event 50
    SIG51 Yes Yes Yes Real-time event 51
    SIG52 Yes Yes Yes Real-time event 52
    SIG53 Yes Yes Yes Real-time event 53
    SIG54 Yes Yes Yes Real-time event 54
    SIG55 Yes Yes Yes Real-time event 55
    SIG56 Yes Yes Yes Real-time event 56
    SIG57 Yes Yes Yes Real-time event 57
    SIG58 Yes Yes Yes Real-time event 58
    SIG59 Yes Yes Yes Real-time event 59
    SIG60 Yes Yes Yes Real-time event 60
    SIG61 Yes Yes Yes Real-time event 61
    SIG62 Yes Yes Yes Real-time event 62
    SIG63 Yes Yes Yes Real-time event 63
    SIGCANCEL No No Yes LWP internal signal
    SIG32 Yes Yes Yes Real-time event 32
    SIG64 Yes Yes Yes Real-time event 64
    SIG65 Yes Yes Yes Real-time event 65
    SIG66 Yes Yes Yes Real-time event 66
    SIG67 Yes Yes Yes Real-time event 67
    SIG68 Yes Yes Yes Real-time event 68
    SIG69 Yes Yes Yes Real-time event 69
    SIG70 Yes Yes Yes Real-time event 70
    SIG71 Yes Yes Yes Real-time event 71
    SIG72 Yes Yes Yes Real-time event 72
    SIG73 Yes Yes Yes Real-time event 73
    SIG74 Yes Yes Yes Real-time event 74
    SIG75 Yes Yes Yes Real-time event 75
    SIG76 Yes Yes Yes Real-time event 76
    SIG77 Yes Yes Yes Real-time event 77
    SIG78 Yes Yes Yes Real-time event 78
    SIG79 Yes Yes Yes Real-time event 79
    SIG80 Yes Yes Yes Real-time event 80
    SIG81 Yes Yes Yes Real-time event 81
    SIG82 Yes Yes Yes Real-time event 82
    SIG83 Yes Yes Yes Real-time event 83
    SIG84 Yes Yes Yes Real-time event 84
    SIG85 Yes Yes Yes Real-time event 85
    SIG86 Yes Yes Yes Real-time event 86
    SIG87 Yes Yes Yes Real-time event 87
    SIG88 Yes Yes Yes Real-time event 88
    SIG89 Yes Yes Yes Real-time event 89
    SIG90 Yes Yes Yes Real-time event 90
    SIG91 Yes Yes Yes Real-time event 91
    SIG92 Yes Yes Yes Real-time event 92
    SIG93 Yes Yes Yes Real-time event 93
    SIG94 Yes Yes Yes Real-time event 94
    SIG95 Yes Yes Yes Real-time event 95
    SIG96 Yes Yes Yes Real-time event 96
    SIG97 Yes Yes Yes Real-time event 97
    SIG98 Yes Yes Yes Real-time event 98
    SIG99 Yes Yes Yes Real-time event 99
    SIG100 Yes Yes Yes Real-time event 100
    SIG101 Yes Yes Yes Real-time event 101
    SIG102 Yes Yes Yes Real-time event 102
    SIG103 Yes Yes Yes Real-time event 103
    SIG104 Yes Yes Yes Real-time event 104
    SIG105 Yes Yes Yes Real-time event 105
    SIG106 Yes Yes Yes Real-time event 106
    SIG107 Yes Yes Yes Real-time event 107
    SIG108 Yes Yes Yes Real-time event 108
    SIG109 Yes Yes Yes Real-time event 109
    SIG110 Yes Yes Yes Real-time event 110
    SIG111 Yes Yes Yes Real-time event 111
    SIG112 Yes Yes Yes Real-time event 112
    SIG113 Yes Yes Yes Real-time event 113
    SIG114 Yes Yes Yes Real-time event 114
    SIG115 Yes Yes Yes Real-time event 115
    SIG116 Yes Yes Yes Real-time event 116
    SIG117 Yes Yes Yes Real-time event 117
    SIG118 Yes Yes Yes Real-time event 118
    SIG119 Yes Yes Yes Real-time event 119
    SIG120 Yes Yes Yes Real-time event 120
    SIG121 Yes Yes Yes Real-time event 121
    SIG122 Yes Yes Yes Real-time event 122
    SIG123 Yes Yes Yes Real-time event 123
    SIG124 Yes Yes Yes Real-time event 124
    SIG125 Yes Yes Yes Real-time event 125
    SIG126 Yes Yes Yes Real-time event 126
    SIG127 Yes Yes Yes Real-time event 127
    SIGINFO Yes Yes Yes Information request
    EXC_BAD_ACCESS Yes Yes Yes Could not access memory
    EXC_BAD_INSTRUCTION Yes Yes Yes Illegal instruction/operand
    EXC_ARITHMETIC Yes Yes Yes Arithmetic exception
    EXC_EMULATION Yes Yes Yes Emulation instruction
    EXC_SOFTWARE Yes Yes Yes Software generated exception
    EXC_BREAKPOINT Yes Yes Yes Breakpoint
    SIGLIBRT No No Yes librt internal signal
    Use the “handle” command to change these tables.
    OK
    -exec-continue
    ^running
    *running,thread-id=”all”
    &”Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061\n”
    &”Quit (expect signal SIGINT when the program is resumed)\n”
    -stack-list-frames –thread 1
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -stack-list-frames –thread 1 0 0
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -data-evaluate-expression –thread 1 “\$pc”
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -stack-list-frames –thread 1
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -stack-list-frames –thread 1 0 0
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -data-evaluate-expression –thread 1 “\$pc”
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -stack-list-frames –thread 1
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -stack-list-frames –thread 1 0 0
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    -data-evaluate-expression –thread 1 “\$pc”
    Remote failure reply: E0010020000000000000000000000000E0730020503D0208FFFFFFFFF87F0020FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF87F0020AD090208D87E010800000061
    [/code]

    • This topic was modified 6 years, 8 months ago by zzattack.
    • This topic was modified 6 years, 8 months ago by zzattack.
    #20744
    support
    Keymaster

    Hi,

    This looks like a problem inside the Segger gdb stub. Please check with Segger support whether they have a fix for this.

    #20748
    zzattack
    Participant

    You seem to be correct, I get much different results with older j-link releases to a point where debugging is somewhat functional.
    The issue I run into with those is setting breakpoints while a program is running:

    “Failed to create a breakpoint: Cannot execute this command while the target is running. Use the “interrupt” command to stop the target and then try again.”

    Manually adding a ‘interrupt’ in the GDB window does the trick but it feels as if VisualGDB should be able to take care of this.

    Hitting ‘break all’ and then setting a breakpoint doesn’t work either. Worse yet, resuming doesn’t work then either:

    
    -exec-continue
    Cannot execute this command while the selected thread is running.
    -stack-list-frames --thread 1
    Selected thread is running.
    -stack-list-frames --thread 1 0 0
    Selected thread is running.
    -data-evaluate-expression --thread 1 "\$pc"
    Selected thread is running.
    -stack-list-frames --thread 1
    Selected thread is running.
    -stack-list-frames --thread 1 0 0
    Selected thread is running.
    -data-evaluate-expression --thread 1 "\$pc"
    Selected thread is running.
    

    I can’t tell whether this is VisualGDB or J-Link related and/or whether (soft-) remedies are available.

    #20755
    support
    Keymaster

    Hi,

    Please try reproducing it on a newly created project. You might have accidentally overridden some settings that control temporary breaks for setting breakpoints. If the problem does not reappear on a newly created project, please compare the .vgdbsettings files of both projects.

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