Download FreeRTOS
 

Quality RTOS & Embedded Software

KERNEL
WHAT'S NEW
Simplifying Authenticated Cloud Connectivity for Any Device.
Designing an energy efficient and cloud-connected IoT solution with CoAP.
Introducing FreeRTOS Kernel version 11.0.0:
FreeRTOS Roadmap and Code Contribution process.
OPC-UA over TSN with FreeRTOS.

Flashlite 186 Port
[RTOS Ports]

flshlite.jpg

The Flashlite 186 is a very cost effective single board computer that provides RS232, RS485 and digital IO ports. It utilises an AMD embedded 186 register and instruction set compatible 33.3 MHz RDC8822 processor.

The single board computer has a royalty free version of DOS pre-installed in read only memory which works straight out of the box. The DOS system redirects console IO to/from a serial port allowing the familiar DOS command line interface to be available via a standard terminal program (e.g. HyperTerminal).

A flash file system is also provided which can be extended to 16MBytes by inserting a DiskOnChip into the socket already provided on the single board computer.

The provided demo application can be built with the open source Open Watcom Development Tools, or the Borland tools that come with the Flashlite 186 starter kit.


IMPORTANT! Notes On Using The 186 RTOS Port:

Please read all the following points before using this port.

  1. Source Code Organization
  2. The Demo Application
  3. Configuration and Usage Details
See also the FAQ My application does not run, what could be wrong?

Source Code Organization

The FreeRTOS download contains the source code for all the FreeRTOS ports.

See the Source Code Organization section for a description of the downloaded files and information on creating a new project.

The Flashlite 186 project files (Open Watcom and Borland) are contained in the Demo/Flshlite directory.



The Demo Application

The FreeRTOS source code download includes a fully preemptive multitasking demo application for the 80x186 RTOS port.

Demo application hardware setup

The demo application includes tasks that send and receive characters over the serial port. The characters sent by one task need to be received by another - if any character is missed or received out of sequence an error condition is flagged. A loopback connector is required on the serial port for this mechanism to operate (simply connect pins 2 and 3 together on the serial port connector).

The demo application utilises the LED built onto the single board computer. This single LED is enough to check that the demo is functioning correctly, but for best effect an extra eight LEDs can be fitted to port F.


Building the RTOS demo application

Both Borland V4.52 and Open Watcom development tools are supported. Project files that can be opened from within the respective IDE's can be found in the Demo/Flshlite directory. The resultant RTOSDemo.exe file should be downloaded and executed on the SBC as described in the Flashlite manual. Compressing the executable prior to download can half the download time. See the UPX project page for a suitable compression utility.


Functionality

The demo application creates all of the standard demo application real time tasks (see the demo application section for details of the individual tasks).

The LEDs on port F are under control of the 'flash' tasks. Each will flash at a constant but different frequency as described in the demo application documentation. Each LED is controlled by a different task.

Not all the tasks update an LED so have no visible indication that they are operating correctly. Therefore a 'Check' task is created whose job it is to ensure that no errors have been detected in any of the other tasks. The LED built into the SBC is under control of the 'Check' task. Every five seconds the 'Check' task examines all the tasks in the system to ensure they are executing without error. It then toggles the LED. If the LED is toggling every five seconds then no errors have ever been detected. The toggle rate increasing to 100ms indicates that the 'Check' task has discovered at least one error. This mechanism can be checked by removing the loopback connector from the serial port (described above), and in doing so deliberately generating an error.



Configuration and Usage Details

RTOS port specific configuration

Configuration items specific to this port are contained in Demo/Flshlite/FreeRTOSConfig.h (or Demo/Flshlite/FRConfig.h if the Borland compiler is being used). The constants defined in this file can be edited to suit your application. In particular - the definition configTICK_RATE_HZ is used to set the frequency of the RTOS tick. The supplied value of 1000Hz is useful for testing the RTOS kernel functionality but is faster than most applications require. Lowering this value will improve efficiency.

Each port #defines 'BaseType_t' to equal the most efficient data type for that processor. This port defines BaseType_t to be of type short.


Switching between the pre-emptive and co-operative RTOS kernels

Set the definition configUSE_PREEMPTION within Demo/Flshlite/FreeRTOSConfig.h (or Demo/flshlite/FRConfig.h if the Borland compiler is being used) to 1 to use pre-emption or 0 to use co-operative.


Development tool options

As with all the ports, it is essential that the correct compiler options are used. The best way to ensure this is to base your application on the provided RTOS demo application projects.


Code Size

Removing references to any stdio.h defined function both greatly increases download time and removes any possible causes of real time performance degradation. The macro definitions USE_STDIO (defined within the IDE project file) can be used to conditionally compile with or without console IO. I suggest that console IO only be included when diagnosis is required.


Serial port driver

It should also be noted that the serial drivers are written to test some of the real time kernel features - and they are not intended to represent an optimised solution. In particular the DMA facility is not used.

I have never tried using COM1, only COM2. COM1 may require a slightly different setup.


Floating Point

Currently there is an issue with executing Open Watcom generated applications that contain floating point variables. This is not related to the RTOS kernel. For now the Flashlite 186 demo application does not perform any floating point calculations. This is only an issue when using the Open Watcom compiler and not when using the Borland compiler supplied by JK Microsystems in the Flashlite 186 development kit. The Borland floating point emulation is not re-entrant - but tricks for making it so are quite well documented.


Memory allocation

Source/Portable/MemMang/heap_2.c is included in the Flashlite demo application projects to provide the memory allocation required by the real time kernel. Please refer to the Memory Management section of the API documentation for full information.


Demo application serial driver

The serial driver is written to test some of the real time kernel features - and is not not intended to represent an optimised solution.







Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.