Missing function definitions in IDF (and information in datasheet) ?

Kevin Brant
Posts: 2
Joined: Sun Nov 03, 2019 9:48 pm

Missing function definitions in IDF (and information in datasheet) ?

Postby Kevin Brant » Sun Nov 03, 2019 11:13 pm

I wanted to look into what was going on "under the hood" of the esp32 IDF. I was browsing through the technical reference manual for the ESP32, and noticed that for the most part this datasheet follows a fairly standard microcontroller datasheet pattern of in depth peripheral description followed by register descriptions inside one chapter named after a peripheral. I was however confused when I was unable to find a chapter for either the Bluetooth controller and WiFi controller. In fact, the words hardly appear at all in the technical reference manual.

Looking further through the document, in chapter 1.3.5 the document says "the ESP32 has 41 peripherals" and lists 41 addresses corresponding to each of the peripherals, none of which appear to be a Bluetooth or WiFi controller. However earlier in the document in chapter 1.3.2.6, it says "13 peripherals are equipped with DMA", listing the 13 peripherals. 11 of these peripherals (UART0, UART1, UART2, SPI1, SPI2, SPI3, I2S0, I2S1, SDIO Slave, SDMMC, EMAC) appear under this exact name in the previous list of 41 peripherals. However two the these "peripherals equipped with DMA" do not (BT, WIFI). So somehow, one section seems to claim there is a WiFi peripheral, while another seems to claim there is not. Screenshots of these two sections are shown below:
1572818868043.png
1572818868043.png (179.74 KiB) Viewed 801 times
1572818934408.png
1572818934408.png (181.45 KiB) Viewed 801 times
Above: Section 1.3.5 table listing peripherals and memory addresses.


1572819113567.png
1572819113567.png (67.79 KiB) Viewed 801 times
Above: Section 1.3.2.6 listing modules equipped with DMA.

(I couldn't help but notice, there was a lot of "reserved memory" spaces in the peripheral memory listings. Perhaps one of these reserved memory locations contain the Bluetooth and WiFi peripheral(s)?)

Frustrated by this, I decided to pull down the IDF repository as described in the getting started guide (https://docs.espressif.com/projects/esp ... et-esp-idf), and look at the library source code. I thought this would surely include exact memory addresses accessed while configuring the WiFi or Bluetooth peripherals. However, I again ran into issues where some pieces of the code seem to be missing. For example, I can find the declaration of esp_wifi_start in components/esp_wifi/include/esp_wifi.h, however the definition seems to be missing from the library repository. I searched through the installed files in the .espressif folder after running install.sh as mentioned in the getting started guide, but nothing seemed to be found there either. I know some of the submodules connected to this repo include binary files and there are some binary files elsewhere as well. Perhaps these binary files contain the missing functions pre-compiled or something? I decided I'm not familiar enough with C to be able to figure out this out on my own.

So my first questions are
1. Where can I find the definition of this missing function, esp_wifi_start? Is it's source code available?
2. esp_wifi_start is just a specific example of some function I can't seem to find in this library. I would like to be able to look at all the source code: is there some other part that is not publically available that I still won't be able to find anywhere?
3. Why does the technical reference appear to be missing some peripherals? Are they somewhere else that I forgot to look?

ESP_Alvin
Posts: 126
Joined: Thu May 17, 2018 2:26 am

Re: Missing function definitions in IDF (and information in datasheet) ?

Postby ESP_Alvin » Mon Nov 04, 2019 2:45 am

Hi Kevin Brant,

Thanks for the details, we will look into. Thanks.

Alvin
Best Regards

WiFive
Posts: 2948
Joined: Tue Dec 01, 2015 7:35 am

Re: Missing function definitions in IDF (and information in datasheet) ?

Postby WiFive » Mon Nov 04, 2019 3:07 am

WiFi and BT are closed source and are distributed as precompiled libraries. They are also not publicly documented.
https://github.com/espressif/esp32-wifi-lib
https://github.com/espressif/esp32-bt-lib

liuzhifu
Posts: 39
Joined: Tue Dec 13, 2016 2:18 am

Re: Missing function definitions in IDF (and information in datasheet) ?

Postby liuzhifu » Tue Nov 05, 2019 5:39 am

Hello, for WiFi part, see:

1. API-guides: https://docs.espressif.com/projects/esp ... /wifi.html
2. API: https://docs.espressif.com/projects/esp ... html#wi-fi

we document the public APIs which is important to IDF users.

Kevin Brant
Posts: 2
Joined: Sun Nov 03, 2019 9:48 pm

Re: Missing function definitions in IDF (and information in datasheet) ?

Postby Kevin Brant » Thu Nov 07, 2019 1:14 am

WiFive wrote:
Mon Nov 04, 2019 3:07 am
WiFi and BT are closed source and are distributed as precompiled libraries. They are also not publicly documented.
https://github.com/espressif/esp32-wifi-lib
https://github.com/espressif/esp32-bt-lib
Ah I see. This is what I was thinking but wasn't sure given that I couldn't find it specified anywhere.
A follow up question I guess would be what's the reason for this? I can't think of any good reasons.

ESP_Angus
Posts: 2153
Joined: Sun May 08, 2016 4:11 am

Re: Missing function definitions in IDF (and information in datasheet) ?

Postby ESP_Angus » Thu Nov 07, 2019 3:36 am

Kevin Brant wrote:
Thu Nov 07, 2019 1:14 am
Ah I see. This is what I was thinking but wasn't sure given that I couldn't find it specified anywhere.
A follow up question I guess would be what's the reason for this? I can't think of any good reasons.
Some background information can be found in this GitHub issue:
https://github.com/espressif/esp32-wifi-lib/issues/2

(The GitHub users igrr & Spritetm are both Espressif employees.)

Who is online

Users browsing this forum: Bing [Bot] and 38 guests