On Fri, May 11, 2012 at 6:48 PM, Andreas Fritiofson
<[email protected]> wrote:
> On Fri, May 11, 2012 at 12:30 PM, Xiaofan Chen <[email protected]> wrote:
>
>> It may have something to do with the C compiler. The other alternative
>> under Mac OS X (XCode) is using Clang. It still segfaults but go slightly
>> further, it segfaults after the first "reset init" command.
>>
>> mymacmini:lm3s1968 xiaofanc$ clang -v
>> Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
>> Target: x86_64-apple-darwin11.3.0
>> Thread model: posix
>>
>> mymacmini:build_mpsse_clang xiaofanc$ cat myconfig_git.sh
>> CC="clang" LDFLAGS="-L/usr/local/lib -lusb-1.0" ../configure
>> --enable-maintainer-mode --prefix=/Users/xiaofanc/bin --enable-jlink
>> --enable-ftdi --enable-ft2232_libftdi --enable-stlink --disable-werror
>
> You're building with --disable-werror. Is that because you get
> warnings that could hint that I'm doing something unsafe that could
> blow up under certain optimizations etc? Clang is usually good at
> finding those problems, at least compared to the old gcc you had as an
> alternative.

I used disable-werror because some codes will generate warnings
(maybe not your codes, but other codes). I will report later.

I tried Clang with or without "-g" and it still failed.

Then I tried Apple GCC 4.2, again it failed.

Then I tried GCC 4.6 from Homebrew-alternative, it seems to
work.

mymacmini:build_gcc46 xiaofanc$ cat myconfig_git.sh
CC="gcc-4.6" LDFLAGS="-L/usr/local/lib -lusb-1.0" ../configure
--enable-maintainer-mode --prefix=/Users/xiaofanc/bin --enable-jlink
--enable-ftdi --enable-ft2232_libftdi --enable-stlink --disable-werror

mymacmini:lm3s1968 xiaofanc$ ~/bin/bin/openocd -f ek-lm3s1968_mpsse.cfg
Open On-Chip Debugger 0.6.0-dev-snapshot (2012-05-11-18:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
500 kHz
none separate
Info : clock speed 500 kHz
Info : JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : lm3s1968.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection from 4444
500 kHz
cortex_m3 reset_config sysresetreq
Info : JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00001330 msp: 0x20000100
flash 'stellaris' found at 0x00000000
6000 kHz
flash 'stellaris' found at 0x00000000
dumped 262144 bytes in 2.246633s (113.948 KiB/s)
verified 262144 bytes in 2.304391s (111.092 KiB/s)
auto erase enabled
wrote 262144 bytes from file demo_gcc46.bin in 3.387182s (75.579 KiB/s)
verified 262144 bytes in 2.303376s (111.141 KiB/s)
500 kHz
cortex_m3 reset_config sysresetreq
Info : JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg:
0x23b, part: 0xba00, ver: 0x3)
Info : dropped 'telnet' connection

mymacmini:lm3s1968 xiaofanc$ telnet localhost 4444
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> init
> reset init
500 kHz
cortex_m3 reset_config sysresetreq
JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part:
0xba00, ver: 0x3)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00001330 msp: 0x20000100
> poll off
> flash probe 0
flash 'stellaris' found at 0x00000000
> adapter_khz 6000
6000 kHz
> flash probe 0
flash 'stellaris' found at 0x00000000
> dump_image demo_gcc46.bin 0x0 0x40000
dumped 262144 bytes in 2.246633s (113.948 KiB/s)
> verify_image demo_gcc46.bin 0x0
verified 262144 bytes in 2.304391s (111.092 KiB/s)
> flash write_image erase demo_gcc46.bin
auto erase enabled
wrote 262144 bytes from file demo_gcc46.bin in 3.387182s (75.579 KiB/s)
> verify_image demo_gcc46.bin 0x0
verified 262144 bytes in 2.303376s (111.141 KiB/s)
> reset run
500 kHz
cortex_m3 reset_config sysresetreq
JTAG tap: lm3s1968.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part:
0xba00, ver: 0x3)
> exit



-- 
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to