[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bluetooth-dev] Porting to ARM

I have dealt with this before, typically it involves byte packing.  Most
compilers do not like to use odd sized byte sizes for types.  This
results in them rounding off to the native "word" size, usually 2
bytes.  For most compilers there is some pragma or flag that will allow
you to force the use of BYTES and not the native words.  This may
require a bit of poking around in documentation to find.

Hope that helps,
Ken Steck

Gordon McNutt wrote:
> I've been trying to get the Bluetooth stack running on an ARM processor.
> I've discovered that unfortunately the Axis stack is using struct
> overlays onto byte arrays as a way to fill out the protocol headers. It
> turns out that this is not particularly portable across compilers. Using
> gcc 2.95.2 both natively on a NetWinder and as a cross-compiler I've
> discovered that protocol headers are getting munged up due to struct
> alignment problems. Particularly, the l2cap_tx_buf with it's 5-byte size
> is causing a problem when an ARM sends L2CAP packets.
> Questions:
> a) Has anybody faced and dealt with this issue and knows an easy way to
> fix it (i.e., compiler pragma or option)?
> b) If not, I'll probably have to deal with the problem by modifying (a
> lot of) the code. Has anybody started this effort yet, and are the Axis
> folks amenable to rolling this work into the standard stack?
> --Gordon