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

RE: [bluetooth-dev] memory usage


Se my comments bellow

Best Regards
Mats Fridén
AXIS Communications

> -----Original Message-----
> From: Oliver Kasten [mailto:kasten@xxxxxxx.ch]
> Sent: Monday, October 30, 2000 8:53 PM
> To: bluetooth-dev@xxxxxxx.com
> Cc: hmathys@xxxxxxx.ch; Jan Beutel
> Subject: [bluetooth-dev] memory usage
> hi,
>   we are planning to built a bluetooth-enabled embedded 
> device based on
> a microcontroller. on the software-side we are going to use a modified
> axis stack (layers hci, l2cap, and sdp, no rfcomm and no tcs). a major
> headache is the memory consumtion of the stack. we are aiming at less
> than 10K for heap memory and program stack.
>   particularly "static hci_controller hci_ctrl;" in hci.c:401 
> is a nasty
> monster. the structure holds more than 136,000 bytes in 8 buffers of
> type hci_in_buffer (hci.c:273) of 17000 bytes each.
> - what are the 8 buffers used for? how come its 8 buffers (one per hci
> connection handle plus one spare)?

During test we sometimes need to have one spare buffer to store data in when something's goes wrong.
> - what would be the impact of of drastically reducing the number of
> hci_in_buffers, the size of the buffer (to say less than 1K), or both?
> would that imply reducing maximum transfer units (MTUs) to 
> less than the
> default, e.g. 48bytes versus 672bytes for l2cap?
Ofcourse you can reduce the size of the buffers. I suggest that you try to reduce in the maximum MTU in your system.

> - is the hci flow control implemented in the stack (part h:1, 
> section 3
> "hci flow control", p 529)? would i have to?
Yes it is.

> - there is a chunk of 2K being dynamically allocated into 
> bt_buf.head in
> btmem_init() (btmem.c:100). can that be reduced?

We have never tried to reduce it so if you do it it is at your own risk ;-)

> - are there any large auto variables i have overlooked? does somebody
> have a rough idea how big the program stack gets. do you know how to
> find out?
> i'd be grateful for some comments and answers!
> cheers,
> olli*
> -- 
> Oliver Kasten                                phone: +41/ 1/ 63-2 06 63
> ETH-Zurich                                     fax: +41/ 1/ 63-2 16 59
> Haldeneggsteig 4, IFW D48.1                  email: kasten@xxxxxxx.ch
> CH-8092 Zuerich, Switzerland           http://www.inf.ethz.ch/~kasten/
> -
> To unsubscribe from this list: send the line "unsubscribe 
> bluetooth-dev" in
> the body of a message to majordomo@xxxxxxx.com
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com