How to program stm32 development board mini - Page 1
Forum section: electronics / general

author: powermosfet
author_rank: Newbie
timestamp: January 19, 2014, 06:57:52 pm
content: I'm a total beginner with programming ARM microcontrollers, but I do have experience with AVR and PIC microcontrollers.A few days back I have purchased a STM32F103VET6 development mini + 2.4 TFT lcd board from ebay. I'm now trying to programming this board but I dont know where to start. I have also received a cd which contains some datasheets and some documents (most in chinese).Could someone tell me how to start? or have some source samples... (in english).I have already installed Keil uVision4. I also have a J-link debugger.

author: dannyf
author_rank: Super Contributor
timestamp: January 19, 2014, 08:15:04 pm
content: Usually you start with manuals: for your board, you chip, your compiler, your library if you use one.

author: Bored@Work
author_rank: Super Contributor
timestamp: January 19, 2014, 08:16:58 pm
content: Frankly, I would send it back. The first problem is the lack of documentation (in English), the second problem is the software it comes with is likely all stolen.But if you really want to use it, the first thing you need to somehow figure out is how it is powered.The second thing is if it has an integrated programmer, or if it needs an external programmer. Then you need to figure out which type of programmer it is.The third thing you need to figure out is the schematics, especially how the display and other periphery are connected.The forth thing you need to figure out is the type of periphery, i.e. how to the periphery ICs need to be controlled.If you are lucky there is something on the CD that comes with it telling you all this. If you are not so lucky things are missing, or, also a common game the manufacturers of these things like to play, the information is just wrong. Or you might be lucky to find something if you google. Otherwise you might have to reverse-engineer the board.

author: andyturk
author_rank: Frequent Contributor
timestamp: January 19, 2014, 08:24:30 pm
content: First thing is to throw your Chinese eval board in a drawer and forget about it (for now).Get yourself one of ST's own evaluation boards with a built-in programmer. They can be had for less than $10 (e.g.,http://www.st.com/web/en/catalog/tools/PF259096).Your first goal is to get an LED to blink. It's better if you write the code yourself, but even copying someone else's blink will run you through the paces of compiling, linking, and flashing the board.

author: iabdalkader
author_rank: Newbie
timestamp: January 20, 2014, 12:30:43 pm
content: I assume you mean this one ?I haven't looked at the schematics, but you could try dfu-util or st-util to program the board via USB, remove JP1 first, reset and connect USB. Other than that, you will need a JTAG (or SWD) debugger.

author: dannyf
author_rank: Super Contributor
timestamp: January 20, 2014, 01:44:09 pm
content: If it has jtag, you can program it via jlink or stlink, it even the stlink-ob on those discovery boards.it looks like a good board.

author: neslekkim
author_rank: Super Contributor
timestamp: January 24, 2014, 02:42:09 pm
content: check some of the videos from this guy, maybe there are similarities, i bought the card he useshttps://www.youtube.com/user/mattprattau/videos

author: powermosfet
author_rank: Newbie
timestamp: January 26, 2014, 10:54:58 am
content: I have managed to blink a led at port (GPIOB5), thank you for your input guys.Code:#define led1GPIO_Pin_5#define Led1OnGPIO_SetBits(GPIOB, led1)#define Led1OffGPIO_ResetBits(GPIOB, led1)int main(void){int x = 0;SystemInit();RCC_Configuration();GPIO_Configuration();while (1){for (x = 0; x < 10; x++){Led1On;Delay(10);Led1Off;Delay(50);}Delay(500);}}void RCC_Configuration(void){RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);}void GPIO_Configuration(void){GPIO_InitTypeDef GPIO_InitStructure;GPIO_InitStructure.GPIO_Pin = led1;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOB, &GPIO_InitStructure);}

author: dannyf
author_rank: Super Contributor
timestamp: January 26, 2014, 12:14:50 pm
content: SystemInit() is called just before main() is called in the start-up sequence. So there is no reason to call SystemInit() from within main() again.