Hi, I am writing something to record error message into flash. I will send simple error message to a task which will send message to flash through spi. Other engineers should be able to use my function to commit error message to record. But I got a problem with the interface. If it is commit from swis, it should not wait, but copy msg into my buff, and just return, so it won't block the flash task. If it is commit from other tasks, I allow them to use big message so just pass pointer of msg to me and block until it is done. If it is commit from idle, then it should not block at all (I heard that pend or sleep in idle will crash the program). So when my interface func is called, is there anyway I can tell this is called form swi, task or idle? I ask other engineers to give a parameter whether it is from swi, task or idle and got challenged by other engineers saying they don't know who will call their functions either. Any help?