Merge pull request #2448 from cesanta/fixh743f

Fix H743 FreeRTOS early SysTick crash
This commit is contained in:
Sergio R. Caprile 2023-11-02 15:14:27 -03:00 committed by GitHub
commit 129bf93b30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -35,4 +35,4 @@
#define vPortSVCHandler SVC_Handler #define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler #define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler //#define xPortSysTickHandler SysTick_Handler

View File

@ -7,6 +7,13 @@
#define BLINK_PERIOD_MS 1000 // LED blinking period in millis #define BLINK_PERIOD_MS 1000 // LED blinking period in millis
// workaround SysTick firing before FreeRTOS has fully initialized (startup)
extern void xPortSysTickHandler(void);
void SysTick_Handler(void) {
if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
xPortSysTickHandler();
}
void mg_random(void *buf, size_t len) { // Use on-board RNG void mg_random(void *buf, size_t len) { // Use on-board RNG
for (size_t n = 0; n < len; n += sizeof(uint32_t)) { for (size_t n = 0; n < len; n += sizeof(uint32_t)) {
uint32_t r = rng_read(); uint32_t r = rng_read();