Hmissa
Posts: 6
Joined: Tue Jul 07, 2015 9:27 am

UART interrupt

Sun Feb 12, 2017 8:26 pm

Hi all
How can I develop an uart interrupt Routin.

Best regards.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: UART interrupt

Mon Feb 13, 2017 12:02 am

Just a high -level view (You will find no details here)
This may sound weird but that is extremely difficult on the Pi.
The peripherals are primarily connected to the GPU. Passing an interrupt to the ARM is possible but
not trivial. Also due to re-design the interrupts on the ARM are different between Pi A,B,B+ and Pi2 and Pi3.
(Sending an interrupt to a single core is different then to send one to a multi core system)
First question to answer is for which Pi is this, then look up the specific documentation about how the
ARM cores are integrated in the Pi with the GPU, especially the interrupt section.
(Which is not the greatest document in the world, I know)
Also you must make sure the GPU does NOT get the interrupt
otherwise both will start servicing it. I have no idea how to do the latter.
All software, I know only about hardware.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: UART interrupt

Mon Feb 13, 2017 12:23 pm

I think you just "don't do" UART interrupts on Linux in 2017. You propably use something like epoll/poll
to wait on a file descriptor with "zero overhead".

http://stackoverflow.com/questions/7035 ... gh-cpu-use

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Return to “Advanced users”