The Artima Developer Community
Sponsored Link

Python Buzz Forum
Program 'Hello World' to an STM32F103C8, without an ST-Link

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Aaron Brady

Posts: 576
Nickname: insommeuk
Registered: Aug, 2003

Aaron Brady is lead developer for Crestsource
Program 'Hello World' to an STM32F103C8, without an ST-Link Posted: Jul 2, 2016 9:05 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Aaron Brady.
Original Post: Program 'Hello World' to an STM32F103C8, without an ST-Link
Feed Title: insom.me.uk
Feed URL: http://feeds2.feedburner.com/insommeuk
Feed Description: Posts related to using Python. Some tricks and tips, observations, hacks, and the Brand New Things.
Latest Python Buzz Posts
Latest Python Buzz Posts by Aaron Brady
Latest Posts From insom.me.uk

Advertisement

In May, Kevin Cuzner posted instructions on bootstrapping a Cortex M3 microcontroller without a dev board. It hit Hackaday and grabbed my attention because I happened to have a couple of those chips on boards I’d been using to play with Forth.

He’s done the hard work of carving the neccessary include files out of ST’s SDK, and wraps the whole thing up in an easy to use Makefile. Great! I made one little tweak (for Ubuntu Xenial support), and it all builds smoothly.

He’s included an openocd.cfg config file, but I don’t have an ST-Link device to load the output with. Luckily, you can kind of smush the instructions Jean-Claude Wippler put together to upload your program.

Grab stm32loader from GitHub. Put BOOT0 in the 1 position, and BOOT1 in the 0 position. Reset your board and run the following to upload the .bin that make generated to 0x80000000.

lappy:~/Repo/stm32f103c8-blink aaron$ python stm32loader.py -a 0x08000000 \
    -g 0x08000000 -p /dev/ttyUSB0 -e -w bin/blink.bin
Bootloader version 22
Chip id: 0x410 (STM32 Medium-density)
Write 256 bytes at 0x8000000
Write 256 bytes at 0x8000100
Write 256 bytes at 0x8000200
Write 256 bytes at 0x8000300
Write 256 bytes at 0x8000400
Write 256 bytes at 0x8000500
Write 256 bytes at 0x8000600
Write 256 bytes at 0x8000700
Write 256 bytes at 0x8000800
Write 256 bytes at 0x8000900
Write 256 bytes at 0x8000A00
Write 256 bytes at 0x8000B00

And you’re done! I can confirm that I have a blinking LED on port PB0.

Read: Program 'Hello World' to an STM32F103C8, without an ST-Link

Topic: On cookie consent Previous Topic   Next Topic Topic: From the Archives: Fake load to keep my Xiaomi battery awake

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use