Why not interrupt the task context

Here is the story.

This is a safety critical project and should run a time critical functional procedure at 20 kHz. Now the design is to put the functional procedure in the FIQ interrupt at 20KHz, while the security interrupt is also in the FIQ. These are only two FIQs in the system. (Of course, there are IRQ pairs in the MCU)

I know that it is not good to put a task context in an ISR interrupt, the correct way to do this is to set a mark and run in the OS task. But it seems that the current design does not harm anyone.

The procedure takes about 10us (main clock frequencies of 300 MHz), so basically it will not block IRQ / FIQ for an invalid time. This will even save time for an additional context comparison using the OS task to start the functional procedure. For me, at present, it seems that design contradicts every principle written on a textbook at the university, but cannot find a reason to say no to it.

How can I convince myself to transfer a functional procedure from ISR to OS? Should I?

+4
source share
3 answers

Remember your situation:

  • You encode critical security
  • software architecture is not specified, otherwise you will not ask this question.
  • , 2)
  • - " , , "
  • " "

, , / .

: ,

  • FIQ WCET
  • . ? / , CPU , , , .

, .

PS: ? ? ? ? SIL ASIL?

+3

ISR , ISR , , - .

, , ISR! .

0

20Khz = 50us between interrupts, with 10us processing time, this gives you about 20% of the processor time for this "task" only and 10us jitter in any other routine that runs on your CPU, it will also add 10us processing time for each 40us. that any other task will consume if it is good for your project, and you will keep the total processor processing time below 70% (which is the total maximum acceptable for critical systems), IMHO it should work without any problem.

0
source

Source: https://habr.com/ru/post/1689035/


All Articles