cancel
Showing results for 
Search instead for 
Did you mean: 

HAL driver for Hardware Semaphore (HSEM) correct? Can't take

luiscrsousa
Associate II

I'm trying to use HSEM for my first time with a H750 mcu and i'm unable to get/take a free semaphore.

I'm using the following HALL_HSEM_FastTake function. Line 210 operation always returns false and it makes sense returning false.
HSEM_CR_COREID_CURRENT is 0x300, HSEM_RLR_LOCK is 0x80000000 and RLR struct with all semaphores is always 0. The OR operation between the two macros is always different than 0...

Is this function implementation ok? Or I'm not understanding how HSEM should be used?

luiscrsousa_0-1715785194846.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
luiscrsousa
Associate II

Found the solution.
1-  I didn't understand the documentation properly. RLR struct is set when being read.
2- CubeMX don't display a setting to enable HSEM. So I had to do it myself with __HAL_RCC_HSEM_CLK_ENABLE();

View solution in original post

1 REPLY 1
luiscrsousa
Associate II

Found the solution.
1-  I didn't understand the documentation properly. RLR struct is set when being read.
2- CubeMX don't display a setting to enable HSEM. So I had to do it myself with __HAL_RCC_HSEM_CLK_ENABLE();