Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

The official STMicroelectronics Arduino core
ProudPagan
Posts: 3
Joined: Wed Feb 15, 2017 4:47 am

Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by ProudPagan » Thu Feb 16, 2017 5:16 am

Hi All,

I have used the Arduino framework+IDE for AVR and ESP8266, but can't get a blinky to work on the STM32 Value Line Discovery board STM32F100RB.

I have 2017.1.20 version of STM32F1xx Core installed. I see the code correctly compiled, linked and uploaded to the board:

Code: Select all

STM32 ST-LINK CLI v2.1.0
STM32 ST-LINK Command Line Interface

ST-LINK SN : ST-Link/V1 on E:
ST-LINK Firmware version : V1J11S0 (Need Update)
Old ST-LINK firmware detected!
Please upgrade it from ST-LINK->'Firmware update' menu.
Connected via SWD.
Connection mode : Normal.
Device ID:0x420 
Device flash Size : 128 Kbytes
Device family :STM32F100xx Low/Medium density Value Line

Loading file...
Flash Programming:
  File : C:\Temp\arduino_build_193593\sketch_feb14a.ino.bin
  Address : 0x08000000
Flash memory programming...
±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±± 0%
 0%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 45%ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ 90%ÛÛÛÛÛ 100%
Flash memory programmed in 1s and 388ms.
Programming Complete.

MCU Reset.

Application started.

But I don't see the LED flashing. I am using the on board LED connected to GPIO port PC9.

This is the code:

Code: Select all

const int MYPIN = PC9;


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(MYPIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  
  digitalWrite(MYPIN  , HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1500);                       // wait for a second
  digitalWrite(MYPIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1500);                       // wait for a second

}
Any help would be greatly appreciated!

Thanks

PP

User avatar
Pito
Posts: 1738
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by Pito » Sat Feb 18, 2017 8:24 pm

Did you compile for "Upload method STLink" ?
Pukao Hats Cleaning Services Ltd.

zmemw16
Posts: 1680
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by zmemw16 » Sun Feb 19, 2017 12:36 am

tongue in cheek, maybe use the classic G Brown STM32 book for guidance.
i do know his sources and the SPL do compile and work on Linux. nod nod ;) ;)

stephen

ProudPagan
Posts: 3
Joined: Wed Feb 15, 2017 4:47 am

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by ProudPagan » Tue Feb 21, 2017 8:29 am

Pito wrote:Did you compile for "Upload method STLink" ?
Yes, I see only STLink as the upload method -- and I used that. I see lights on the board flashing for a few seconds, so I think upload
is done correctly.


Thanks for all help.

--PP

nikosx
Posts: 25
Joined: Sun May 07, 2017 4:33 pm

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by nikosx » Sun May 07, 2017 4:52 pm

Did you get the LEDS blink ? Had the same problem....

dannyf
Posts: 228
Joined: Wed May 11, 2016 4:29 pm

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by dannyf » Sun Jun 04, 2017 10:59 am

Any help would be greatly appreciated!
step through your code and see what changes to the gpio registers. pay particular attention to CR1/CR2.

KHODIDAS11
Posts: 15
Joined: Sun Aug 20, 2017 4:35 pm

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by KHODIDAS11 » Fri Jan 26, 2018 9:51 am

I go t working, as i have selected board STM32VLD TO FLASH in ide. (borad has STM32F100RB and STM32F103 as stlink. it is a value line discovery kit from ST)

got function of blinky, pwm, and serial.

I find problem in serial, Serial pin is PA9-TX and PA10-Rx. I have changed crystal in Boards.txt as 10Mhz as mine board is having it.

I observed that on baud set 300 i am receiving data on 300 seems fin
on baud rate 600 i am receiving on 900
on baud rate 1200 i am receiving on 1800

why this happens,

if anyone can help

zmemw16
Posts: 1680
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by zmemw16 » Fri Jan 26, 2018 11:27 am

try blinking the led at 30secs on and off and use a stopwatch ?

what was the crystal originally fitted ?

srp

KHODIDAS11
Posts: 15
Joined: Sun Aug 20, 2017 4:35 pm

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by KHODIDAS11 » Fri Jan 26, 2018 11:47 am

I have checked it has to 8 Mhz, but i want to use 12Mhz and i FIxed it. Due to this probelm is occuring with baud rate.

Now , I wnat to change crystal setting in arduino ide from 8 to 12Mhz, how to do it?

zmemw16
Posts: 1680
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Getting Blinky to work on STM32 Value line Discovery board STM32F100RB

Post by zmemw16 » Fri Jan 26, 2018 12:43 pm

you changed it from 8 to 12 and your serial has gone from 1200 to 1800, seems logical
apart from which why would you ?

fire up cubemx, set chip as stm32f100xx or whatever it is then play with the rcc peripheral to set crystal sources, then play in the clock configuration panel and see if you can actually get what you want.
if you can, then generate the code, check the clock setup for values, figure out where in the core to change.

no doubt there's a better way

you might also do a forum search before all that above as i'm pretty sure 12MHz has come up before
stephen

Post Reply