Giter Site home page Giter Site logo

nlintn / moveloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thomasw04/moveloader

0.0 0.0 0.0 87 KB

A bootloader for the stm32l4r5. Enabling reliable and safe firmware upgrades.

License: BSD 3-Clause "New" or "Revised" License

Shell 12.63% Rust 83.22% Makefile 2.70% Dockerfile 1.45%

moveloader's Introduction

Moveloader

Documentation for users of the bootloader is available in the User Guide. To build the bootloader or pack it into a flash image with OS images, check out the Build Guide.

To make sure you have configured a device correctly for the bootloader to work, you can run a hardware test.

When writing code for the bootloader, you should use the following chip documentation for reference:

To develop, you can either use the Dev Container configuration file in this repository (TL;DR: open VSCode, install the "Dev Containers" extension and then open this directory in VSCode, then "Reopen in Container"), or follow the setup guide below.

Install and setup (Linux)

Disclaimer: I tested this on Ubuntu-22.04 LTS

First you will need the following dependencies:

sudo apt-get install build-essential cmake libusb-1.0 libusb-1.0-0-dev gdb-multiarch gcc-arm-none-eabi openocd

Note: On older Ubuntu (14.04/16.04) gdb-arm-none-eabi.

Then you need to create a symlink for the cross-debugger:

sudo ln -s /usr/bin/gdb-multiarch /usr/bin/arm-none-eabi-gdb

If you want to debug on QEMU you will also need this:

sudo apt-get install qemu-system-arm

On Arch: qemu-arch-extra)

Then download rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

after rustup is successfully installed:

rustup target add thumbv7em-none-eabi

Now install the st-flash fork:

git clone --single-branch -b fix-stm32l4r5 https://github.com/bauen1/stlink.git /tmp/stlink
cd /tmp/stlink
make clean
make release
sudo make install
sudo ldconfig
sudo rm -r /tmp/stlink

Now you should be able to get the bootloader running:

I strongly recommend using vscode (Could be alot of pain otherwise)

  1. If you made the reasonable choice to use vscode just install the extension (extensions.json).
  2. Plug in your STM32L4R5
  3. Run the Debug (OpenOCD) configuration.
  4. Programm should be compiled + flashed + debugger started -> Profit.

Useful commands

Use:

cargo size --bin stm-bootloader -- -A

To get a detailed view of your binary size (use --release for release)

Or:

cargo readobj --bin stm-bootloader -- --file-headers

For inspecting the file headers of the generated binary (use --release for release)

moveloader's People

Contributors

thomasw04 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.