Difference between revisions of "GCC Toolchain for CoreSTM32"
From Microduino Wiki
(→Using IDE(Integrated Development Environment)) |
(→Setting up Eclipse) |
||
Line 36: | Line 36: | ||
* Click Help->Install New Software | * Click Help->Install New Software | ||
[[File:Eclipse_for_STM32_01.png|600px|thumb|center|Install GNU ARM plugin for Eclipse]] | [[File:Eclipse_for_STM32_01.png|600px|thumb|center|Install GNU ARM plugin for Eclipse]] | ||
+ | |||
+ | * Follow the instructions on http://gnuarmeclipse.livius.net/blog/plugins-install/ | ||
= Testing Program: Blink = | = Testing Program: Blink = |
Revision as of 15:33, 16 July 2014
ContentsWhy GCC toolchain
Setting up GCC toolchainYou have two choices:
OR
It is said that Sourcery CodeBench Lite has better performance than other compilers, but we haven't made any test. Using IDE(Integrated Development Environment)I prefer Eclipse, but you have multiple choices, like
Setting up Eclipse
Testing Program: Blink#include "stm32f10x.h"
#include "stm32f10x_gpio.h"
#include "stm32f10x_rcc.h"
int main(void) {
int i;
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
while (1) {
GPIO_SetBits(GPIOA, GPIO_Pin_8);
/* delay */
for (i = 0; i < 0x1000000; i++)
;
GPIO_ResetBits(GPIOA, GPIO_Pin_8);
/* delay */
for (i = 0; i < 0x1000000; i++)
;
}
} |