Introduction: STM32F103C8X Minimal Development Board + ST Link V2 + STM Workbench

How to get start with STM32? You have seen tutorial around "how to program STM32 using Arduino", but in this tutorial I am going to setup environment on STM Test bench for native development of STM32 microcontroller

Step 1: Development Board

STM32F103C8x is powerful ARM Cortex M3 microcontroller ( Datasheet). Having 64k of flash memmory and 20k of SRAM. it is suitable for small form factor devices. the development board I used here can be buy from ebay.in.

http://www.ebay.in/itm/STM32F103C8T6-ARM-STM32-Minimum-System-Development-Board-Module-/132081076420


Step 2: ST Link V2

This programmer is clone of original ST link V2. It can support JTAG and SWD protocol for debugging. Its is very cheap programmer which can program STM8 and STM32 both microcontrollers. her also given pin names we are going to use 5 pins .

3.3v

Reset

DIO

CLK

GND

Drivers for windows

Download and install this drivers

Step 3: Hardware Connections

Connect board and ST link in following manner.

STLINK------>STM32 Board

pin1(Reset)---(R)

pin2(3.3v)---(3.3v)

pin4(T_SWCLK)--(DCLK)

pin6(T_SWDIO)--(DIO)

pin7(GND)----(GND)

Step 4: Install STM Workbench for Windows

Downlaod STM work bench from official website of ST semiconductors. It is free IDE for STM development.You need to sign up for download it.

STM work bench

Install it.


Step 5: Create Blinky Project to Blink LED

On board PC13 Pin is connected to LED we are goinig to blink it

Create new Project as shown in images

Step 6: Configure Project Path

navigate as shown in image.

It is important to configure minimum required path for project to avoid conflict with other utilities from GCC compilers.

I used this path variable

C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.13.1.201701261202\tools\compiler\bin;C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.arm-none.win32_1.13.1.201701261202\tools\make;C:/Program Files/Java/jdk1.8.0_77/bin/../jre/bin/server;C:/Program Files/Java/jdk1.8.0_77/bin/../jre/bin;C:/Program Files/Java/jdk1.8.0_77/bin/../jre/lib/amd64;C:\Windows\system32;C:\Program Files\Java\jdk1.8.0_77\bin;C:\Ac6\SystemWorkbench

Step 7: Write Main.c Code

Copy past following code into src>main.c

Download This Program And Build using build button

Step 8: Debugging

For load .elf file in controller you have to configure debugger. configuration shown in image

Step 9: Execution of Progrma

after successful open debug made. click on Play button and see break point hit. and observe the led on board star blink

Comments

author
boingx (author)2017-02-23

I really enjoyed following along on your Instructable. I ran into a problem using Workbench when I tried to go into debug. It gave an error and would not reset or transfer the program to the board. I could transfer the bin file using the ST-LINK utility successfully.

I have used your program in the free version of Atollic TrueSTUDIO without any issues, but would like to get Workbench working.

Have you or anyone by chance run into this type of problem? I saw on the web where it was suggested to change the reset line in the .cfg file. It didn't work for me.

author
dkhairnar (author)boingx2017-02-27

boingx can you post your debug log. It would help to track problem

author
DavidV12 (author)2017-02-18

Note that nearly all (every one of the 20+ I own) C8 chips actually have 128k of flash and can be programmed as a CB.

author
dkhairnar made it! (author)DavidV122017-02-20

I verified memory using STM32 ST link utility it shows 64k of memory. If you have reference then please reply

Untitled.jpg
author
DavidV12 (author)dkhairnar2017-02-20

The stm32flash serial flash utility will let you access the full range if present.

author
dkhairnar (author)DavidV122017-02-19

Thank you David for your reply.The value I picked up from datasheet, is the minimum value of memory size i.e. – 64 or 128 Kbytes of Flash memory. I will verify memory map on hardware.

author
MarcoV37 (author)2017-02-18

Do you have a link to that tutorial for the stm32 with Arduino?

author
dkhairnar (author)MarcoV372017-02-19

no I dont have any link but I can create it.

About This Instructable

3,298views

23favorites

More by dkhairnar:Start Programming ESP3212 With Arduino IDEArduino 2.4 TFT Touch Screen LCD InterfaceGesture Controlled HID Mouse Using STM32 and Accelerometer
Add instructable to: