-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Implement basic rand() #6998
Implement basic rand() #6998
Conversation
Disabled shadowing of the FreeRTOS config by the DMM header. Implemented a basic PRNG for ctor startup. The global initialization of the global message counter struct in `src/transport/MessageCounter.h` results in a call to the C standard library function `rand()` from a C++ ctor. This results in a call to pvPortMalloc, causing a hard fault with the current buffer implementation.
Size increase report for "esp32-example-build" from fb7cd0f
Full report output
|
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.
Thanks for the change! We have updated our PR template, requesting changes to conform to the PR template:
#### Problem
What is being fixed? Examples:
* Fix crash on startup
* Fixes #12345 Frobnozzle is leaky (exactly like that, so GitHub will auto-close the issue).
#### Change overview
What's in this PR
#### Testing
How was this tested? (at least one bullet point required)
* If unit tests were added, how do they cover this issue?
* If unit tests existed, how were they fixed/modified to prevent this in future?
* If new unit tests are not added, why not?
* If integration tests were added, how do they verify this change?
* If new integration tests are not added, why not?
* If manually tested, what platforms controller and device platforms were manually tested, and how?
* If no testing is required, why not?
Apologies, I must have gotten it in before the template was update. I've included the testing information now. |
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.
No apologies needed, the template is new :) Thanks!
Co-authored-by: Boris Zbarsky <[email protected]>
* Implement basic rand() Disabled shadowing of the FreeRTOS config by the DMM header. Implemented a basic PRNG for ctor startup. The global initialization of the global message counter struct in `src/transport/MessageCounter.h` results in a call to the C standard library function `rand()` from a C++ ctor. This results in a call to pvPortMalloc, causing a hard fault with the current buffer implementation. * Restyled by whitespace * Update src/platform/cc13x2_26x2/Random.c Co-authored-by: Boris Zbarsky <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Justin Wood <[email protected]> Co-authored-by: Boris Zbarsky <[email protected]>
Disabled shadowing of the FreeRTOS config by the DMM header.
Implemented a basic PRNG for ctor startup.
The global initialization of the global message counter struct in
src/transport/MessageCounter.h
results in a call to the C standard libraryfunction
rand()
from a C++ ctor. This results in a call to pvPortMalloc,causing a hard fault with the current buffer implementation.
Problem
rand()
is called beforemain()
so the calls to allocate a reent struct fail.Summary of Changes
Added a basic non-reent PRNG for the TI platform.
Fixes #6997
Testing
Manually tested with an LP_CC2652R7. Execution was traced from the
ResetISR
tomain
with CCS and the device was left to free run. log output was viewed on the debug UART connection and the processor was halted in the power idle loop.