HighExodus
Posts: 7
Joined: Tue Aug 13, 2019 9:26 pm

Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Tue Aug 13, 2019 9:51 pm

The Broadcom BCM2835 ARM Peripherals manual mentions the following under section 6.1 Register View when discussing the GPIO Event Detect Status Registers:
The interrupt controller can be programmed to interrupt the processor when any of the status bits are set. The GPIO peripheral has three dedicated interrupt lines. Each GPIO bank can generate an independent interrupt. The third line generates a single interrupt whenever any bit is set.
However, there is no mention of how this (programming the interrupt controller) can be accomplished.

Questions:
  1. Assuming the Raspberry Pi Zero W and the C Programming Language, how are the GPIO interrupts tied to the ARM Interrupt Controller?
  • Again, assuming the Raspberry Pi Zero W and the C Programming Language, how are the interrupt vectors for the GPIO interrupts setup?
Thanks,
HE

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Wed Aug 14, 2019 8:25 am

C is operating system agnostic. It knows nothing of handling interrupts. E.g. a C program running under Linux will need to ask Linux to be told about an interrupt. A C program running under another operating system will have to liaise with that operating system.

HighExodus
Posts: 7
Joined: Tue Aug 13, 2019 9:26 pm

Re: Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Wed Aug 14, 2019 4:32 pm

joan wrote:
Wed Aug 14, 2019 8:25 am
C is operating system agnostic. It knows nothing of handling interrupts. E.g. a C program running under Linux will need to ask Linux to be told about an interrupt. A C program running under another operating system will have to liaise with that operating system.
Joan, Thank you for your response. This (your response) is understood; however, the low level drivers are likely written in C and/or assembly. Also, I apologize if this was NOT clear, but the question was about how the BCM2835 GPIO Event Detection is tied into the ARM Interrupt Controller and how one can access/setup interrupt vectors to enable and handle interrupts to the ARM processor using C as opposed to python for example.

Thanks,
HE

User avatar
joan
Posts: 14079
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Wed Aug 14, 2019 4:40 pm

I can't answer that. I think you might be better off asking in the bare metal section. People there are more likely to understand the ins and outs of interrupts.

HighExodus
Posts: 7
Joined: Tue Aug 13, 2019 9:26 pm

Re: Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Wed Aug 14, 2019 4:44 pm

Thank you Joan. I will do so.

HighExodus
Posts: 7
Joined: Tue Aug 13, 2019 9:26 pm

Re: Use BCM2835 GPIO Event Detect to Interrupt Processor on Pi Zero

Thu Aug 15, 2019 12:55 pm

Per Joan's suggestion, I have reposted this question in the Hardware\Bare Metal forum here: https://www.raspberrypi.org/forums/view ... 2&t=248813 .

Cheers,
HE

Return to “C/C++”