cancel
Showing results for 
Search instead for 
Did you mean: 

I'm about to start embedded programming and have an STM32f103C8T6 ARM-Coretex-M3 board to get started with. I'm also a C++ programmer and want to use that language to program a project to blink the LED of that board as my first embedded task.

Adev.1
Associate III

Hi all,

 Apart from the board and two machines (Windows and Linux) I have also an MB-102 breadboard and a bunch of cables in hands. 

Firstly I wanted to make use of this tutorial for the task above but it's dealing with NUCLEO-L476RG that I lack for the time being. 

As the subject of the thread reveals, I'm an absolute beginner and need a step-by-step tutorial on how to start and go forward until the project is done and the board's LED is blinking. What good resource/tutorial do you suggest that I follow, please?

The other question is, except for that STM board, breadboard and the cables, what else should I purchase to be ready for the project, please?

Thanks in advance.

3 REPLIES 3
salar1991
Associate II

you also need a programmer like the st link for programming your code and the link you provided is ok for your board you just need to toggle pin c.13 if you are using the blue pill stm32f103c8t6 header board you can use the reference manual of stm32f103 and this site has pretty good examples https://davidkebo.com/

I didn't find the step-by-step example of blinking an LED for the STM board I have on the webpage you suggested unfortunately.

As for reference manual, I downloaded it. The number of pages is more than one thousand! How a beginner of embedded programming is expected to read and understand such a huge book just to get started learning and doing a project on a board!? That's too complicated for me, at least for the time being. :(

salar1991
Associate II

you don't have to read it all just read the general-purpose input-output section on page 170 I agree it is a bit confusing at first. but as you write codes and practice it becomes easier you can use this site for Keil configuration http://www.ocfreaks.com/create-new-stm32-project-keil-uvision-5-tutorial/#:~:text=Open%20the%20Keil%20IDE%2C%20under,desired%20project%20name%20and%20save.

here is a simple code for LED blink

#include "stm32f10x.h"
 
void Delay (uint32_t Time);
 
///////////////////////////////////
 
 
volatile uint32_t msTicks;
// the interrupt handler for the systick module 
void SysTick_Handler(void) {
	msTicks++;
}
void Delay_ms (uint32_t dlyTicks) {
	uint32_t curTicks;
	curTicks = msTicks;
	while ((msTicks - curTicks)< dlyTicks);
}
 
int main ()
{
	 SysTick_Config(SystemCoreClock/1000); // setup systick timer for 1ms interrupts
RCC->APB2ENR |=  (1<<3);/* Enable GPIOB clock*/
GPIOB->CRL &=~0xF  ;
  GPIOB->CRL |=0x3  ;		      // PB0  output
 
	
	
	
while(1)
	
{
 
 
GPIOB->BSRR=0x01;
Delay_ms(1000);
GPIOB->BSRR=(0x1<<16);	
Delay_ms(1000);	
}
 
 
}