Libuavcan platform driver for NXP LPC11C24
Switch branches/tags
Nothing to show
Clone or download
pavel-kirienko Merge pull request #3 from thirtytwobits/master
Issue #1 Adding Travis CI banner.
Latest commit d4ad088 Aug 8, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
driver Direct code import Jun 29, 2018
test_olimex_lpc_p11c24 Issue #1 fix build Aug 3, 2018
.gitignore Direct code import Jun 29, 2018
.travis.yml Issue #1 fix build Aug 3, 2018
LICENSE Initial commit Jun 29, 2018
README.md Issue #1 Adding Travis CI banner. Aug 8, 2018
Vagrantfile Issue #1 fix build Aug 3, 2018
bootstrap.sh Issue #1 fix build Aug 3, 2018

README.md

Libuavcan platform driver for NXP LPC11C24

Build Status Gitter

This page describes the libuavcan driver for the NXP LPC11C24 MCU and shows how to use libuavcan on this platform.

NXP LPC11C24 is a low-end ARM Cortex-M0 microcontroller that features an embedded CAN controller with a CAN transceiver, rendering it a true single-chip solution for CAN applications. Since the computational resources of this MCU are quite limited, a number of restrictions apply:

  • The driver is designed to run on bare metal - no RTOS supported.
  • The libuavcan library can be compiled only in tiny mode, which removes a number of auxiliary features.
  • Core clock frequency must be strictly 48 MHz.
  • The driver supports time synchronization in slave mode only, i.e., the device running libuavcan with this driver can't act as a clock synchronization master.

The following hardware modules are used by the driver:

  • CAN controller
  • SysTick timer for clock functions

The driver is written in standard C++11. It leverages the LPCOpen libraries for low-level hardware control.

Users are encouraged to use the test project for this driver as a starting point in developing their own applications (see the next sections).

Build configuration

This driver can be configured via the preprocessor definitions listed in the table below. All of these options have adequate default settings, so in most cases they need not be altered.

Name Default Description
UAVCAN_LPC11C24_RX_QUEUE_LEN 8 CAN driver RX buffer depth
UAVCAN_LPC11C24_USE_WFE This option enables execution of the WFE instruction when the driver is blocked in select(). This feature is disabled by default. Please read the relevant section below.

UAVCAN_LPC11C24_USE_WFE

Generally, this feature should be avoided in real-time applications, so it's disabled by default.

Pros:

  • Lower power consumption, because the core will halt on WFE if there are no pending tasks instead of burning cycles in a busy loop.

Cons:

  • It is hard to control the duration of the WFE block, which may disrupt hard real-time processing.
  • Sometimes, WFE may extend the select() blocking timeout past the requested duration.

Example

Please use the test application distributed with this driver as a starting point in developing your own firmware for this platform. It can be easily adapted for any hardware platform.

To build the example using vagrant do:

vagrant up
vagrant ssh
cd test_olimex_lpc_p11c24
make