RM0453
On semaphore x free interrupt, try to lock semaphore x
•
If the semaphore lock is obtained:
Disable the semaphore x interrupt in HSEM_CnIER.
Clear pending semaphore x interrupt status in HSEM_CnICR.
•
If the semaphore x lock fails:
Clear pending semaphore x interrupt status in HSEM_CnICR.
Try again to lock the semaphore x:
–
–
Note:
An interrupt does not lock the semaphore. After an interrupt, either the AHB bus master or
the process must still perform the lock procedure to lock the semaphore.
It is possible to have multiple AHB bus masters informed by the semaphore free interrupts.
Each AHB bus master gets its interrupt, and the first one to react locks the semaphore.
8.3.8
AHB bus master ID verification
The HSEM allows only authorized AHB bus master IDs to lock and unlock semaphores.
•
The AHB bus master 2-step lock write access to the semaphore HSEM_Rx register is
checked against the valid bus master IDs.
–
•
The AHB bus master 1-step lock read access from the semaphore HSEM_RLRx
register is checked against the valid bus master IDs.
–
•
The semaphore unlock write access to the HSEM_CR register is checked against the
valid bus master IDs. Only the valid bus master IDs can write to the HSEM_CR register
and unlock any of the COREID semaphores.
–
Table 65
Note:
Accesses from unauthorized AHB bus master IDs to other registers are granted.
If the semaphore lock is obtained (semaphore has been freed between first try to
lock and semaphore Interrupt status clear), disable the semaphore interrupt in
HSEM_CnIER.
If the semaphore lock fails, wait for semaphore free interrupt.
Accesses from unauthorized AHB bus master IDs are discarded and do not lock
the semaphore.
An unauthorized AHB bus master ID read from HSEM_RLRx returns all 0.
Accesses from unauthorized AHB bus master IDs are discarded and do not clear
the COREID semaphores.
details the relation between bus master/processor and COREID.
Table 65. Authorized AHB bus master IDs
Bus master 0 (processor1)
COREID = 4
RM0453 Rev 1
Hardware semaphore (HSEM)
Bus master 1 (processor2)
COREID = 8
371/1461
378
Need help?
Do you have a question about the STM32WL5 Series and is the answer not in the manual?
Questions and answers