2

I am trying to access the HDMI hardware registers on a Phytec MIRA board using C. This is my first real step into embedded programming.

The memory address for the Design ID register, according to the i.MX 6 Reference Manual, is 0x120000 (See page 1568).

I wrote some code to try to access this register, and it just gives a segmentation fault when I try to dereference the pointer.

Can anyone tell me what I am doing wrong and point me in the right direction please?

Minimal reproducing code below:

#include <stdio.h>
#include <inttypes.h>

int main()
{
  uint8_t const volatile * const HDMI_DESIGN_ID = (uint8_t const volatile * const)(0x120000);
  printf("Design ID: %u\n", *HDMI_DESIGN_ID);
  return 0;
}
Tony Tannous
  • 13,160
  • 8
  • 44
  • 80
Phillip Hamnett
  • 261
  • 2
  • 14

0 Answers0