Saturday 14 February 2015

STM32FxCxT6 Board V4.02 programming

When I decided to have some experiment with STM32 boards I bought a STM32 board from ebay that is not maple compatible. It is a nice board with a lot of pins, an onboard led and some jumpers. I really want to find a way to use this board. I tried to flash the maple bootloader without success. After some googling I find a good description for STM32F100 MCU at http://www.cs.indiana.edu/~geobrown/book.pdf. This book contains valuable information for Cortex M3 development and I thought F103 is not so different from STM32F100. I follow the books: as the Author wrote I downloaded GNU toolchain (not from sourcery), the STM32 firmware library, and his project template from github: As the STM32F103 MCU has more SRAM I modified the linker script: And I also modified the Makefile.common to point to my GNU ARM installation directory and to my STM32 library directory: TOOLROOT and LIBROOT path. I also defined a 'binary' make option to generate a result.bin file that can be flashed with stm32flash tool. For the referenced board I could not find any proper schematic, so I used a multimeter to find out which pin is connected to onboard blue led. The led is connected to PortC13. My frist project was to blinking that onboard led,so I copied the Demo project and created a Blink project: I modified the main.c: Do not forget to add the following line to Blink project Makefile, after the OBJS= line: To create binary: I am using a cheap USB->serial adapter from eBay to flash the board. The following picture contains all details. I connected only GND, TX, RX pins from the adapter to the board. Be aware that the adapter TXD pin is connected to board's TX1 pin, and RXD pin is connected to board RX1 pin.
To upload the binary, power the board via the USB, connect the adapter and set one of the green jumper to power up the BT0 to 3v3 (move the secound top-left green jumper right with one position, next to the blue wire). Use the stm32flash tool to upload the binary. After upload set the modified jumper to 'normal' position (as you can seen in the picture) and reboot the board. The led should be blinking at the given rate.

2 comments: