MCAN controller keeps track of empty TX HW FIFO slots in priv->txfsem semaphore. The semaphore is incremented from TX complete interrupt and taken before new frame is inserted to the HW FIFO. There may be a situation when TX HW FIFO is not full but the semaphore is not yet incremented because the driver didn't handle the interrupt. I managed to reproduce this issue when sending large data chunks over CAN bus and keeping the buffers full for most of the transmission process. This situation leads to the debug assertion although technically it's not a big issue -> the sending function waits on the semaphore until it's posted by the interrupt handler. Moreover, the sanity checks should not be necessary because mcan_buffer_reserve function will take care of fixing the semaphore value if it doesn't match with the FIFO. The entire semaphore logic is a bit weird and probably not necessary. All we need to do is to check SAM_MCAN_TXFQS register if there is at least one free slot in the queue. But this would require a bigger SAMv7 MCAN rewrite, this is rather a hot fix. Signed-off-by: Michal Lenc <michallenc@seznam.cz> |
||
|---|---|---|
| .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 | ||
| .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.