wiki/ avionics/ firmware/ PSAS STM32F407 Firmware Notes
  1. This page is for Avionics Firmware notes (STM32F407)
    1. See also
    2. Status
    3. Code Review
    4. Code Style
    5. Openocd Notes
    6. Datapath Timing
    7. PSAS git repository for firmware
    8. IP Address Assignments
      1. IP Ports Assignments
    9. MAC Address Assignments
    10. Precision Time Protocol (PTP)
      1. Proposed MAC address templates for PSAS
    11. Instructions for Instalation and Execution of STM32 code

This page is for Avionics Firmware notes (STM32F407)

See also

Data Protocol


Firmware Source Issues Our Status and Todo List

Code Review

Code Review Notes

Code Style

Code Style Notes

Openocd Notes


Datapath Timing

Datapath Timing

PSAS git repository for firmware

Notes on Maintaining The Repository

IP Address Assignments

This has to be determined in the context of Rocketnet.

IP Ports Assignments

Currently we are using 35000 and 35003. This will change

MAC Address Assignments

We will use a Locally Administered Address for MAC addresses on the individual boards.

Precision Time Protocol (PTP)

PTP Notes

Proposed MAC address templates for PSAS

{0xE6, 0x10, 0x20, 0x30, 0x40, 0x11}

{0xE6, 0x10, 0x20, 0x30, 0x40, 0xaa}

See also

Instructions for Instalation and Execution of STM32 code

Assumptions: Using Ubuntu Desktop 12.04

Clone the stm32 repo from PSAS’s Github account:

  1. cd preferred_git_dir
  2. git clone

Initialize ChibiOS git subroutine and setup:

  1. cd stm32
  2. git submodule update --init
  3. cd ChibiOS/ext
  4. unzip
  5. unzip
  6. unzip
  7. rm *.zip

Create directory for openocd and x-tools:

  1. sudo mkdir /opt/psas
  2. sudo chown <user> /opt/psas


New cross compiler

We will be using the cross compiler and tools built and supported by these people:

 Current Version: gcc-arm-none-eabi-4_7-2013q3-20130916

Download the cross compiler for your system.

Command Line:


Install instructions are here:

There is also a PPA repository for Ubuntu. Read about it here:

Currently, our build scripts expect the compiler to be found in your search path. That is, there is no assumption about where you decided to install your cross compiler.

Soon to be obsolete method

  1. cp /stm32/toolchain/psas-xtool-compiler-<i386|amd64>.tgz /opt/psas
  2. cd /opt/psas
  3. tar -zxvf psas-xtool-compiler-<i386|amd64>.tgz


  1. Download OpenOCD: and copy file to /opt/psas
  2. cd /opt/psas
  3. tar -zxvf openocd-0.6.1.tar.gz
  4. mv openocd-0.6.1/ openocd
  5. cd openocd
  6. sudo apt-get install libftdi-dev
  7. ./configure --enable-maintainer-mode --enable-ft2232_libftdi --enable-stlink --prefix /opt/psas/openocd
  8. make && sudo make install


Edit your .bashrc file and include these two aliases

  1. alias psas_stm="echo path is: $PATH; export PATH=/opt/psas/x-tools/stm32f407/arm-psas-eabi/bin:/opt/psas/openocd/bin/:/opt/eclipse:$PATH"
  2. alias st_ocd="sudo /opt/psas/openocd/bin/openocd -f olimex_stm32_e407.cfg --search /opt/psas/openocd/share/openocd/scripts"

How to cross-compile and program STM32-E407 board:

We’ll use the extintr example:

  1. Plug JTAG controller into STM32-E407 board and connect both devices to the computer via USB.
  2. cd preferred_git_dir/stm32/src/extintr
  3. psas_stm
  4. make
  5. make write (make write_stl for the stlink programmer)

Note: I had: /opt/psas/psas/x-tools due to copy flub. If make fails to find arm-psas-eabi-gcc check that x-tools is in /opt/psas.