Sysprogs forums › Forums › VisualGDB › Debugging problems
- This topic has 16 replies, 3 voices, and was last updated 11 years, 6 months ago by support.
-
AuthorPosts
-
May 27, 2013 at 13:15 #578dadiParticipant
Hi all,
I’ve bought right now a GDB licens and compiled succefull a program I want to download on my MSP430 using an Olimex MSP-430-JTAG-TINY-V2. I’ve tried to do it but I got some errors. So I’ve followed the example of the test program (the Blink test program) but with no success too, even setting the GDB Simulator.
What’s wrong?
Byye
DavideMay 27, 2013 at 16:06 #2442dadiParticipantThat’s the log file for the test program:
VisualGDB is licensed to MYNAMESURNAME
C:SysGCCmsp430binmsp430-gdb.exe –interpreter mi “C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf”
-list-features
=thread-group-added,id=”i1″
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-pc-mingw32 –target=msp430”.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>…
Reading symbols from C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf…
done.
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”]
-gdb-set stop-on-solib-events 1
OK
-gdb-set new-console on
A syntax error in expression, near `new-console on’.
-data-list-register-names
^done,register-names=[“r0″,”r1″,”r2″,”r3″,”r4″,”r5″,”r6″,”r7″,”r8″,”r9″,”r10″,”r11″,”r12″,”r13″,”r14″,”r15”]
-gdb-set disassembly-flavor intel
No symbol “disassembly” in current context.
-gdb-set print demangle off
OK
-gdb-version
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-pc-mingw32 –target=msp430”.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
OK
-break-insert -f main
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x00008042″,func=”main()”,file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”,line=”27″,times=”0″,original-location=”main”}
target sim
&”target simn”
Connected to the simulator.
OK
load
&”loadn”
“C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf” has no bss section.
&”unable to load programn”
unable to load program
-data-evaluate-expression “sizeof(void *)”
^done,value=”2″
-data-evaluate-expression “sizeof(int)”
^done,value=”2″
-data-evaluate-expression “sizeof(short)”
^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)”
No symbol “wchar_t” in current context.
-data-evaluate-expression “sizeof(float)”
^done,value=”4″
-data-evaluate-expression “sizeof(double)”
^done,value=”4″
-data-evaluate-expression “sizeof(long double)”
^done,value=”8″
info target
&”info targetn”
Symbols from “C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf”.
Local exec file:
`C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf’, file type elf32-msp430.
Entry point: 0x8000
0x00008000 – 0x000080c8 is .text
0x00001c00 – 0x00001c02 is .noinit
0x0000ff80 – 0x00010000 is .vectors
OK
-break-insert -f C:/usr/local/GNUBasedApplication2/GNUBasedApplication2/LEDBlink.cpp:18
^done,bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x000080a6″,func=”MainLoop()”,file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”,line=”18″,times=”0″,original-location=”C:/usr/local/GNUBasedApplication2/GNUBasedApplication2/LEDBlink.cpp:18″}
info symbol 0x80a6
&”info symbol 0x80a6n”
_Z8MainLoopv + 22 in section .text
OK
info line *0x80a6
&”info line *0x80a6n”
Line 18 of “LEDBlink.cpp” starts at address 0x80a6and ends at 0x80b0 .
OK
-file-list-exec-source-files
^done,files=[{file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”},{file=”c:\sysgcc\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/cc430f5137.h”,fullname=”c:\sysgcc\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/cc430f5137.h”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”}]
-exec-run
&”warning: No program loaded.n”May 27, 2013 at 17:14 #2443ketParticipantHi,
bss is a section of uninitialized global variables. Hence try making a uninitialized global variable for example as follows:
int unused;
int main()
{
volatile int test = unused;
}Let us know if this does not work for you and we will look into updating the toolchain.
May 27, 2013 at 17:21 #2444dadiParticipantHello,
If you have intended I have to change the default generated main:int main()
{
MainLoop();
}just with yours, without changing any other part (that compiles well):
int unused;
int main()
{
volatile int test = unused;
}I’ve done it, but it produces the same ko.
Just for do a question? But the sample program, as explained on the tutorial, shouldn’t it work without modifications?
May 27, 2013 at 18:00 #2445dadiParticipantHere’s the log output of the modified main:
VisualGDB is licensed to MYNAMESURNAME
C:SysGCCmsp430binmsp430-gdb.exe –interpreter mi “C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf”
-list-features
=thread-group-added,id=”i1″
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-pc-mingw32 –target=msp430”.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>…
Reading symbols from C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf…
done.
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”]
-gdb-set stop-on-solib-events 1
OK
-gdb-set new-console on
A syntax error in expression, near `new-console on’.
-data-list-register-names
^done,register-names=[“r0″,”r1″,”r2″,”r3″,”r4″,”r5″,”r6″,”r7″,”r8″,”r9″,”r10″,”r11″,”r12″,”r13″,”r14″,”r15”]
-gdb-set disassembly-flavor intel
-gdb-set print demangle off
No symbol “disassembly” in current context.
OK
-gdb-version
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-pc-mingw32 –target=msp430”.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
OK
-break-insert -f main
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x00008044″,func=”main()”,file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”,line=”29″,times=”0″,original-location=”main”}
target sim
&”target simn”
Connected to the simulator.
OK
load
&”loadn”
OK
-data-evaluate-expression “sizeof(void *)”
^done,value=”2″
-data-evaluate-expression “sizeof(int)”
^done,value=”2″
-data-evaluate-expression “sizeof(short)”
^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)”
No symbol “wchar_t” in current context.
-data-evaluate-expression “sizeof(float)”
^done,value=”4″
-data-evaluate-expression “sizeof(double)”
^done,value=”4″
-data-evaluate-expression “sizeof(long double)”
^done,value=”8″
info target
&”info targetn”
Symbols from “C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf”.
simulator:
Attached to sim running program C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf
# instructions executed 0
# cycles 0
# Interrupts 0
While running this, GDB does not access memory from…
Local exec file:
`C:usrlocalGNUBasedApplication2GNUBasedApplication2/DebugGNUBasedApplication2.elf’, file type elf32-msp430.
Entry point: 0x8000
0x00008000 – 0x0000805c is .text
0x00001c00 – 0x00001c02 is .bss
0x00001c02 – 0x00001c04 is .noinit
0x0000ff80 – 0x00010000 is .vectors
OK
-break-insert -f C:/usr/local/GNUBasedApplication2/GNUBasedApplication2/LEDBlink.cpp:29
^done,bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x00008044″,func=”main()”,file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”,line=”29″,times=”0″,original-location=”C:/usr/local/GNUBasedApplication2/GNUBasedApplication2/LEDBlink.cpp:29″}
info symbol 0x8044
&”info symbol 0x8044n”
main + 6 in section .text
OK
info line *0x8044
&”info line *0x8044n”
Line 29 of “LEDBlink.cpp” starts at address 0x8044and ends at 0x804e .
OK
-file-list-exec-source-files
^done,files=[{file=”LEDBlink.cpp”,fullname=”C:\usr\local\GNUBasedApplication2\GNUBasedApplication2/LEDBlink.cpp”},{file=”c:\sysgcc\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/cc430f5137.h”,fullname=”c:\sysgcc\msp430\bin\../lib/gcc/msp430/4.6.3/../../../../msp430/include/cc430f5137.h”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”},{file=”../../gcc-4.6.3/gcc/config/msp430/crt0.S”}]
-exec-runMay 27, 2013 at 18:21 #2446ketParticipantHi,
Apart from the breakpoint not being hit, the log is completely normal, bss is now present. Try using mspdebug simulator instead of the GDB simulator as it sometimes has issues.
You do not need to replace the entire main loop of your program, just add this variable and the variable usage.
Our example should work as is but the toolchain can have bugs. Are you using our MSP430 toolchain installed from the wizard or some other toolchain version?May 28, 2013 at 08:28 #2447dadiParticipantHello and thank you for reply.
I’ve changed the simulator to the mspdebug as you’ve said and now it seems to work fine and without changing nothing to the original demo program. The same happens also by using my program that starts debugging by setting a breakpoint in the main (letting them go then it stops working for missing signals, but I think that’s right, or not?). Fine so, now I can simulate a software but I want tu use the real MCU.
With the OLIMEX it isn’t not working jet (could I have some port problems or other I have to set and they are not reported on your tutorials?) and how do I download the sw directly on the TI without using debugging?
Thank’s a lot.May 28, 2013 at 21:35 #2448ketParticipantHi,
VisualGDB is essentially using GDB, so look up the instructions on how to use GDB with OLIMEX. We have tested using OLIMEX before with VisualGDB, so it should be possible.
May 30, 2013 at 17:47 #2449dadiParticipantHello,
I’ve look for your guides and in internet but I haven’t found anything that I haven’t done yet or I could try.
By using directly the OLIMEX MSP Programmer with the OLIMEX-MSP430-TINY-V2_USB programmer I can read and write the MCU. When trying to use your licensed VidualGDB the msp430-gdmproxy command window into the MSVS2010 prompts me:Cannot initalize MSP430.DLL on port USB:
Could not find MSP-FET430UIF on specified COM portRun msp430-gdbproxy –help for usage instructions.
I’ve runned the command from the shell but I can’t find how to set it up.
Some other further hints?
Thank you
DavideMay 31, 2013 at 01:44 #2450ketParticipantThe Olimex programmer could come with a special version of MSP430.dll.
Try copying the MSP430.dll from Olimex into our MSP430 toolchain directory (usually at C:SysGCCmsp430bin).June 3, 2013 at 08:35 #2451dadiParticipantHello,
I have changed the dll as described but the error remains the same and there is no communication between your VisualGDB and the OLIMEX programmer.
Somthing other to try?
DavideJune 3, 2013 at 09:19 #2452dadiParticipantHello,
I have done what suggested and changed the library exactly in the directory you said. Unfortunately it is still not working or better: your VisualGDB is still not communicating with/over the OLIMEX.
I’ve tryied also to call from the shell directly the “msp430-gdbproxy.exe” (that seems to be called from your VisualGDB) and with the changed MSP430.dll the message becomes: “SiUSBXp.dll is missing”. When copied it from the OLIMEX directory to the bin directory this message disappears but the same message as before comes again:
“Cannot initalize MSP430.DLL on port USB: Could not find MSP-FAT430UIF on specified COM port”.
I’ve tryied to turn back to the old/original MSP430.dll and runned the shell command again and the output was the same without before the SiUSBXp.dll error.
What now?
Thanks.
DavideJune 3, 2013 at 12:51 #2453dadiParticipantHello again,
I have done also this test: I have enabled also the “make BIN file” VisualGDB option and tryied to load/download it directly from the OLIMEX program (it loads only BIN, TXT-TexasIntrumentsFormat and HEX-IntelFormat) and it says:
“End address in file is 0x7FFF which is less than end address in programm memory 0xFFFF.”
Maybe there is something wrong in the way I’m doing that.
Byye
DavideJune 3, 2013 at 15:41 #2454supportKeymasterHi,
This still looks like an incompatibility between your programmer and the msp430.dll. It is a known issue for Olimex devices (e.g. see https://forum.sparkfun.com/viewtopic.php?t=13349).
Please try copying ALL dlls from the Olimex directory (also hil.dll) into the msp430 bin directory. If this does not help, please also contact Olimex support asking whether your programmer supports debugging at all and whether it needs a firmware update. Please also inquire whether they provide a GDB server.The download errors can be caused by various factors (e.g. what is the size of the BIN file?) but should not be related to the “Device not found” bug as device detection happens before downloading the firmware.
June 3, 2013 at 18:09 #2455dadiParticipantHello bazis and thanks for your reply.
I will read the forum as soon as possible and I will do the copy as you request. Then I will inform you of the results.
What concerns the last question I’ll respond now:
Right for your conclusion: trying only to download the .bin file no “device” problems happens. That’s in fact a bit more strange and so I think that’s the problem is not or not only on the OLIMEX programmer. It seems to work fine alone: i can read/write/erase/etc program and data areas and start or stop the MCU. Why it should then have incompatibility issues just and only when i try to download directly the program compiled&maked with your VisualGDB? The error reported says in fact:
“End address in file is 0x7FFF which is less than end address in programm memory 0xFFFF.”
The file, that’s your Sample-Blink-Test_programm is 32KB big (32.768bytes).The OLIMEX i’ve bought is also full JTAG compatible and it is working with many debugger. Anyway I will ask them some questions, but befor, I would understand better what happens using your licensed tool for MSP430! With their own sw, at the moment at least and on my PC and with the same hw/sw configuration, all is or seems to working well. Whereas, is your envoirment that for any reason, is not working well or is not well tuned/setupped. It was working well also with the TI CSS v4 (but it is not installed on this Notebook).
-
AuthorPosts
- You must be logged in to reply to this topic.