Skip to content

gallowaa/can4vscp_frdm_bm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

A baremetal port of VSCP firmware to Kinetis

This is one of the pieces of the "EasyIoTwithVSCP" project on the Freescale Community. The first supported platform is the FRDM-K64F, however since the Kinetis SDK is used it is highly portable to other Kinetis devices with a FlexCAN peripheral. If you want to try this code you might want to use a TWR-K6x as the TWR-SER has a CAN transceiver. Alternatively, make a request for a FRDM-CAN-VSCP shield through the Freescale Community.

Known Limitations

Receiving CAN messages can cause a hardfault. This is being looked into and the problem does not exist with MQX, due to what I believe to be more robust transitioning between mailbox states (empty, full, overrun, etc)

Comment out vscp_getEvent() in main.c to prevent hardfaults. The device will report vscp data (die temperature and accelerometer).

Project Requirements

1. Get the vscp firmware and software:

  • git clone https://github.com/grodansparadis/vscp_software
  • git clone https://github.com/grodansparadis/vscp_firmware

2. Install the following free tools from Freescale:

Setup the Freescale tools:
  • Accept the default KSDK installation path, ex. "C:/Freescale" on a Windows machine
  • An update is needed to make the IDE KSDK compatible. To install:
  • Help > Install New Software > Add > Archive > Browse C:/Freescale/KSDK_1.2.0/tools/eclipse_update/KSDK_1.2.0_Eclipse_Update.zip
  • When using the KSDK, we need to link to a platform library which contains hardware and operating system abstraction layers (HAL & OSA), peripheral drivers, and startup code. To Build the platform library:
  • File > Import > General > Existing Projects into Workspace > Next > Browse C:/Freescale/KSDK_1.2.0/lib/ksdk_platform_lib/kds/
  • Don't forget to correct the include path for vscp_firmware/common to match your machine

3. Additional Info

  • To install free debugger + serial emulator firmware on FRDM board MCU on Eclipse
  • Document for setting up a project based on the examples DOC-103288

VSCP logo

Advantages of Kinetis for VSCP

  • FlexCAN hardware masking - If there are 100 sensor nodes talking on the bus, there are many wasted CPU cycles involved in receiving messages through software only to find out that the message isn't for us. For example, a node is generally un-interested in seeing measurements (CLASS=10) from other nodes, but we DO want to know if the segment controller is trying to write to one of our registers (see vscp register model), or has told us to do something like go to sleep, change reporting interval, etc. This is easily accomplished with mailbox masking.
  • RTC Peripheral - VSCP reference FW does limited time keeping through global variables, the Real-Time-Clock (RTC) module allows for high accuracy time keeping in various formats (tick time, POSIX time).
  • Software Enablement - KSDK decreases dependence on the reference manual, and MQX is a complimentary commercial grade RTOS that has been to space and comes with full set of drivers.

This is not meant to be an exhaustive list, just some things I noted during development and wanted to formalize.

About

Baremetal port of VSCP firmware to Kinetis devices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published