A bootloader may hand over with the ICACHE enabled, and nothing waits for the invalidate that runs when the ICACHE is disabled. The driver also polled BUSYF without a bound, so a stuck flag would hang the boot, and it ignored an invalidate that never finished. - stm32_enable_icache(): on first use, disable and invalidate the ICACHE before the associativity and region registers are written (they are only writable while EN=0), and wait for any pending invalidate before enabling it (RM0481 8.4.5). - stm32_disable_icache(): wait for the invalidate that EN=0 starts and clear BSYENDF and ERRF. - Bound every BUSYF wait with STM32_ICACHE_BUSY_TIMEOUT. RM0481 gives no invalidate duration, so the value is a margin, not a measured limit. - stm32_enable_icache() now returns OK or -ETIMEDOUT instead of void. On a timeout the ICACHE is left disabled: with BUSYF stuck it would not cache anything anyway (RM0481 8.4.5). Existing callers ignore the result and keep working. - __start: when CONFIG_STM32_ICACHE is not set, disable an ICACHE left on by a bootloader, so reads of the OTP and UID cannot fault. On an STM32H563 with the ICACHE left enabled this way, a 16-bit read of the UID raised a precise bus fault and up_progmem_write() failed its read-back check with -EIO. Assisted-by: Claude:claude-sonnet-5-5 Signed-off-by: Ricardo Maurizio Paul <ricardopaul@geotab.com> |
||
|---|---|---|
| .github | ||
| arch | ||
| audio | ||
| binfmt | ||
| boards | ||
| cmake | ||
| crypto | ||
| Documentation | ||
| drivers | ||
| dummy | ||
| fs | ||
| graphics | ||
| include | ||
| libs | ||
| mm | ||
| net | ||
| openamp | ||
| pass1 | ||
| sched | ||
| syscall | ||
| tools | ||
| video | ||
| wireless | ||
| .asf.yaml | ||
| .codespell-ignore-lines | ||
| .codespellrc | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmessage | ||
| .mcp.json | ||
| .pre-commit-config.yaml | ||
| .yamllint | ||
| AUTHORS | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| INVIOLABLES.md | ||
| Kconfig | ||
| LICENSE | ||
| Makefile | ||
| NOTICE | ||
| README.md | ||
| ReleaseNotes | ||
Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).
For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.
Getting Started
First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.
Documentation
You can find the current NuttX documentation on the Documentation Page.
Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.
The old NuttX documentation is still available in the Apache wiki.
Supported Boards
NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.
Contributing
If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.
License
The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.