Page 1 of 1

Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Mon Nov 19, 2018 9:28 pm
by moahrs
Hi,

I am trying to use bluetooth and wifi, bare metal, i am making a SO. I found documentation about BCM43438, but when i turn on the Rpi Zero W, the bluetooth seens not powered ON, i cant found i bluetooth lists (like celphones or other.. )..

I see that use GPIO32/33 UART and i need to configure GPIO14/15 as INPUT..

And wifi, i havent tryed, because i read that use pins 34-39 another 22-27, SD1.

I see on BCM43438 the BT_REG_ON and WL_REG_ON pins, then, what pin BCM2835 is connnected this BCM43438 pins?

Here ( https://github.com/raspberrypi/firmware ... t-blob.dts ) I founded this:

Code: Select all

            pin@p41 { function = "output"; termination = "no_pulling"; }; // WL_ON
            pin@p45 { function = "output"; termination = "no_pulling"; }; // BT_ON
Anyone can help me plz...

ty a lot
And sry my english.
Moacir Jr.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Tue Nov 20, 2018 1:38 am
by moahrs
Realy, its more easy we use third party, like bluetooth module and wifi module...

I cant understand, i cant have manual, like pic (microchip) or arduino, not for easy to use, but manual's, lot of manual's... schematics, register and all we can get...

I imagine, that raspberry foundation only disponibilize manuals to linux foundation... linux use all peripherals... and we is most dificult to use...

i searched in all foruns, googles and many others, but the information is to poor....

i actual, i am downloaded linux from github, linux-rpi-4.14.y, and trying to understand how to use bluetooth and wifi...

but, any help, i ty a lot.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Tue Nov 20, 2018 7:42 am
by ghans
Broadcom sold its Bluetooth division to Cypress ...

http://www.cypress.com/file/298076/download

ghans

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Tue Nov 20, 2018 9:26 am
by moahrs
Very thanks ghans,

But this manual, i just have. But they do not explain how start, what registers, configuration, por example, how to change name and etc...

But vry tu for response....



Moacir Jr.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Tue Nov 20, 2018 1:55 pm
by moahrs
In this link: https://community.cypress.com/thread/34882, I Founded this: https://gist.github.com/apullin/72887a4 ... 488cdc781e

like this (is in python):

Code: Select all

    cmd = [0x01, 0x014, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
    
    if onoff:
        cmd[4] = 0
    else:
        cmd[4] = 1
    
    cmd[5] = frequency-2400
    cmd[6] = 0
    cmd[7] = 0
    if onoff:
        cmd[8] = 8
    else:
        cmd[8] = 0
        
    cmd[9] = ctypes.c_uint8( power ).value
    
    ser.write(cmd)
    res = ser.read(7)
    print(res)

But i think its not about bcm43438 or any compatible... i need this... commands... and i cant found...

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 2:13 am
by moahrs
Well, i am making progress... after many googles, i discovered 2 commands:

Reset {0x01 0x03 0x0c 0x00}

Set Frequency {x01, 0x14, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

And after execute (send to BCM43438 trougth UART, all return OK... but i am not founded how i start bluetooth, acitve him, set name device and etc etc etc...

I just need a command manual to use BCM43438...


All help will be welcome.
ty a lot

Moacir Jr.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 11:00 am
by moahrs
I thanks everyone who read this post, and who replied, but i give up to use bluetooth and wifi from the board pi zero w... its impossible, about poor documentation, much confuse, poor samples, poor everything.

A board like this have many many possiblities, and not only run linux.. With Bare metal, its possible do many things.

What the scare of the raspberry org, about release documentation? I will not speaking about schematic, but how use the many parts.

BCM2835 documentation is poor, fail, confuse.. I learn much more in foruns and site, than reading this pdf.

USB, thanks for LDB, works fine, and i understand how works USB, from his github. UART, GPIO's and many others, i leanerd from community.

Microchip for example. MCU from this enterprise are greate, and the documentation is complete, detailed. The examples, about everything, is enormous, samples, many samples. Arduino the same.

I will decide to use third party modules for wifi, cable ethernet and bluetooth. I will stop lose my time trying understand how works, activate, setting and etc about this BCM43438 or CYM43438. In the cypress site, the poor and confuse information is enormous.

I will use the raspberry pi zero w as simply zero, as he had not bluetooth and wifi (ridiculous, but is the reallity)...

sorry for this rush, but I lose many time, about more 2 weeks, searching and trying understand BCM43438, reading lots of linux code (confuse as well) and i am frustated... Not about community, because i learned so much, but about this company or organization. Have a greates board's, but show that only linux org have access to documentation, what is the scare ?



Ty all
Moacir Jr.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 1:34 pm
by fanoush
moahrs wrote:
Wed Nov 21, 2018 11:00 am
but show that only linux org have access to documentation, what is the scare ?
what do you mean by "linux org"? The kernel is officially maintained here https://github.com/raspberrypi/linux and you can browse source for drivers you are interested in. However both for bluetooth and wi-fi you need lot of generic code implementing full bluetooth or wi-fi stack. That is lot of work and quite hard to do in bare metal so even e.g. Ultibo or Risc OS don't have this working. With arduino etc it is easier because modules available have the full stack implemented inside it and offer just simple interface (e.g. AT commands). You don't have this with HW in Pi.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 1:59 pm
by moahrs
fanoush,

Ty for response, i needed this...
what do you mean by "linux org"? The kernel is officially maintained here https://github.com/raspberrypi/linux and you can browse source for drivers you are interested in. However both for bluetooth and wi-fi you need lot of generic code implementing full bluetooth or wi-fi stack.
Thanks for clarification, and i just searched in thsi githubs, but understand how works, is hard... the code have many calls for functions, and many code part's, i dont understand how works (have functions implementeds with parameters to be passed, but when call this, is withou parameter, and i cant found the same function overloaded without parameter, maybe some fuctionality that i just understand).
That is lot of work and quite hard to do in bare metal so even e.g. Ultibo or Risc OS don't have this working. With arduino etc it is easier because modules available have the full stack implemented inside it and offer just simple interface (e.g. AT commands). You don't have this with HW in Pi.
No, arduino was a example of documentation and samples, i know that have all implemented, but microchip, for sample, you know, nothing was implemented previous, all is a basic level implementation (like c18 compiler), and i demonstrate a documentation level (many and much easy to understand) e examples (have instalation of the examples)...

But what i need is, for example: BT reset, send {0x01, 0x03, 0x0C, 0x00) and receive {xx, xx, xx, xx, xx, xx}... turn on BT send {xx, xx, xx, xx, xx} and receive response {xx, xx, xx, xx}.. but in linux coded, i do not see this... i see for example, HCI_RESET = 0x03, but what is 0x01 ? What is 0x0C ? the 0x00 i thinks is final transmission on uart, i cant found where he send 0x01 (start transmission i think ?) , 0x03 (HCI_RESET), 0x0c (?), 0x00..

I hope made me understand, and please, sorry for my English, it's terrible.


Ty a lot
Moacir Jr.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 2:55 pm
by rst
moahrs wrote:
Wed Nov 21, 2018 1:59 pm
But what i need is, for example: BT reset, send {0x01, 0x03, 0x0C, 0x00) and receive {xx, xx, xx, xx, xx, xx}... turn on BT send {xx, xx, xx, xx, xx} and receive response {xx, xx, xx, xx}.. but in linux coded, i do not see this... i see for example, HCI_RESET = 0x03, but what is 0x01 ? What is 0x0C ? the 0x00 i thinks is final transmission on uart, i cant found where he send 0x01 (start transmission i think ?) , 0x03 (HCI_RESET), 0x0c (?), 0x00..
This is part of the Bluetooth Core specs. It's not the task of the chip or SBC vendor to document this.

Re: Enable Bluetooth/Wifi Rpi Zero W Bare Metal

Posted: Wed Nov 21, 2018 2:59 pm
by moahrs
hi rst,
moahrs wrote: ↑
Wed Nov 21, 2018 11:59 am
But what i need is, for example: BT reset, send {0x01, 0x03, 0x0C, 0x00) and receive {xx, xx, xx, xx, xx, xx}... turn on BT send {xx, xx, xx, xx, xx} and receive response {xx, xx, xx, xx}.. but in linux coded, i do not see this... i see for example, HCI_RESET = 0x03, but what is 0x01 ? What is 0x0C ? the 0x00 i thinks is final transmission on uart, i cant found where he send 0x01 (start transmission i think ?) , 0x03 (HCI_RESET), 0x0c (?), 0x00..
This is part of the Bluetooth Core specs. It's not the task of the chip or SBC vendor to document this.
New information.. and i was looking in wrong place... o thinking wrong... well... let me see again and search about BT core...



Ty a lot, rly
Moacir Jr.