cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in H7 hrtim deadtime prescaler reference manual RM0433 and the HAL library code

AEfth
Associate II

I was getting strange results with the deadtime prescaler of the H7 hrtim and it appears that the H7 reference manual (RM0433 rev 7) is incorrect: The DTPRSC field of register HRTIM_DTxR, is supposed to get binary values from 011 to 111 (000 to 010 are reserved) which correspond to multiplication of the  tHRTIM by 1, 2, 4, 8, and 16. The provided formula is tDTG = 2^(DTPRSC - 3) * tHRTIM.

But, when I set the prescaler to the HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 define from HAL, it places a 0 in DTPRSC, while according to RM0433, it should have been 0b110 (= 6). Then when I used HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4, it wrote 1 in DTPRSC, and so on. There is not a XX_MUL16 defined.

The actual deadtime is scaling in the oposite direction! The delay with MUL8 is half of the delay with MUL4, which is half of that with MUL2, ....

Therefore the actual formula is tDTG = 2^(DTPRSC) * tHRTIM, so the -3 should not be in the exponent and the values of 0b000 to 0b010 are valid. (Probably the highest 3 values are the ones which should be reserved). Moreover, the names of the defines (the MUL4, MUL8, etc) in HAL are wrong.

Board: Nucleo H743ZI2, HAL version v1.10

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @AEfth​,

This issue is fixed in STM32CubeH7 V.1.11.0.

Thank you for your contribution in STCommunity.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
KDJEM.1
ST Employee

Hi @AEfth​ ,

From my side, I think that following lines should be removed from HAL library code:

HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8

HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4

HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2

Because the DTPRSC[2:0] values 000, 001, 010 are reserved.

Therefore, have you checked these code lines:

HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1

HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2

HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4

HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8

HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KDJEM.1
ST Employee

Hi @AEfth​ ,

I reported the issue.

Internal ticket number: 131444 (This is an internal tracking number and is not accessible or usable by customers).

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KDJEM.1
ST Employee

Hello @AEfth​,

This issue is fixed in STM32CubeH7 V.1.11.0.

Thank you for your contribution in STCommunity.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.