-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32 HRNG driver #642
STM32 HRNG driver #642
Conversation
Hi @networkfusion, I'm nanoFramework bot. A human will be reviewing it shortly. 😉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Almost only cosmetic changes requested. 👏
On the code and header files, if you could tidy up the tabs... there 2 and 4 spaces... 😉
|
||
#endif /* HAL_USE_STM32_RNG */ | ||
|
||
#endif /* HAL_STM32_RNG_H_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done...
@@ -0,0 +1,8 @@ | |||
# RNG v1 | |||
|
|||
This driver supports all STM32 series. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is contradicted bellow... something like all but F0 seems more accurate...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done..
|
||
|
||
uint32_t rng_lld_GetLastRandomNumber() { | ||
return RNGD1.RandomNumber; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done...
|
||
|
||
// RNG Interrupt definitions | ||
#define RNG_IT_DRDY RNG_SR_DRDY /*!< Data Ready interrupt */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RNG_SR_DRDY doesn't seem to be used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below...
#define RNG_IT_SEI RNG_SR_SEIS /*!< Seed error interrupt */ | ||
|
||
// RNG Flag definitions | ||
#define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RNG_SR_DRDY doesn't seem to be used anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is used...
|
||
// RNG Flag definitions | ||
#define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ | ||
#define RNG_FLAG_CECS RNG_SR_CECS /*!< Clock error current status */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below...
// RNG Flag definitions | ||
#define RNG_FLAG_DRDY RNG_SR_DRDY /*!< Data ready */ | ||
#define RNG_FLAG_CECS RNG_SR_CECS /*!< Clock error current status */ | ||
#define RNG_FLAG_SECS RNG_SR_SECS /*!< Seed error current status */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this one too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to keep these 3 as one is used and the other 2 are options (although not currently used...
/* Driver macros. */ | ||
/*===========================================================================*/ | ||
// Reset RNG handle state | ||
//#define __RNG_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__).State = HAL_RNG_STATE_RESET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
return randomNumber; | ||
} | ||
|
||
#endif /* HAL_USE_STM32_RNG */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
/*===========================================================================*/ | ||
|
||
|
||
// RNG Interrupt definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't seem to be using interrupts so this block can go away, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
One last request: on the halconf_nf.h (booter and CLR) for the F091 you have to add that negative RNG driver or the build will break |
Description
Motivation and Context
How Has This Been Tested?
On an STM32F769I (Be aware, this is my first driver so it needs careful review against the reference implementation.
Screenshots
Types of changes
Checklist: