GithubHelp home page GithubHelp logo

apptemplate's Introduction

App Template

This project is a C++ application template for small embedded ARM Cortex-M MCUs.

After cloning make sure to update the following fields:

  • Update the APPLICATION_NAME variable in CMakeLists.txt with the name of your application.
  • Update the CHIP_NAME variable in CMakeLists.txt with the target chip. You can see available targets with postform_rtt --list-chips.
  • Update the memory.ld linker script to point to your RAM and FLASH memories.
  • Update the systick frequency in systick_config.h.
  • Write your own code and have tons of fun!

This template should work out of the box on a nRF52840 MCU.

To build you will need:

  • An up to date clang compiler (version >= 11).
  • A cross GCC ARM compiler (>= gcc-arm-none-eabi-10-2020-q4-major).
  • CMake >= 3.16
  • Optional: Ninja. It significantly speeds up the compilation process.
  • Git: used by Postform to detect the FW version being used and embed it into the ELF debug sections.

Build instructions

Run the following commands in a terminal:

mkdir build
cd build

# Select the appropriate toolchain file for your MCU Architecture
cmake -G Ninja -D CMAKE_TOOLCHAIN_FILE=cmake/toolchains/armv7e-m.cmake -DCMAKE_SYSTEM_NAME=Generic ..
cmake --build .

# The output file will have the name given by the ${APPLICATION_NAME} variable in CMakeFiles.txt.
# By default this will be nrf52_app

In order to run the binary with Postform install postform_rtt with:

# Installs the latest version of Postform. It must match the firmware version used, which also
# tracks the main branch
cargo install postform_rtt --git https://github.com/Javier-varez/postform --branch main postform_rtt

Then run the program in the target, connect it to the computer using a JTAG/SWD interface and run:

cd build
ninja run

You should see some logs being printed in your terminal now!

apptemplate's People

Contributors

javier-varez avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.