|
STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
|
Flash wait states, prefetch and caches. More...
Functions | |
| DRIVER_MUST_CHECK DriverStatus_e | flashSetLatency (FlashRegisters_t *flash, uint32_t latency) |
| Set the flash access latency and confirm it by reading it back. | |
| void | flashEnableCaches (FlashRegisters_t *flash) |
| Turn on prefetch and the instruction and data caches. | |
Flash wait states, prefetch and caches.
| DriverStatus_e flashSetLatency | ( | FlashRegisters_t * | flash, |
| uint32_t | latency ) |
Set the flash access latency and confirm it by reading it back.
The latency must be at least RM0390 Table 5's value for the SYSCLK in use. More wait states than needed are always safe; too few corrupt instruction fetches with no fault. RM0390 has no ready flag for this field, but asks for the read-back.
| flash | Flash interface block (e.g. FLASH). |
| latency | Wait states, 0-15. |
| DRIVER_STATUS_OK | Written and read back. |
| DRIVER_STATUS_ERR_INVALID_PARAM | latency is above 15. |
| DRIVER_STATUS_ERR_HW_FAULT | The read-back differs: the interface did not accept it. |
Definition at line 12 of file flash.c.
References FlashRegisters_t::ACR, DRIVER_STATUS_ERR_HW_FAULT, DRIVER_STATUS_ERR_INVALID_PARAM, DRIVER_STATUS_OK, FLASH_ACR_LATENCY_Msk, FLASH_ACR_LATENCY_Pos, and flashSetLatency().
Referenced by flashSetLatency(), and rccSysclkSwitch().
| void flashEnableCaches | ( | FlashRegisters_t * | flash | ) |
Turn on prefetch and the instruction and data caches.
Other ACR fields, including LATENCY, are preserved. The caches are empty out of reset, so no cache reset is done. Callable at any point in bring-up.
| flash | Flash interface block (e.g. FLASH). |
Definition at line 40 of file flash.c.
References FlashRegisters_t::ACR, FLASH_ACR_DCEN, FLASH_ACR_ICEN, FLASH_ACR_PRFTEN, and flashEnableCaches().
Referenced by bspClockInit(), and flashEnableCaches().