Code Monkey home page Code Monkey logo

arm-development's Introduction

Installing OpenOCD (On-Chip Debugger)

# Mac OS X
brew install openocd
# Ubuntu
sudo aptitude install checkinstall
tar -zxvf openocd-x.y.z.tar.gz
cd openocd-x.y.z.tar.gz
./bootstrap
./configure --prefix=/usr --enable-stlink --enable-jlink --enable-amtjtagaccel --enable-ft2232_libftdi
make
sudo checkinstall make install

Installing cross-compiler

# Ubuntu
sudo aptitude install gcc-arm-none-eabi
# Mac OS X
brew install mpfr gmp libmpc libelf texinfo
git clone https://github.com/jsnyder/arm-eabi-toolchain
cd arm-eabi-toolchain
make install-cross

echo "export PATH=~/arm-cs-tools/bin:$PATH" >>~/.zshrc

Installing ChibiOS

git clone https://github.com/ChibiOS/ChibiOS-RT
cd ChibiOS-RT/demos
cp -r ARMCM3-STM32L152-DISCOVERY ~/arm-devel
cd ~/arm-devel
rm -rf iar keil

Change Makefile to point CHIBIOS to the correct path. Alter main.c as desired. Then make.

Using OpenOCD to upload binary

cd ~/arm-devel
openocd -f /usr/share/openocd/scripts/board/stm32ldiscovery.cfg

From another terminal, upload the binary to the board.

telnet localhost 4444

# show current status
poll

# halt processor
reset halt

# show flash details
flash probe 0

# write binary to flash
flash write_image erase build/ch.bin 0x08000000

# reset unit and exit
reset
exit

There's some neat stuff in one of the links below about using gdb to debug the process running on the chip. Something to keep in mind for the future.

Using st-flash instead of OpenOCD

Build st-flash

# Ubuntu
sudo aptitude install build-essential autoconf

# Mac OS X
brew install libusb

git clone https://github.com/texane/stlink
cd stlink
./autogen.sh
./configure
make
cd flash
make

sudo cp ./st-flash ~/bin

Uploading using st-flash

st-flash write build/ch.bin 0x08000000

Relevant URLs

arm-development's People

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.