If don't know if this is an issue that anyone cares about. I am also not sure what the best way to solve it is either. I just thought I would issue a pull request with this commit to bring the issue to light and show a possible solution that I have tested on my mbed-1768 device. Previously the serial_putc() API didn't make any use of the Tx FIFO since the serial_writable() API it utilizes only returns true when the FIFO is completely empty. This is due to the fact that the THRE bit of the UART's LSR (Line Status Register) only goes high when the whole FIFO is empty. I noticed this when doing some performance testing with the network stack. I went from calling printf() to output 3 bytes every 10 seconds (with packet drop stats) to instead output 4 bytes every 10 seconds. I thought these should easily fit in the 16 byte FIFO but outputting one extra byte caused an additional three 550 byte UDP packets to be dropped. This should only happen if the additional character being sent to the UART was taking away extra CPU cycles from the network stack. My solution is to keep track of the number of bytes that have been placed in the Tx FIFO since it was last detected as being completely empty (via the THRE bit). Only once this count hits 16 does the code then block, waiting for the THRE bit to go high. Each time the THRE bit does go high, the count is reset to 0 again and it is incremented for each byte that is loaded into the THR. |
||
---|---|---|
libraries | ||
workspace_tools | ||
.gitattributes | ||
.gitignore | ||
LICENSE | ||
MANIFEST | ||
MANIFEST.in | ||
README.md | ||
setup.py |
README.md
mbed SDK
The mbed Software Development Kit (SDK) is a C/C++ microcontroller software platform relied upon by tens of thousands of developers to build projects fast.
The SDK is licensed under the permissive Apache 2.0 licence, so you can use it in both commercial and personal projects with confidence.
The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.
Documentation
- Tools: how to setup and use the build system.
- mbed library internals
- Adding a new target microcontroller
Supported Microcontrollers
NXP:
- LPC1768 (Cortex-M3)
- LPC11U24 (Cortex-M0)
- LPC2368 (ARM7TDMI-S)
- LPC810 (Cortex-M0+)
- LPC812 (Cortex-M0+)
- LPC4088 (Cortex-M4)
- LPC4330 (Cortex-M4 + Cortex-M0)
- LPC1347 (Cortex-M3)
- LPC1114 (Cortex-M0)
- LPC11C24 (Cortex-M0)
Freescale:
- KL25Z (Cortex-M0+)
- KL05Z (Cortex-M0+)
STMicroelectronics:
- STM32F407 (Cortex-M4)
Supported Toolchains and IDEs
- GCC ARM: GNU Tools for ARM Embedded Processors
- ARMCC (standard library and MicroLib): uVision
- IAR: IAR Embedded Workbench
- GCC code_red: Red Suite
- GCC CodeSourcery: Sourcery CodeBench
API Documentation
- RTOS API
- TCP/IP Socket API (Transports: Ethernet, WiFi, 3G)
- USB Device API
- USB Host API
- DSP API
- Flash File Systems: SD, USB MSD, semihosted
- Peripheral Drivers API
Community
For discussing the development of the mbed SDK itself (Addition/support of microcontrollers/toolchains, build and test system, Hardware Abstraction Layer API, etc) please join our mbed-devel mailing list.
For every topic regarding the use of the mbed SDK, rather than its development, please post on the mbed.org forum, or the mbed.org Q&A.
For reporting issues in the mbed libraries please open a ticket on the issue tracker of the relevant mbed official library.