Thursday, 28 April 2016

Blink LED on Arm Cortex M3 STM32F103c8t6 Dev board + ST-LINK V2



SOFTWARE SETUP

ARDUINO

1. Download and install the Arduino  from the Arduino website 
2. Download the zip of the additional files  from Roger Clark's GitHub repository    https://github.com/rogerclarkmelbourne/Arduino_STM32
3. Assuming you are using Windows .. Copy the files from the zip to My Documents\Arduino\hardware so     that inside the hardware folder there is the Arduino_STM32 folder.
4. Go Arduino Menu then Boards Manager and install Arduino SAM Boards



5. Restart the Arduino IDE.
6. Select the board settings from the Arduino IDE Menu as follows:



























ST-LINK V2

1. Download and install the st-link utility v 3.8.0 and driver from ST.com website.
2. Update the firmware to the latest from the utility menu.




HARDWARE SETUP




hook it up to the STM32 board using jumper wires connected from the ST-Link to the JTAG socket using the following pinout.

ST-Link      <>     STM32

 GND           -> GND (4) [JTAG]
 3V3/VDD  ->  3V3  [BOARD]
 CLK           -> SWCLK (9) [JTAG]
 IO/SWD     -> SWDIO (7) [JTAG]


LED is connected between Board Pin PC13 and GND  in series with 330 Ω resistor.



ARDUINO CODE


#define LED PC13

void setup() {
  pinMode(LED, OUTPUT);
}

void loop() {
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

No comments:

Post a Comment