I am working with Xilinx boards, and I am using Xilinx spi,iic.. drivers in C to build user application. So basically it goes like this:
in my main program:
result = spi_transfer (arguments..); // here i call Xilinx function which is like black box, I don't know the hierarchy. this function can stuck inside and get to endless loop in some cases.
To cope with those anomalies (endledd loop), I added watchdog timer that set time before the function , and it gets to isr if the spi_transfer function don't execute after desired time.
Is there a way to kill spi_transfer function from inside of the ISR?
I read a little about it, and I understood that it is done easily with os like linux, freertos, but for now , my project is based on baremetal.
My question is - Is there a reasonable way to make what I've described?
Thanks for the support.
Depending on how your architecture handles interrupts, there may be some register hacking (like selecting the right stack) before executing the longjmp.
Also note this won't be a normal ISR exit either, so that might need some non-standard fixing up as well.
Can you link the documentation for the spi_transfer function itself so we can see if there are usage notes? And maybe show more-specific calling code/context.
Just ideas, not saying it will necessarily help. But it seems like we need to treat the actual problem, and not the symptoms.
So even their example code you linked has this issue for you?
I can't find any obvious "gotchas" to watch out for, sorry I'm not sure. Maybe someone else can help.