ARM Cortex-M3 STM32F103 (GCC TOPPERS/ASP ) http://www.nissin-tech.com info@nissin-tech.com 2009/10/15 copyright@2009 1
STM32F103...3 STM32...4...8 3.1...8 3.2...9 3.3...13 KEIL...19 4.1 KEIL...19 4.2...22 4.3...25 4.4...25 4.5...27 Thumb-2 GCC...29 TOPPERS/ASP...31 6.1 TOPPERS/ASP...31 6.2 TOPPERS/ASP...32 6.3 H-JTAG...34 2
STM32F103 1.8 TFT 160X128 CAN JTAG STM32F103RBT6 miniusb 5V AD 2mm RS232 RTC 24C02 SD LED CPU ARM Cortex-M3 ST STM32F103RBT6( 72MHz,128KB Flash, 20KB SRAM, 2 SPI, 2 I2C, USB2.0, CAN, PWM, 2 12 ADC 16ch 3 USART 3 16, RTC, CAN2.0B, ) RS232 1 USB2.0 device 1 JTAG/ICE CAN2.0B 1 SD AD 3
I2C EEPROM LED 1 2 1 1.8 TFT 160 128 : 110 70(mm) 5VDC 2.1mmφ LED STM32 ( ) ARM ARM ARM (ARM ) ARM 2 ARM ARM STMicroelectronics( ST) STM32 STM32 ARM Cortex-M3 32 ( ) 16 4
STM32 ARM Cortex-M3 32 STM32 Cortex-M3 Thum-2 STM32 32K 128K 6K 20K RAM 16 32 STM32F103 72MHz RAM 5
32 STM32F103 72MHz 32 16 6
7
3.1 AD STM32F103 ADC TFT AD TFT 8
AD PA0, PA1, PA2 AD stm32example.rar STM32F103 3.2 Flash_Loader_Demonstrator_V1.3_Setup.exe STM32 Flash Flash_Loader_Demonstrator_V1.3_Setup.exe 9
Next Yes 10
Next 11
12
Finish 3.3 STM32F103 BOOT0 RS232 13
Windows STMicroelectronics Flash Loader Demonstrator Flash Loader Demo Next 14
Next Next 15
*.HEX *.HEX Next 16
Finish Example/1.1 - GPIO_OUT/output/GPIO_OUT.hex Example/2.1 - PWM/output/PWM.hex Example/3.1 - LCD/output/LCD.hex Example/3.2 LCD_CN/output/LCD.hex Example/3.3 - LCD_BMP/Output/LCD_BMP.hex Example/4.1 - GPIO_IN/Output/GPIO_IN.hex Example/4.2 - GameSnake/Output/GameSnake.hex Example/5.1 - ADC/Output/ADC.hex Example/6.1 - PWM_Sound/Output/PWM_Sound.hex Example/7.1 - I2C/Output/I2C.hex Example/8.1 - USBMem/Output/USBmem.hex Example/9.1 - SDcard/Output/SDcard.hex Example/10.1 - UART/Output/USART_Pol.hex( ) Example/10.1 - UART/Output/USART_Pol.hex( ) Example/11.1 - CAN/Output/CAN.hex Example/12.1 - Timer/Output/Timer.hex Example/13.1 - RTC/Output/RTC.hex 17
Example/14.1 - Exti/Output/Exti.hex Example/15.1 - Tamper/Output/Tamper.hex Example/16.1 - IWDG/Output/IWDG.hex Example/17.1 SVC/Output/SVC.hex Example/18.1 - ucos/app/output/ucosii.hex uc/os II OS uc/os II LED 18
KEIL MDK315B.exe KEIL rlarm313a.exe KEIL 4.1 KEIL MDK315B.exe KEIL3.15 Next I accept the terms of the license agreement Next 19
20
Finish 21
4.2 rlarm313a.exe KEIL Next I accept the terms of the license agreement Next 22
23
Finish 24
4.3 Keil uvision3 Keil Keil File License Management Keil Keil http://axe-inc.co.jp/ 4.4 Example/5.1 - ADC/ ADC.Uv2.Uv2 25
Options for Target 26
Output HEX OK Rebuild all target files Output ADC.hex HEX STM32F103 4.5 STM32F103 Flash 128KB 1,2 27
Drivers/ GB1616.h GB1616.h struct typfnt_gb16 { unsigned char Index[3]; char Msk[32]; }; // JIS // const struct typfnt_gb16 codegb_16[] = { " ", 0x10,0x20,0x11,0x20,0x11,0x20,0xfd,0x20,0x13,0xfe,0x1a,0x20,0x34,0x20,0x30,0x20, 0x37,0xff,0x50,0xa8,0x50,0xa8,0x91,0xac,0x11,0x24,0x13,0x26,0x16,0x23,0x10,0x20, " ", 0x00,0x00,0x1f,0xf8,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x1f,0xf8, 0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x10,0x08,0x1f,0xf8,0x00,0x00, " ", 0x08,0x02,0x08,0x0e,0xff,0x78,0x42,0x40,0x66,0x40,0x24,0x7f,0xff,0x44,0x08,0x44, 0x08,0x44,0xff,0x44,0x28,0x44,0x2c,0x44,0x6a,0xc4,0x48,0x84,0xc9,0x84,0x08,0x04, " ", 0x00,0x00,0x00,0x00,0x3f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,0x00,0x80, 0x00,0x80,0x00,0x C 80,0x01,0x80,0x01,0x00,0x03,0x00,0x06,0x00,0x1c,0x00,0x00,0x00, " ", 0x01,0x00,0x01,0x00,0x01,0x00,0x03,0xf8,0x02,0x08,0x06,0x08,0x0c,0x18,0x18,0x10, 0x00,0x30,0x00,0x20,0x00,0x60,0x00,0xc0, 0x01,0x80,0x07,0x00,0x1c,0x00,0x00,0x00, " ", 0x00,0x00,0x00,0 x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, " ", 0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x3f,0xfc,0x01,0x04,0x01,0x04,0x03,0x04, 0x02,0x04,0x02,0x04,0x06,0x04,0x04,0x0c,0x0c,0x08,0x18,0x08,0x30,0x78,0x00,0x00, STARTCHAR 01-38-92 ENCODING 18044 SWIDTH 1024 0 DWIDTH 16 0 BBX 16 16 0-2 BITMAP JIS 0000 1ff8 1008 1008 1008 1008 1008 1ff8 1008 1008 1008 1008 1008 1008 1ff8 16X16 0000 ENDCHAR jiskan16-2004-1.bdf.gz 1,2 JIS C GB1616.h 28
#include "GB1616.h" //16*16 void PutGB1616(unsigned short x, unsigned short y, unsigned char c[2], unsigned int f,unsigned int b){ unsigned int i,j,k; LCD_SetArea(x, y, x+16-1, y+16-1); LCD_Inst(0x2C); LCD_CS(0); LCD_RD(1); LCD_RS(1); for (k=0;k<22;k++) { if ((codegb_16[k].index[0]==c[0])&&(codegb_16[k].index[1]==c[1])){ for(i=0;i<32;i++) { unsigned short m=codegb_16[k].msk[i]; for(j=0;j<8;j++) { TFT TFT018.c Thumb-2 GCC KEIL 16K Interface 2008 11 Thumb-2 GCC Cygwin Cygwin http://www.cygwin.com/setup.exe Devel GNU Interface Web http://www.cqpub.co.jp/interface/download/contents.htm /usr/local $ cd /usr/local $ tar jxvf arm-tools-new-20080625.tar.bz2 Web GCC GDB GDB gdb-stub_20080830.tar.bz2 GCC gcc_sample_20080830.tar.bz2 29
gcc_example_for_stm32f103.rar STM32F103 gcc_example_for_stm32f103/cortex_m3 Interface 12MHz CPU 72MHz LED gcc_example_for_stm32f103/adc-lcd Keil 5.1 - ADC $ cd gcc_example_for_stm32f103/adc-lcd $ make *.HEX STM32F103 AD LED 115200 / LED LED AD 0 LED 1 LED 30
TOPPERS/ASP TOPPERS/ASP http://www.toppers.jp/asp-kernel.html ASP TOPPERS TOPPERS ASP Advanced Standard Profile ITRON4.0 TOPPERS/JSP 6.1 TOPPERS/ASP STM32F103 asp_nissin_starm_gcc-20090322.tar.gz CQ-STARM CQ asp_cq_starm_gcc-20081003.tar.gz STM32F103 CQ-STARM 12MHz LED (PB5) $ tar zxvf asp_nissin_starm_gcc-20090322.tar.gz asp/nissin_stm32f103/asp.hex TOPPERS/ASP asp.hex STM32F103 31
115200 / STM32 System memory USART Flash Loader Demonstrator ROM TOPPERS/ASP ROM JTAG 6.2 TOPPERS/ASP http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite GCC 4.3.2 Cygwin arm-2008q3-66-arm-none-eabi-i686-mingw32.tar.bz2 GNU/Linux arm-2008q3-66-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 $ cd / $ tar jxvf arm-2008q3-66-arm-none-eabi-i686-mingw32.tar.bz2 ~/.bashrc 32
export PATH=$PATH:/arm-2008q3/bin cfg cfg makedepend Makefile.depend make $ cd cfg $ make depend $ make ASP ASP NISSIN_STM32F103 $ mkdir NISSIN_STM32F103 $ cd NISSIN_STM32F103 $ perl../configure -T nissin_starm_gcc Makefile sample1.cfg sample1.h sample1.c Makefile $(OBJCOPY) -O ihex $(OBJFILE) $(OBJNAME).hex Makefile HEX make depend Makefile.depend make asp.srec asp.hex 33
$ make depend $ make sample1.h sample1.c sample1.cfg ASP sample1.c doc/user.txt 6.3 H-JTAG http://www.hjtag.com H-JTAG a. RDI 1.5.0 & 1.5.1 ; b. ARM7 & Contex-M3 & ARM9 ARM9E-S ARM9EJ-S ; c. thumb & thumb 2 & arm ; d. little-endian & big-endian; e. semihosting; f. WINDOWS 9.X/NT/2000/XP; g. flash H-JTAG LTP H-JTAG V0.9.1.EXE 34
Next Next 35
36
Finish 37
H-JTAG JTAG STM32F103 STM32F103 LPT JTAG LED H-JTAG "Ok" 38
Settings LPT Jtag Setting OK 39
CORTEX-M3 Settings TAP Configuration 40
Flasher Auto Download 41
Flasher Start H-Flasher Flash STM32F103XB 42
*.hex Intel Hex Format *.hex Close 43