Bus error on iPhone 3G

28 views
Skip to first unread message

anka

unread,
Aug 16, 2009, 4:43:31 AM8/16/09
to btstack-dev
For better traceability of my existing problem, I'll post the mail I
wrote to Matthias over here now:

---------------------------------------------------------
Hi Matthias,

First let me thank you for your quick help yesterday, I just have
overseen the Google Group for BTstack-dev.

What I have done now is:
- Got the source from svn
- I did "bootstrap", "configure --target=iphone" and "make"
- Signed and installed BTdeamon on my iPhone (3G with OS 3.0 and
JailBreak)

When I try to start BTdeamon within a terminal everything I get is
"Bus error".

Nothing at all?

Bluethooth is turned off at the Settings.app. I also tried to restart
the iPhone.
The last thing you could is to do a killall BTServer

Can you start BlueTool?

Do you have any suggestions why this error does occur or what exactly
it means?
If the stack cannot open the serial port to the bluetooth module it
crashes. I guess I should improve a bit on the error handling,
though. :)

Sehe gerade deine Mailadresse: meine Muttersprache ist uebrigens
Deutsch. :)
Kannst du in Zukunft auf der Google Group fragen, dann koennen andere
mitlesen.

Gruss
Matthias, Zuerich
---------------------------------------------------------


As you suggested I tried to start BlueTool and to open the device.
Here are the results:


root# ./BlueTool

Welcome to BlueTool... Rev 0.1

Cannot read termcap database;
using dumb terminal settings.

bluetool-> device -d /dev/cu.bluetooth
Opening /dev/cu.bluetooth @ 115200 baud.
ioctl(CTLIOCGINFO, /dev/cu.bluetooth) failed (error = No such file or
directory)
Unable to open device.
device returned 1
bluetooth power is now OFF


I don't know why this happens, the file "/dev/cu.bluetooth" is still
in place.

On the other way open the standard device does work:

bluetool-> device -D
Opening com.apple.uart.bluetooth @ 115200 baud.
bluetool-> power on
bluetooth power is now ON


But still the BTdaemon does not work:

root# ./BTdaemon
Bus error



Thanks for any help,
Andreas

Matthias Ringwald

unread,
Aug 16, 2009, 5:51:32 PM8/16/09
to btsta...@googlegroups.com
Hi Andreas

> But still the BTdaemon does not work:
>
> root# ./BTdaemon
> Bus error
>

Strange. I have the same configuration. Ok. Can you try the BTdaemon
at http://btstack.ringwald.ch/BTdaemon ? It is not modified, just to
make sure your compiler setup is not causing the trouble. Again, put
it on the phone and sign with ldid -S BTdaemon.

If this does not help, can you try to run it with the gdb on the
iPhone. I think I would need to compile it differently to get full
support, but I guess you should be able to get a stack trace if it
crashes. For this start it with "gdb ./BTdaemon", and after it loads
all libs just enter "run". After the bus error enter "bt" to get a
stack trace.

The crash is probably not related to Bluetooth at all, as the BTdaemon
only boots Blueooth after a client connects and requests it.

Cheers
Matthias


anka

unread,
Aug 22, 2009, 8:31:27 AM8/22/09
to btstack-dev
Hi Matthias,

its very strange. I tried your BTdaemon binary and everything works
fine on the iPhone but with my own compiled version I get the
following memory access violation shown in GDB:

(gdb) run
Starting program: /private/var/stash/bin/BTdaemon
Reading symbols for shared libraries .
+................................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000010
0x0000366c in hci_init ()
(gdb) bt
#0 0x0000366c in hci_init ()
#1 0x000033c0 in main ()
(gdb)


Cheers,
Andreas

Matthias Ringwald

unread,
Aug 22, 2009, 2:02:56 PM8/22/09
to btsta...@googlegroups.com
Hi

At least, you can start writing your own apps using L2CAP. :)

As I'm using the same code from SVN, and probably the same XCode, how
did you sign and install it?

If you specify --with-iphone-ip=... in configure, you can try the make
install-iphone target (not much but works for me). I've used the LDID
from the finkproject.org (I maintain the package).

Sent from my iPhone

anka

unread,
Aug 22, 2009, 5:41:09 PM8/22/09
to btstack-dev
Hi Matthias,

currently I am using a Intel iMac with Mac OS X 10.5.8. Also I am
using Xcode 3.1.3 and the iPhone SDK 3.0.

I also tried to install it several ways:
- compile and sign it locally
- compile & copy and then sign it remote on the iphone
- using command make install-iphone

At the moment I think it is clear that something is wrong with my
configuration but what excactly I have to find out :-).


Cheers,
Andreas

Matthias Ringwald

unread,
Aug 23, 2009, 3:16:35 AM8/23/09
to btsta...@googlegroups.com
Thats pretty much standard. :)

Make sure that you don't use an Svn revidion which didn't work. One
last idea: can you post the generated config.h? I guess, I should add
a bit more error handling...

Sent from my iPhone

anka

unread,
Aug 23, 2009, 4:29:14 AM8/23/09
to btstack-dev
Hi,

the config.h looks like that:

#define HAVE_TRANSPORT_H4
#define UART_DEVICE "/dev/tty.bluetooth"
#define UART_SPEED 115200
#define USE_BLUETOOL
#define USE_SPRINGBOARD


cheers,
Andreas

Matthias Ringwald

unread,
Aug 23, 2009, 5:28:31 AM8/23/09
to btsta...@googlegroups.com
Ok. That's what it should look like for the iPhone af the moment
(expect change for a while). Your bus error looks like an advanced
riddle. :)

But compiling and runnig the test.c works as I understand.

I'm working on integrating the BTdaemon with the launchd system. When
thus is working (quick guess 4 weeks as I'll be on vacation for some
time), it makes sense to provide a BTstack package via cydia.

Matthias


Sent from my iPhone
Reply all
Reply to author
Forward
0 new messages