cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Specs for RPi Zero W Wifi hardware?

Sat Oct 06, 2018 6:25 pm

I'm making good progress with my Placid kernel (https://github.com/cmarrin/placid). Enough so, in fact that I want to get into some of the more advanced drivers. I spent quite some time with the ESP8266 and having a WiFi connection really simplifies a lot of things in working with the board. So I want to tackle that.

I read that the WiFi and Bluetooth features are connected via UART0. I also read that the chip used is the BCM43438. Looking at the data sheet, this chip has both SDIO and SPI interfaces. But there's no indication where the chip is actually hooked up in the RPi in this case. I saw these interesting lines in the Circle code:

CGPIOPin m_GPIO34_39[6]; // WiFi
CGPIOPin m_GPIO48_53[6]; // SD card

Since my SD card driver does indeed use those GPIO pins that's interesting. But does this imply that the SDIO interface is how to communicate with the chip? Or does it use SPI and UART0 can do SPI? I've found very little that is helpful in existing driver code that I've found on the web.

Does anyone have any more definitive information on how this chip works?

cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Re: Specs for RPi Zero W Wifi hardware?

Sat Oct 06, 2018 8:58 pm

A bit more information. I've discovered here:

http://www.raspberrypi.org/documentatio ... on/uart.md
https://www.raspberrypi.org/forums/view ... 44#p936754

That UART0 is used to talk to Bluetooth and SDIO (presumably on the pins I mentioned) talks to WiFi. Now I just need to hunt down the commands used to talk to WiFi through SDIO

LizardLad_1
Posts: 133
Joined: Sat Jan 13, 2018 12:29 am

Re: Specs for RPi Zero W Wifi hardware?

Sun Oct 07, 2018 1:16 am

Is this at all similar to the raspberry pi 3 wifi?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Specs for RPi Zero W Wifi hardware?

Sun Oct 07, 2018 7:39 am

LizardLad_1 wrote:
Sun Oct 07, 2018 1:16 am
Is this at all similar to the raspberry pi 3 wifi?t
The same, bit not the same as the 3b+
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Re: Specs for RPi Zero W Wifi hardware?

Sun Oct 07, 2018 8:03 pm

LizardLad_1 wrote:
Sun Oct 07, 2018 1:16 am
Is this at all similar to the raspberry pi 3 wifi?
From what I've read they are, for all intents and purposes the same. Apparently the Zero has an extra control line or something that allows it to transfer data somewhat faster, but I'm assuming that doesn't come into play much. I'm certainly not looking at performance. I'm just trying to get anything at all to work!

LizardLad_1
Posts: 133
Joined: Sat Jan 13, 2018 12:29 am

Re: Specs for RPi Zero W Wifi hardware?

Mon Oct 08, 2018 9:16 am

Here is the link to the linux driver on the chip: https://github.com/raspberrypi/linux/tr ... oadcom/b43
I know far too little about how wifi actually works to get it working I will have to do some more research before I can come back to this.

cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Re: Specs for RPi Zero W Wifi hardware?

Mon Oct 08, 2018 2:46 pm

LizardLad_1 wrote:
Mon Oct 08, 2018 9:16 am
Here is the link to the linux driver on the chip: https://github.com/raspberrypi/linux/tr ... oadcom/b43
I know far too little about how wifi actually works to get it working I will have to do some more research before I can come back to this.
Thanks. I saw that. Awfully complex. Looks like if you want to run this thing you have to download some firmware into the BCM43438 and then talk to it with a "DHD". I'm a big fan of Stargate and all, this seems like an insurmountable task for a bare metal project. Maybe that's why I haven't come across anyone else foolish enough to try it.

Now, I'm also a big fan of the ESP8266. I've gotten its Wifi working, with autoconfig and all, in a tiny amount of code. So maybe the marriage of a RPi Zero and an ESP8266 would get me where I want to be. $5.00 for a Pi Zero and $2.00 for an ESP12 is looking pretty good right now

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Specs for RPi Zero W Wifi hardware?

Mon Oct 08, 2018 3:07 pm

cmarrin wrote:
Mon Oct 08, 2018 2:46 pm
LizardLad_1 wrote:
Mon Oct 08, 2018 9:16 am
Here is the link to the linux driver on the chip: https://github.com/raspberrypi/linux/tr ... oadcom/b43
I know far too little about how wifi actually works to get it working I will have to do some more research before I can come back to this.
Thanks. I saw that. Awfully complex. Looks like if you want to run this thing you have to download some firmware into the BCM43438 and then talk to it with a "DHD". I'm a big fan of Stargate and all, this seems like an insurmountable task for a bare metal project. Maybe that's why I haven't come across anyone else foolish enough to try it.
Wifi is complex. Hence the driver is complex.

Yes, downloads firmware to the chip, then the driver talks to the firmware.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

LizardLad_1
Posts: 133
Joined: Sat Jan 13, 2018 12:29 am

Re: Specs for RPi Zero W Wifi hardware?

Mon Oct 08, 2018 8:44 pm

Why do you have to download firmware onto the chip in order to get it operational? Why can't registers be poked and prodded to interface with it? One last thing where is the firmware obtainable from?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Specs for RPi Zero W Wifi hardware?

Tue Oct 09, 2018 9:18 am

LizardLad_1 wrote:
Mon Oct 08, 2018 8:44 pm
Why do you have to download firmware onto the chip in order to get it operational? Why can't registers be poked and prodded to interface with it? One last thing where is the firmware obtainable from?
The firmware works like the firmware on the Pi SoC, it's a program that runs the wireless chip and provides services to the host. So it offloads a lot of work from the host CPU.

The firmware binary is on a Pi in

/lib/firmware/brcm/
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: Specs for RPi Zero W Wifi hardware?

Tue Oct 09, 2018 2:47 pm

No different than working with an ESP8266. It has firmware that was downloaded to make the interface to an mcu or other really easy, there are various solutions making different (incompatible) interfaces to the ESP8266. Or with an ESP8266 you can write the firmware yourself that is downloaded and run.

networking in particular even what we could consider "simple" phys often have an 8051 or a z80 or other as it is easier overall to do some percentage of the work in hardware and some percentage in a programmable state machine so you can add/tweak/improve without a full chip spin. or a balance of size and cost and yield, etc....working up the network stack it is desireable to have more software involved, if a flaw happens in a common wifi chip (look around, even folks like cisco simply buy canned solutions rather than try to roll their own) a "simple" software upgrade can have a chance at fixing it rather than a massive recall of products from many vendors.

Just like not using an operating system on the pi itself and instead enjoying bare metal programming, it is technically possible to program these lower level chips (think ESP8266), but good luck finding documentation for some of them. Just figuring out 8051 vs z80 vs other comes from examining the binary and sorta guessing on what instruction set it is...(sometimes they just tell you if you are working with them on a product).

you choose if it is quicker to get a few bucks of wifi or other network chip up, just use serial and maybe boost the clock rate to make it faster, or to take a deeper tangent into the on/board peripheral so that you can make the higher level job easier or more efficient. its all part of the fun. if its not fun then definitely just by/borrow something off the shelf...If I want to restore a car do I grow a rubber tree and dig a mine to get metal and rubber to make my own tires or just buy some? do I pound some sheet metal into a fender? depends on the level of fun I am after.

cmarrin
Posts: 23
Joined: Sat Sep 15, 2018 7:19 pm

Re: Specs for RPi Zero W Wifi hardware?

Mon Oct 22, 2018 10:55 pm

dwelch67 wrote:
Tue Oct 09, 2018 2:47 pm
No different than working with an ESP8266. It has firmware that was downloaded to make the interface to an mcu or other really easy, there are various solutions making different (incompatible) interfaces to the ESP8266. Or with an ESP8266 you can write the firmware yourself that is downloaded and run.

networking in particular even what we could consider "simple" phys often have an 8051 or a z80 or other as it is easier overall to do some percentage of the work in hardware and some percentage in a programmable state machine so you can add/tweak/improve without a full chip spin. or a balance of size and cost and yield, etc....working up the network stack it is desireable to have more software involved, if a flaw happens in a common wifi chip (look around, even folks like cisco simply buy canned solutions rather than try to roll their own) a "simple" software upgrade can have a chance at fixing it rather than a massive recall of products from many vendors.

Just like not using an operating system on the pi itself and instead enjoying bare metal programming, it is technically possible to program these lower level chips (think ESP8266), but good luck finding documentation for some of them. Just figuring out 8051 vs z80 vs other comes from examining the binary and sorta guessing on what instruction set it is...(sometimes they just tell you if you are working with them on a product).

you choose if it is quicker to get a few bucks of wifi or other network chip up, just use serial and maybe boost the clock rate to make it faster, or to take a deeper tangent into the on/board peripheral so that you can make the higher level job easier or more efficient. its all part of the fun. if its not fun then definitely just by/borrow something off the shelf...If I want to restore a car do I grow a rubber tree and dig a mine to get metal and rubber to make my own tires or just buy some? do I pound some sheet metal into a fender? depends on the level of fun I am after.
The big difference between the ESP8266 and the Zero W is that I know the ESP8266 and have it gotten it running already :-)

The interesting about the ESP vs the Zero W is that a Zero without Wifi costs $5 and an ESP costs $2 for a total of $7 vs. the Zero W at $10 (if you can find it at that price). Now the Zero W Wifi is much faster than the ESP, but the bring up with the ESP would be much quicker.

With that said, I'm going to look into uploading the firmware to the BCM43438 to see if I can talk to it. I'll let you know how it goes

Return to “Bare metal, Assembly language”