I'm using an ARM Cortex-M4 MCU. If I have an interrupt handler for a GPIO at priority 2 and an SPI driver at priority 3 (i.e., lower priority than the GPIO's), and I call a (blocking) SPI read from within the GPIO's interrupt handler, will the SPI function work?
ARM Cortex-M4 Interrupt priorities
1.7k Views Asked by tosa At
1
There are 1 best solutions below
Related Questions in ARM
- Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?
- How can I use LD to place ARM reset vectors in a program segment
- Errors in makefile for qemu 0.14.1 in ubuntu 15.04 64 bit
- Text as parameter in inline assembly (ARM)?
- GSL: nm outputs "undefined Symbol (U)"
- How to address multiple definition compiler error
- Did anyone compiled GSL for androind?
- Linker Error on cross compiling Project in eclipse
- How to set privilaged mode in ARM Cortex-A8?
- Why is a write to a memory-mapped peripheral register not actioned (LPC43xx)?
- what's ARM TCM memory
- Traversing a string using arm assembly inside V8 source
- C Global declared in ISR
- Which is better? int8_t vs int32_t in 32 bits MCU
- Cannot find -lgtk-x11-2.0. Also, some modules are not found by cmake, though they are installed
Related Questions in INTERRUPT
- Arduino RPM Detection
- Interrupting long working thread
- How to set privilaged mode in ARM Cortex-A8?
- TechWell TW6869 driver does not generate interrupts on embedded device
- Using class member function pointers in C++ for Arduino
- What's the shortcut to interrupt the kernel in Canopy?
- How to interrupt a thread with infinite loop and sleep in Java
- Why page fault is considered as trap
- externally ending infinite loop java
- DB2 SQLSTATE = 57014 error
- Using Thread.currentThread().isInterrupted() with Thread.sleep()
- Canceling a long-running function using an ISR
- TelosB GPIO interrupts in Contiki
- Interrupts for Data Ready pin
- How exactly do I interrupt a thread?
Related Questions in CORTEX-M
- C Global declared in ISR
- kill function from ISR on cortex-m0
- STM32 I-CODE and D-CODE buses
- lpc17xx frequency detection of square wave using polling
- Cortex M0 hardfault; BLC Huffman
- FFT in ARM Cortex-M0 returns NaN or infinite
- How to write to SHPR2 correctly on cortex M0
- Flashing image to STM3220g-EVAL board using Trace 32
- Change Stack Location for Cortex M3 in Startup.s file
- How to change endianess settings in cortex m3?
- Creating a loop within an assembly macro - IAR ARM
- LDMIA instruction not working correctly on external SRAM in cortex M4
- Can I use the "Instruction" TCM in an Atmel SAM E70 processor for data?
- Using LZ4HC algorithm in an ARM Cortex-M3 processor
- Can I port a library compliled for Cortex M3 onto a cortex M4?
Related Questions in IRQ
- How to make a scanf() type function in a 32bit os in c?
- how single irq line is shared at physical hardware among multiple devices
- How IRQS get assigned
- IRQ 8 isn't working... HW or SW?
- What is a safe and easy way to exchange data from a threaded ISR? (Raspberry Pi)
- how to set state_use_accessors of Linux irq?
- request_threaded_irq with IRQF_ONESHOT from Raspberry PI GPIO PIN doesn't block new IRQ while in
- aarch64 execute IRQ from EL1 in EL3
- Initialize the AD controller in IRQ mode
- how does the linux shell in a multi-processor computer read the keyboard inputs?
- Compiling c program with disable_irq and enable_irq error can't find lib linux/irq.h
- Is it safe to call printk inside spin_lock_irqsave?
- Why does the Linux kernel not stop at the first handler for a shared IRQ that returns IRQ_HANDLED?
- Handling x86 IRQs from secondary PIC: EOI order important?
- Is it possible to achieve that the interruption from network adapter arose on different CPU-cores x86_64?
Related Questions in PRIORITY-INVERSION
- Is there a way to implement inheritance priority mutex in win32?
- After switching to Xcode 14 beta I got this error: QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT
- Does happen-before relationship impact priority inversion?
- About deadlock in Linux and Windows
- Can this lead to an issue similar to priority inversion
- Does SCHED_IDLE actually preclude execution on non-idle core?
- Releasing multiple locks without causing priority inversion
- POSIX mutex protocol - what exactly does this spec mean?
- Interruption of process in critical section
- Keil RTX priority inheritance with os_mut_wait and short timeout?
- FreeRTOS mutex priority inheritance problem if changing priority of task
- What is priority inversion?
- What is basic priority inheritance protocol and its working?
- How does priority ceiling protocol works
- ARM Cortex-M4 Interrupt priorities
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The answer to your question depends on how it is blocking to handle the transfer, as @Notlikethat said.
If your SPI driver is a polling driver, then it will most likely work. In this case, your GPIO interrupt would spin on flags within the SPI peripheral, waiting for each part of the transfer to complete.
If your SPI driver is interrupt driven, then it will not work. Since you are executing a priority 2 interrupt (GPIO), the priority 3 interrupt (SPI) will not execute until the GPIO interrupt finishes. Depending on how your SPI driver is written, this may entirely hang your system, or it may result in a timeout.
If your SPI driver is DMA driven, then the answer is not so clear and depends on how the driver works. It is possible in this case, that your transaction would complete, but if the function has blocked waiting for a DMA interrupt, it may never arrive depending on its priority.
In any of the above cases, it would generally be considered not a good idea to do something like that inside of an interrupt. If you have an RTOS, you could use a high priority task that is waiting on a semaphore to execute the SPI transaction, or if the OS supports it, used deferred interrupt processing. If you aren't running with an RTOS, I would consider if there is a way you can signal a lower priority interrupt (i.e use PendSV at the lowest priority) or monitor a flag from within the main process. Using a lower priority interrupt, you can still preempt the main process (if that's what is needed), but all your other interrupts can continue executing. If you can monitor a flag in your main process, then that would also allow your interrupts to continue, but if you are time constrained, this may not be as possible (again, depending on how your application is structured)