|
116 | 116 | /* Health test control register information to use in CCM algorithm */
|
117 | 117 | #define RNG_HTCFG_1 0x17590ABCU /*!< Magic number */
|
118 | 118 | #define RNG_HTCFG 0x0000A2B3U /*!< Recommended value for NIST compliancy */
|
119 |
| -#define RNG_HTCFG_REVB 0x000CAA74U /*!< Recommended value for old MCU cut - deprecated */ |
120 | 119 | /**
|
121 | 120 | * @}
|
122 | 121 | */
|
@@ -211,18 +210,10 @@ HAL_StatusTypeDef HAL_RNG_Init(RNG_HandleTypeDef *hrng)
|
211 | 210 | MODIFY_REG(hrng->Instance->CR, RNG_CR_CED | RNG_CR_CONDRST, hrng->Init.ClockErrorDetection | RNG_CR_CONDRST);
|
212 | 211 |
|
213 | 212 | #if defined(RNG_VER_3_2) || defined(RNG_VER_3_1) || defined(RNG_VER_3_0)
|
214 |
| -if ( HAL_GetREVID() == 0x2000) { // Deprecated - old MCU |
215 | 213 | /*!< magic number must be written immediately before to RNG_HTCRG */
|
216 | 214 | WRITE_REG(hrng->Instance->HTCR, RNG_HTCFG_1);
|
217 | 215 | /* for best latency and to be compliant with NIST */
|
218 |
| - WRITE_REG(hrng->Instance->HTCR, RNG_HTCFG_REVB); |
219 |
| -} |
220 |
| -else { |
221 |
| - /*!< magic number must be written immediately before to RNG_HTCRG */ |
222 |
| - WRITE_REG(hrng->Instance->HTCR, RNG_HTCFG_1); |
223 |
| - /* for best latency and to be compliant with NIST */ |
224 |
| - WRITE_REG(hrng->Instance->HTCR, RNG_HTCFG); |
225 |
| - } |
| 216 | + WRITE_REG(hrng->Instance->HTCR, RNG_HTCFG); |
226 | 217 | #endif /* RNG_VER_3_2 || RNG_VER_3_1 || RNG_VER_3_0 */
|
227 | 218 |
|
228 | 219 | /* Writing bit CONDRST=0 */
|
@@ -691,10 +682,6 @@ HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber(RNG_HandleTypeDef *hrng, uint32_t
|
691 | 682 | {
|
692 | 683 | hrng->State = HAL_RNG_STATE_READY;
|
693 | 684 | hrng->ErrorCode = HAL_RNG_ERROR_TIMEOUT;
|
694 |
| - if (__HAL_RNG_GET_FLAG(hrng, RNG_FLAG_SECS) != RESET) |
695 |
| - { |
696 |
| - hrng->ErrorCode |= HAL_RNG_ERROR_SEED; |
697 |
| - } |
698 | 685 | /* Process Unlocked */
|
699 | 686 | __HAL_UNLOCK(hrng);
|
700 | 687 | return HAL_ERROR;
|
|
0 commit comments