Git Product home page Git Product logo

k64_firmware's Introduction

K64 Firmware

This repository serves as the working master of the real time flight computer firmware for the entire project.

Contribution Style

In order to contribute to this repository: If you are making major changes that you will own, ie: new feature, driver:

  • Fork this repository.
  • Make your changes there, in any branching strategy that you like
  • Create a pull request from the specific branch in your repository with only the desired changes for a single pull request in it onto the branch in this repository to which those features should be added.

If you are making minor changes or are collaborating with others in this org:

  • Clone this repository.
  • Create a new branch starting from the branch you will work off of (usually, master) with a descriptive name to put your changes on.
  • Make your changes, test them, and commit everything to your branch.
  • Push the branch to this repository.
  • Create a pull request from that new branch to the branch that you started work from (again, usually master)

Building the Firmware

  1. Run python init.py.
  2. Run meson <build dir> --cross-file k64_files/k64_cross_properties.cfg.
  3. Run ninja -C <build dir>.

Flashing the Target

  1. Run scripts/flash.sh.

Debugging the Target

  1. From your terminal, run scripts/gdb.sh build/main.elf.
  2. From another pty, run telnet localhost 4444.
  3. In the telnet shell, type reset init before doing anything in GDB.

When debugging and flashing, an OpenOCD server is started that runs in the background. The scripts here create a PID file in case you need to kill it manually, which is located at the project root with the name openocd.pid. Normally, this should not be necessary. Running scripts/openocd_server.sh stop or typing shutdown in the telnet console should be enough to end your OpenOCD session gracefully.

When debugging the target, a new ROM may be flashed to the device, but GDB will not be aware of the change, nor the reset. By default, the flash script causes the target to be running after a flash, meaning that reset init must be issued in the telnet console in order to reset and halt the target. Note that GDB will still not be aware of the new debugging symbols, so it needs to be restarted or the ELF file reloaded for correct source-level debugging.

k64_firmware's People

Contributors

pyroavr avatar spressomartini avatar sjl2178 avatar

Watchers

James Cloos avatar  avatar

Forkers

pyroavr

k64_firmware's Issues

Use NVIC_* functions for interacting with NVIC registers.

Use NVIC_SetPriority instead of NVIC->IP[...].

Known occurrences:
src/drivers/kinetis/i2c.c:90
src/drivers/kinetis/uart.c:151

This is to prevent interrupt priorities from being incorrectly set. The NVIC uses an MSB-aligned scheme for storing interrupts, which is misplaced when using the IP registers directly.

The change is necessary to prevent PendSV from inadvertently preempting a real exception, which will cause a UsageFault on return since another exception is active.
The other workaround is to set SCB->CCR.NONBASETHRDENA to allow return to thread when exceptions are active, but that may lead to data corruption, and will slow down the system due to extra context switches.

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.