lpcxpresso debugger segmentation fault - HELP!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lpcxpresso debugger segmentation fault - HELP!

791 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Mon Feb 07 13:20:43 MST 2011
set remotetimeout 60000
set mem inaccessible-by-default off
info proc
Undefined info command: "proc".  Try "help info".
info program
Debugging a target over a serial line.
Program stopped at 0x2b7a.
Type "info stack" or "info registers" for more information.
mon ondisconnect cont
set arm force-mode thumb
Segmentation fault

This happens after building and sending the last sector to the lpc1754 target.
Any thoughts??
0 Kudos
27 Replies

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Wed Feb 09 09:49:02 MST 2011
Very true.  Thanks!
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 09:17:59 MST 2011
Glad to hear that you now have the debug tools working.

Regarding your link issue, I suggest that you create a new thread with a relevant subject - otherwise your question (and any responses) are going to be hidden from most users at the end of this very long thread!

Regards,
CodeRedSupport.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Wed Feb 09 09:05:35 MST 2011
A complete reinstall of 3.8.2 after rm'ing /usr/local/LPCXpresso has fixed the problem.  so far so good.  Except for one issue:

The Link Alias for the RamAHBCan is no longer defined???

Thanks very much for all of your help!
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 08:31:13 MST 2011
p.s. somebody has chmod 777 on all files in that directory. Do not do this, as the installer explicitly sets the correct permissions on the files, and if you change them, then things will start failing.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 08:26:57 MST 2011
As I suspected, the permissions on many of the files have been changed, and this is causing your problems. The dates of many of the files don't seem to match those on my system either.

Specifically, all of the crt_emu* files and dfu-util should have the "s" bit set (which allows them to run as the owner of the files - in this case root). This is set by the installer, and so the permissions have been changed after the install. If this is not set, you will get the problems you are experiencing.

The quickest way to resolve this is to uninstall LPCXpresso, and ensure the whole of the /usr/local/LPCXpresso directory is removed. Then download the latest (v3.8.2) and install it.

Once installed, you will see that crt_emu_* and dfu-util will have the "s" bit set in the directory listing - the permissions will be rwsr-sr-x.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Wed Feb 09 08:10:55 MST 2011
wdawson@wdawson-linux:/usr/local/LPCXpresso/bin$ ls -l
total 2792
-rwxrwxrwx 1 root root   9768 2010-06-28 11:14 checksum
-rwxrwxrwx 1 root root    664 2011-01-04 12:50 crt_directory2.xme
-rwxrwxrwx 1 root root   4308 2010-07-05 03:42 crt_directory.dtd
-rwxrwxrwx 1 root root    891 2010-12-01 11:46 crt_directory.xml
-rwxrwxrwx 1 root root   3189 2010-07-05 03:42 crt_directory.xslt
-rwxrwxrwx 1 root root 112756 2010-12-13 04:35 crt_emu_a7_nxp
-rwxrwxrwx 1 root root 112756 2010-12-13 04:35 crt_emu_a9_nxp
-rwxrwxrwx 1 root root 223764 2010-12-13 04:35 crt_emu_cm3_nxp
-rwxrwxrwx 1 root root 223764 2010-12-13 04:35 crt_emu_lpc11_13_nxp
-rwxrwxrwx 1 root root  14739 2010-07-05 03:42 crt_infolist.dtd
-rwxrwxrwx 1 root root   5440 2010-07-05 03:42 crt_infolist.xslt
-rwxrwxrwx 1 root root   6733 2010-07-05 03:42 crt_peripheral_defs.dtd
-rwxrwxrwx 1 root root   4319 2010-07-05 03:42 crt_peripheral_defs.xslt
-rwxrwxrwx 1 root root  22272 2010-05-29 06:36 dfu-util
drwxrwxrwx 2 root root   4096 2011-02-08 23:18 Flash
-rwxrwxrwx 1 root root 443240 2010-09-16 10:23 hoststring
-rwxrwxrwx 1 root root   5264 2009-07-07 03:06 LPC17xx_pkg.xml
-rwxrwxrwx 1 root root  30216 2010-07-02 08:35 LPCXpressoFS.enc
-rwxrwxrwx 1 root root  30216 2010-07-02 08:35 LPCXpressoHS.enc
-rwxrwxrwx 1 root root  30216 2010-07-02 08:35 LPCXpressoWIN.enc
-rwxrwxrwx 1 root root   1316 2011-01-04 12:51 NXP_dir_part_LPC11.xml
-rwxrwxrwx 1 root root    432 2011-01-04 12:51 NXP_dir_part_LPC13.xml
-rwxrwxrwx 1 root root   1476 2011-01-04 12:51 NXP_dir_part_LPC17.xml
-rwxrwxrwx 1 root root    270 2011-01-04 12:51 NXP_dir_part_LPC29.xml
-rwxrwxrwx 1 root root    486 2011-01-04 12:51 NXP_dir_part_LPC2x.xml
-rwxrwxrwx 1 root root    270 2011-01-04 12:51 NXP_dir_part_LPC31.xml
-rwxrwxrwx 1 root root    269 2011-01-04 12:51 NXP_dir_part_LPC32.xml
-rwxrwxrwx 1 root root    872 2011-01-04 12:51 NXPlist_LPC11.xme
-rwxrwxrwx 1 root root    216 2011-01-04 12:51 NXPlist_LPC13.xme
-rwxrwxrwx 1 root root    896 2011-01-04 12:51 NXPlist_LPC17.xme
-rwxrwxrwx 1 root root    496 2011-01-04 12:51 NXPlist_LPC29.xme
-rwxrwxrwx 1 root root   2320 2011-01-04 12:51 NXPlist_LPC2x.xme
-rwxrwxrwx 1 root root    592 2011-01-04 12:51 NXPlist_LPC31.xme
-rwxrwxrwx 1 root root    256 2011-01-04 12:51 NXPlist_LPC32.xme
-rwxrwxrwx 1 root root 205472 2011-01-04 12:51 nxp_lpc11_13_peripheral.xme
-rwxrwxrwx 1 root root  64912 2011-01-04 12:51 nxp_lpc11xx.xme
-rwxrwxrwx 1 root root  14976 2011-01-04 12:51 nxp_lpc13xx.xme
-rwxrwxrwx 1 root root 163912 2011-01-04 12:51 nxp_lpc17xx.xme
-rwxrwxrwx 1 root root  62784 2011-01-04 12:51 nxp_lpc29xx_peripheral.xme
-rwxrwxrwx 1 root root   2976 2011-01-04 12:51 nxp_lpc29xx.xme
-rwxrwxrwx 1 root root  15568 2011-01-04 12:51 nxp_lpc2xxx.xme
-rwxrwxrwx 1 root root   3480 2011-01-04 12:51 nxp_lpc31xx.xme
-rwxrwxrwx 1 root root   3128 2011-01-04 12:51 nxp_lpc32xx.xme
-rwxrwxrwx 1 root root  89672 2011-01-04 12:51 nxp_lpc3xxx_peripheral.xme
-rwxrwxrwx 1 root root 767192 2011-01-04 12:51 nxp_lpcxxxx_peripheral.xme
-rwxrwxrwx 1 root root   7687 2010-07-05 03:42 tohost.dtd

I'm sorry, what questions would you like answered?  I must have missed it (them)
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 07:15:05 MST 2011
Actually crt_emu_cm3_nxp has the "s" bit set by the installer, and so should already being run (effectively) as su already.

So have you changed the permission on the file? Please
ll /usr/local/LPCXpresso/bin
and post the results. If the tools have not got the correct settings, this would explain most of your issues.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 07:11:41 MST 2011
In that case, try
"sudo crt_emu_cm3_nxp -info-emu"

Please also answer the other questions I asked.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Wed Feb 09 06:56:32 MST 2011
wdawson@wdawson-linux:/usr/local/LPCXpresso/bin$ ./crt_emu_cm3_nxp -info-emu
Ni: LPCXpresso Debug Driver v2.0 (Dec 13 2010 09:27:36)
libusb couldn't open USB device /dev/bus/usb/001/020: Permission denied.
libusb requires write access to USB device nodes.
Segmentation fault
wdawson@wdawson-linux:/usr/local/LPCXpresso/bin$

Well...
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 06:48:56 MST 2011
Having booted LPC-Link manually (using dfu-util), can you run
- crt_emu_cm3_nxp -info-emu
and post the result

Also, (again having booted LPC-Link) what happens when you start a debug session from within LPCXpresso.

Also, can you summarise what you changed on you system when it stopped working.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Wed Feb 09 06:32:03 MST 2011
[B]Concerning the libusb issues.[/B]

---   log ---

wdawson@wdawson-linux:/usr/local/LPCXpresso/bin$ sudo ./dfu-util -d 0x471:0xDF55 -c 0 -t 2048 -R -D ./LPCXpressoWIN.enc
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Opening USB Device 0x0471:0xdf55...
Claiming USB DFU Runtime Interface...
Determining device status: state = dfuIDLE, status = 0
WARNING: Runtime device already in DFU state ?!?
Found Runtime: [0x0471:0xdf55] devnum=13, cfg=0, intf=0, alt=0, name="UNDEFINED"
Claiming USB DFU Interface...
Setting Alternate Setting ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0800
bytes_per_hash=604
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
can't detach: error sending control message: Broken pipe
Resetting USB to switch back to runtime mode
wdawson@wdawson-linux:/usr/local/LPCXpresso/bin$  crt_emu_cm3_nxp -wire=winusb -info-emu
Ni: LPCXpresso Debug Driver v2.0 (Dec 13 2010 09:27:36)
1 Emulators available:
0. LPCLINK_1_1LPC-Link Driver LINUX32 v1.1 (Code Red - LPCXpresso)

Which looks correct other than the fact that I had to replace the [B][SIZE=4]0D[/SIZE][/B] in the command you supplied me with a [B][SIZE=4]"-D"[/SIZE][/B] and I had to add a ./ to the dfu-util even though I was in the /correctDirectory. Path issue??


Concerning the lpcLink "Boot (dia)Log", its a dialog with:

Quote:
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTYOpening USB Device 0x0471:0xdf55...
Claiming USB DFU Runtime Interface...

and thats it
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Feb 09 00:33:21 MST 2011
When you get the Initializing LPC-Link failure, you get the option to show the log. Please post a copy of the log.
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Tue Feb 08 22:30:03 MST 2011
It just keeps getting worse... Installed ia32 - 32-bit compatibility for 64 bit ubuntu and now I get "Initializing LPC-Link" timeout.  However, if I  open a terminal, su and run:

dfu-util -d 0x471:0xdf55 -c 0 -t 2048 -R -D LPCXpressoWIN.enc

The device re-numerates as the 1fc9:0009 device.  What gives??  Everything was working flawlessly under Ubuntu 10,4 for 2 months!!! And then poof it all turns to shiz without changing any OS or tools or hardware!!!!!!

Sincerely,

Frustrated!!!
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 08 21:15:20 MST 2011
In the course of all this, do you (still) have a viable libusb.so installation? Disconnect, then reconnect the USB cable to power-cycle the device. When it powers up, it will enumerate as a DFU device. Navigate to your LPCXpresso installation bin directory (typically '/usr/local/LPCXpresso/bin'), and issue:

user@Ubuntu-laptop:/usr/local/LPCXpresso/bin$  sudo dfu-util -d 0x471:0xDF55 -c 0 -t 2048 -R 0D ./LPCXpressoWIN.enc
[FONT=Calibri][/FONT]
[I]dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free  Software and has ABSOLUTELY NO WARRANTY

Opening USB Device  0x0471:0xdf55...
Claiming USB DFU Runtime Interface...
Determining device  status: state = dfuIDLE, status = 0
WARNING: Runtime device already in DFU  state ?!?
Found Runtime: [0x0471:0xdf55] devnum=4, cfg=0, intf=0, alt=0,  name="UNDEFINED"
Claiming USB DFU Interface...
Setting Alternate Setting  ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE,  continuing
Transfer Size = 0x0800
bytes_per_hash=604
Starting download:  [##################################################] finished!
state(8) =  dfuMANIFEST-WAIT-RESET, status(0) = No error condition is  present
Done!
can't detach: error sending control message: Broken  pipe
Resetting USB to switch back to runtime  mode[/I]

Ignore the Broken pipe warning, this output is an example of a successful. download and boot of the software probe on the LPC-Link. If the probe is active, the debug utility should find it. Issue the following command-line:

user@Ubuntu-laptop:/usr/local/LPCXpresso/bin$  crt_emu_cm3_nxp -wire=winusb -info-emu
[I]Ni: LPCXpresso Debug Driver v2.0 (Jan  11 2011 16:09:27)
1 Emulators available:
0. LPCLINK_1_1    LPC-Link Driver  LINUX32 v1.1 (Code Red -  LPCXpresso)[/I]

This shows the LPC-Link in the device list. The software probe is active, and the LPCXpresso debug utilities can talk to it. It doesn't mean the probe can gain debug control over your processor, if there are other issues. The cause and effect of contributing issues is covered earlier in this thread.


Quote: wdawson61
Well... I installed latest ubuntu patches... 10.4 LTS Lucid Lynx and completely removed lpcexpresso... and reinstalled 3.8.2.129.

Drum roll....

Now I get a constant "No emulator or board available" dialog.  Shorting jp2.10 no longer makes any difference.  Just for fun, I reconnected the jumpers to the lpc134x on the LPClink.  I get the sam "No Emulator connected." dialog.

  Any pointers?

0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Tue Feb 08 19:36:37 MST 2011
Well... I installed latest ubuntu patches... 10.4 LTS Lucid Lynx and completely removed lpcexpresso... and reinstalled 3.8.2.129.

Drum roll....

Now I get a constant "No emulator or board available" dialog.  Shorting jp2.10 no longer makes any difference.  Just for fun, I reconnected the jumpers to the lpc134x on the LPClink.  I get the sam "No Emulator connected." dialog.

  Any pointers?
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 08 18:46:31 MST 2011
Install: LPCXpresso 3.8.2-129
OS: Ubuntu 10.04.1
Target: LPCXpresso1768 via LPC-Link

I performed a new install of LPCXpresso 3.8.2-129, and downloaded your .axf file multiple times without trouble.
I don't have your hardware, and there's no telling what's going on with your installation. I recommend you download the most recent LPCXpresso build, then uninstall/reinstall the product.

CodeRedSupport
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Tue Feb 08 14:36:10 MST 2011
I found an issue with the rest circuitry on my target hardware so I'm able to program flash reliably every time so I assume the clocking is correct on my hardware.

I am still, however, unable to ever run the debugger without a segmentation fault.  Is this a segmentation error in gdb itself?  I guess I'll try wiping out the lpcxpresso install and installing clean??
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wdawson61 on Tue Feb 08 12:55:08 MST 2011
I was afraid you'd say that; are there any pins on the lpc1754 that could cause funkiness such as I'm seeing if they were held static through a reset?  I've attached the page of my schematic with the LPC1754.

Thanks for the reference, but I know how to change the clock speed in my code, what I'm asking is, what EXACTLY is the format of the entry field in the lpcxpresso IDE under Run Config->Debug-xtal frequency and PLL value???
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 08 12:09:08 MST 2011
Thanks for sending the code through.

I've tried loading and running the code several times on a board here and no problems found. This would seem to indicate a hardware problem (though admittedly as I have a different board to you, there is a chance that you are doing something in the software that is upsetting things on your board).

One thing that you could try is to create a new workspace, load the standard  LPC17xx CMSIS project in from the examples directory, and then use the project wizard to create a new C project. Can you then successfully download this to your board and run it?

You also asked about  xtal frequency and PLL values earlier. Suggest you take a look at the following FAQ:

http://support.code-red-tech.com/CodeRedWiki/LPC1xxxChangeClock

Regards
CodeRedSupport
0 Kudos

612 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Feb 08 10:21:21 MST 2011

Quote:
Yes I can zip the .axf and .map files up but I should probably send them to you offline, via email or at least password protect the zip and send it to you.  Is that possible?
[EMAIL=wdawson61@_removeme_gmail.com][/EMAIL]


Please use the "Email the support team" link at http://www.code-red-tech.com/support.php to send them to us. Please ensure that you reference this forum thread, so that things get matched up correctly.

Regards,
CodeRedSupport
0 Kudos