I got bit confusion about the new raspberry pi HAT. Lets say we have a configured HAT with a right EEPROM, when the pi starts how it talks to the HAT ? What tool does it use (is it SMbus ? )? and how it prepare the HAT to be usable ?

1 Answer 1


In a nutshell a HAT is a rectangular board (65x56mm) that has four mounting holes in the (nicely rounded) corners that align with the mounting holes on the B+, has a 40W GPIO header and supports the special autoconfiguration system that allows automatic GPIO setup and driver setup. The automatic configuration is achieved using 2 dedicated pins (ID_SD and ID_SC) on the 40W B+ GPIO header that are reserved for an I2C EEPROM. The EEPROM holds the board manufacturer information, GPIO setup and a thing called a ‘device tree‘ fragment – basically a description of the attached hardware that allows Linux to automatically load the required drivers

My bold.

See https://www.raspberrypi.org/blog/introducing-raspberry-pi-hats/

So the HAT is queried via I2C on GPIO 0/1 (pins 27/28 on the expansion header) and has the needed device tree information to set up the GPIO. This is all handled by the kernel during boot.

  • Hmm, are these "hats" stackable or one at a time? Commented Jan 26, 2016 at 17:25
  • One at a time. I understand that stackable HATs added too many design problems. You may be able to stack identical HATs.
    – joan
    Commented Jan 26, 2016 at 17:27
  • One hat at a time. See raspberrypi.stackexchange.com/q/39153/19949
    – Ghanima
    Commented Jan 26, 2016 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.