# Pgm\_read\_dword()

**URL:** <https://community.particle.io/t/pgm-read-dword/66058>\
**Category:** Libraries\
**Created:** [December 27, 2023, 5:14pm UTC](https://community.particle.io/t/pgm-read-dword/66058 "2023-12-27T17:14:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [December 27, 2023, 5:14pm UTC](https://community.particle.io/t/pgm-read-dword/66058/1 "2023-12-27T17:14:15Z")

</div>

I am trying to build the TFT\_eSPI library on Device OS 5.6.0 on Photon2/P2. The latest challenge is the macro `pgm_read_dword` is being used, it is not defined in `spark_wiring_arduino.h` and cannot be replaced with `pgm_read_word`. Would an addition such as `pgm_read_dword (x) ((uint32_t)(*(x)))` work?

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [January 3, 2024, 12:32pm UTC](https://community.particle.io/t/pgm-read-dword/66058/3 "2024-01-03T12:32:43Z")

</div>

Yes, that should work. The Arduino dword is uint32\_t and all Particle devices (STM32, nRF52, and RTL872x) have a linear address space that does not need `pgm_read` to read flash memory.

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [January 3, 2024, 6:31pm UTC](https://community.particle.io/t/pgm-read-dword/66058/4 "2024-01-03T18:31:18Z")

</div>

Thanks - I ended up stripping all these macros out and using \* operator. I struggled to understand some of the nested versions - maybe they now don't work! TBC

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/3/2/3291e3c9351789fe8620ae5bcec8d3fec67ff221.png) [@system](https://community.particle.io/u/system)\
**Post date:** [February 3, 2024, 4:31am UTC](https://community.particle.io/t/pgm-read-dword/66058/5 "2024-02-03T04:31:50Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
