pylover / stm32l0-helloworld

STM32L071CZT6 boilerplate for Ubuntu.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

STM32L0 HelloWorld!

This project is configured for target device: STM32L071CZT6. Use STMCubeIDE to generate startup assembly: stm32l0xxx.s and flash linker script: stm32l0xxx_flash.ld for other devices.

Preparation

sudo apt-get install \
  libncurses-dev \
  libusb-dev \
  libncursesw5 \
  openocd

STLink programmer utilities

git clone git@github.com:pylover/stlink.git
cd stlink
make clean
make release
sudo make install
sudo ldconfig
STlink v2 firmware version

Update your programmer's firmware using CubeProgrammer if required:

st-info --probe
Found 1 stlink programmers
  version:    V2J42S7
  serial:     030030000800003550334D4E
  flash:      196608 (pagesize: 128)
  sram:       20480
  chipid:     0x447
  dev-type:   STM32L0xxx_Cat_5

Toolchain

Install the latest ARM toolchain.

./scripts/install-toolchain.sh

Reboot the system, then:

Build & Debug

./scripts/rollup.sh
cd build
make clean all
make flash
Analyze *.elf file
make elfread
make elfsize

# Run both above commands.
make analyze
On-chip debug using GDB

First, start OpenOCD server:

make openocd

Then, run make gdb in another terminal.

make gdb

Or, run make debug to automate the above two commands:

make debug

Lint

pip install prettyc
cd build
make lint

About

STM32L071CZT6 boilerplate for Ubuntu.

License:GNU General Public License v3.0


Languages

Language:C 99.5%Language:Assembly 0.3%Language:CMake 0.1%Language:Shell 0.1%