Part Number: MSP430FR5994
Hi Team,
Is there any thread security issue when using Hardware Multiplier with RTOS?
Thanks & Regards,
Yale Li
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP430FR5994
Hi Team,
Is there any thread security issue when using Hardware Multiplier with RTOS?
Thanks & Regards,
Yale Li
Hi Yale,
Can you help me understand what "thread security" means in your question? MSPM0 has a couple features that may be related:
Hope that help. I'm interested to hear more about your question.
Regards,
Evan
Hi Evan,
Thanks for your reply.
This customer is using RTOS, so the thread mentioned above refer to the thread module like task, software interrupt and hardware interrupt etc. I'm not familiar with RTOS. It seems related to some stability issue of OS software.
And the customer is using FR5994, not M0.
Thanks & Regards,
Yale Li
And the customer is using FR5994, not M0.
Ok, thanks for pointing that out. I missed that.
I'm not sure what the customer is wanting to know. Can you ask about what security/threat-model the customer is trying to protect?
Regards,
Evan
An RTOS typically will not save the multiplier state which means that if multiple tasks use the multiplier, they must protect those operations by preventing a task switch. The usual thing to do is to disable interrupts during the operation. That can be tricky since sometimes the compiler will use it without an explicit multiply operator being visible.
I looked up the description for the -mhwmult option for GCC and found:
"The hardware multiply routines disable interrupts whilst running
and restore the previous interrupt state when they finish. This
makes them safe to use inside interrupt handlers as well as in
normal code."
So GCC generated code should be OK. Other compilers may vary.
If you access the multiplier directly, say to run an extended multiply accumulate operation, you are responsible for protecting it.
**Attention** This is a public forum