Go to file
Adam Green 969733ae8f serial_putc() to make better use of Tx FIFO
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.
2013-10-25 15:17:06 +03:00
libraries serial_putc() to make better use of Tx FIFO 2013-10-25 15:17:06 +03:00
workspace_tools Fix error in 'update_repo' call 2013-10-23 17:27:36 +03:00
.gitattributes Added .gitattributes for automatic LF line ending conversion 2013-08-08 13:19:34 +03:00
.gitignore Restructuring 2013-10-22 12:13:04 +01:00
LICENSE Add Apache v2 LICENSE file 2013-08-06 12:05:04 +01:00
MANIFEST Updated package name 2013-10-24 10:17:17 +01:00
MANIFEST.in Restructuring 2013-10-22 12:13:04 +01:00
README.md Update README.md 2013-09-17 16:24:43 +01:00
setup.py Updated package name 2013-10-24 10:17:17 +01:00

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

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

API Documentation

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.