Access to hardware registers

julienD
Posts: 32
Joined: Fri Sep 13, 2019 12:38 pm

Access to hardware registers

Postby julienD » Thu Jul 13, 2023 3:50 pm

Hello,

For my general information.
I'm using ESP for serveral years. I've always used the provided SDK.

Sometimes, I would like to know a bit more about what's under the hood. Unfortunately, I did not find
any information about bare metal registers as an example.
I did not found either the glue source code between the official esp-idf and the same hardware registers.

Can you confirm my feeling that espressif products are intended to be used only through esp-idf as a kind of black box
and that no low level hardware information is available?
If no, where can I find more information?

Thanks
Julien

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Access to hardware registers

Postby ESP_igrr » Thu Jul 13, 2023 8:59 pm

Hi Julien,

The hardware registers inside ESP32 series of chips are documented in a document called Technical Reference Manual. You can find it at espressif.com or alternatively via the link from the programming guide for each chip (example link is for the esp32).
julienD wrote: I did not found either the glue source code between the official esp-idf and the same hardware registers.
ESP-IDF APIs are using the same hardware registers underneath. Most of the peripheral drivers inside driver component eventually call HAL functions, then "LL" functions, which finally operate on hardware registers. The registers themselves are defined in xxx_reg.h and xxx_struct.h files inside the soc component.

So while this is a long-ish dependency chain, you can step through the code and see which registers each particular driver sets.
julienD wrote: Can you confirm my feeling that espressif products are intended to be used only through esp-idf as a kind of black box
and that no low level hardware information is available?
Yes and no... "No" in the sense that the hardware information is available, so if a driver from ESP-IDF doesn't meet your needs, you can write your own. (Except for the radio related peripherals: PHY, Wi-Fi and BT basebands and MACs. The details of these peripherals are considered to be Espressif's trade secret at the moment, so no public or NDA-able documentation of registers is available.) Also "no" in the sense that ESP-IDF is not the only SDK which Espressif supports. You can also program Espressif chips in C using NuttX and Zephyr RTOSes, as well as in Rust using both bare-metal and OS approaches. With the TRM and/or HAL/LL layers from IDF, plus a build system of your choice, you can also build a bare metal application from scratch, if you prefer.

"Yes" — in the sense that while all these options are available, our main goal is to help you bring a useful product to the market as fast as possible. Since many products based on ESP chips share some common features, we have built ESP-IDF with the aim of providing you with large amount of functionality you will most likely need in your product anyway. These higher-level APIs are provided so that you spend less time implementing or troubleshooting the low-level details, and more time working on the thing you actually need to build. It is also much easier for Espressif to support customers who use ESP-IDF (or another framework mentioned above: Zephyr, NuttX, Rust, etc) rather than implement everything from scratch. This is because these higher level drivers are meant to catch many of the usage issues and report them via error codes or log messages. Espressif is much less likely to be able to provide you with good technical support if you run into a complex issue while implementing a custom driver from scratch, unless of course your project has significant business value, in which case any kind of problem will be solved.

HTH!

julienD
Posts: 32
Joined: Fri Sep 13, 2019 12:38 pm

Re: Access to hardware registers

Postby julienD » Wed Jul 26, 2023 4:13 pm

Very usefull, thank you.
I was into radio peripherals. It answers my question.

Thanks
Julien

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 90 guests