Skip to content

Commit

Permalink
Update _drafts/practical_zephyr_02_dt_basics.md
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Johnson <[email protected]>
  • Loading branch information
lmapii and ejohnso49 authored Jan 29, 2024
1 parent 3cade85 commit 8f59092
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _drafts/practical_zephyr_02_dt_basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ The build process creates three important output files: The `zephyr.dts` that ha

As promised, the original devicetree `dtc` compiler _is_ invoked during the build, and that's where it comes into play: The `zephyr.dts` devicetree source file is fed into `dtc`, but not to generate any binaries or source code: Instead, it is only used to generate warnings and errors; the output itself is discarded. This helps to reduce the complexity of the Python devicetree script `gen_defines.py` and ensures that the generated devicetree source file used in Zephyr is at least still compatible with the original specification.

The `devicetree_generated.h` header file replaces the devicetree blob `dtb`: It contains _macros_ for "all things devicetree" and is included by the drivers and our application and thereby strips all unnecessary or unused parts. **"Macrobatics"** is the term that Martì Bolivar used in his [talk about the Zephyr devicetree at the June 2022 developer summit](https://www.youtube.com/watch?v=w8GgP3h0M8M&list=PLzRQULb6-ipFDwFONbHu-Qb305hJR7ICe), and it fits. Even for our tiny application, the generated header is over 15000 lines of code! We'll see how these macros look like and how they are used with the Zephyr devicetree API in the next article. If you're curious, have a look at `zephyr/include/zephyr/devicetree.h` already. In fact, let's have a glimpse:
The `devicetree_generated.h` header file replaces the devicetree blob `dtb`. It contains _macros_ for "all things devicetree" and is included by the drivers and our application and thereby strips all unnecessary or unused parts. **"Macrobatics"** is the term that Martí Bolívar used in his [talk about the Zephyr devicetree at the June 2022 developer summit](https://www.youtube.com/watch?v=w8GgP3h0M8M&list=PLzRQULb6-ipFDwFONbHu-Qb305hJR7ICe), and it fits. Even for our tiny application, the generated header is over 15000 lines of code! We'll see how these macros look like and how they are used with the Zephyr devicetree API in the next article. If you're curious, have a look at `zephyr/include/zephyr/devicetree.h` already. In fact, let's have a glimpse:

`build/zephyr/include/generated/devicetree_generated.h`

Expand Down

0 comments on commit 8f59092

Please sign in to comment.