Skip to content

CodethinkLabs/bloodlight-zephyr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bloodlight-Zephyr

Introduction

This projects aims to develop firmware support for Codethink's Bloodlight board using Zephyr RTOS. To do so, we take as a reference the Bloodlight-firmware project and we first replace Libopencm3 library's APIs with Zephyr APIs. Sometimes this is not straighforward and we can't just replace one by the other because they don't share identical behaviours. When this happens, some workarounds are put in place to be able to use the Zephyr API without modifying too much the original function's behaviour.

Current status

So far, we currently have completed:

  • Added Zephyr board support for bloodlight_rev2 board. For information on how to add board support read Zephyr's Board Porting Guide. To check the actual support work check boards/arm/bloodlight_rev2.

  • Configure CMake to be able to build the app with the board support files stored in this repo isntead of the Zephyr's repository tree.

  • Move bloodlight-firmware code here to start migrating it to zephyr.

    • Currently this are the bits that have been sucessfully migrated to Zephyr:
      • Led Support.
    • Currently this are the bits that we are working on migrating to Zephyr:
      • USB Support.
  • Add tests for:

    • LEDs.

Future Tasks

More information in Task-Planning.

Getting Started

Currently, in order to be able to use the bloodlight board with zephyr a little workaround is needed.

  1. Follow Zephyr's Getting Started steps.

  2. Ensure the following environment variables are set:

        export ZEPHYR_BASE=<path of zephyr project..>
        export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
        export ZEPHYR_SDK_INSTALL_DIR=<toolchain location..>

    Example of the Zephyr environment variable settings:

        export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
        export ZEPHYR_SDK_INSTALL_DIR="/opt/zephyr-sdk/"
        export ZEPHYR_BASE=/home/rdale/projects/co054/src/zephyrproject/zephyr
  3. Build

    • Option 1: Build with west.

          cd $ZEPHYR_BASE
          west build <bloodlight-zephr directory path/${Desired app}>

      Current working app is tests/led/.

      If you would like to make a clean build use

          west build -p always <bloodlight-zephr directory path/${Desired app}>
    • Option 2: Build with cmake if preferred:

          cd <bloodlight-zephr directory path>
          mkdir build
          cd build
          cmake ..
          make
  4. Board Setup: Please refer to Bloodlight-firmware's Readme Hardware Setup section for an explanation about how to do this.

  5. Flash

        west flash

tests/led/ program should report via ttyACM* (ttyACM2 in my case), and make the LEDs blink.

Weird Problem fixing

If you run into unexplicable problems during the build or flash process try the next to fix them.

SAVE CHANGES FIRST!!!

  • Option 1:

    1. In zephyrproject/zephyr execute git clean -fd.
    2. west update
  • Option 2: Delete zephyrproject/ and zephyr-sdk directories and install zephyr back.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published