├── .gitignore ├── LICENSE ├── README.md ├── res └── bootloader.png └── src ├── Bin ├── axftobin.bat └── hextobin.bat ├── Driver ├── sys_timer.c ├── sys_timer.h ├── usart.c └── usart.h ├── Firmware └── STM3210B-EVAL.bin ├── Iap ├── common.c ├── common.h ├── download.c ├── stm32f10x_conf.h ├── upload.c ├── ymodem.c ├── ymodem.h └── ymodem_old.c ├── Libraries ├── CMSIS │ ├── CM3 │ │ ├── CoreSupport │ │ │ ├── core_cm3.c │ │ │ └── core_cm3.h │ │ └── DeviceSupport │ │ │ └── ST │ │ │ └── STM32F10x │ │ │ ├── Release_Notes.html │ │ │ ├── startup │ │ │ ├── TrueSTUDIO │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ ├── arm │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ ├── gcc_ride7 │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ └── iar │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ ├── stm32f10x.h │ │ │ ├── system_stm32f10x.c │ │ │ └── system_stm32f10x.h │ ├── CMSIS debug support.htm │ ├── CMSIS_changes.htm │ ├── Documentation │ │ └── CMSIS_Core.htm │ └── License.doc └── STM32F10x_StdPeriph_Driver │ ├── Release_Notes.html │ ├── inc │ ├── misc.h │ ├── stm32f10x_adc.h │ ├── stm32f10x_bkp.h │ ├── stm32f10x_can.h │ ├── stm32f10x_cec.h │ ├── stm32f10x_crc.h │ ├── stm32f10x_dac.h │ ├── stm32f10x_dbgmcu.h │ ├── stm32f10x_dma.h │ ├── stm32f10x_exti.h │ ├── stm32f10x_flash.h │ ├── stm32f10x_fsmc.h │ ├── stm32f10x_gpio.h │ ├── stm32f10x_i2c.h │ ├── stm32f10x_iwdg.h │ ├── stm32f10x_pwr.h │ ├── stm32f10x_rcc.h │ ├── stm32f10x_rtc.h │ ├── stm32f10x_sdio.h │ ├── stm32f10x_spi.h │ ├── stm32f10x_tim.h │ ├── stm32f10x_usart.h │ └── stm32f10x_wwdg.h │ └── src │ ├── misc.c │ ├── stm32f10x_adc.c │ ├── stm32f10x_bkp.c │ ├── stm32f10x_can.c │ ├── stm32f10x_cec.c │ ├── stm32f10x_crc.c │ ├── stm32f10x_dac.c │ ├── stm32f10x_dbgmcu.c │ ├── stm32f10x_dma.c │ ├── stm32f10x_exti.c │ ├── stm32f10x_flash.c │ ├── stm32f10x_fsmc.c │ ├── stm32f10x_gpio.c │ ├── stm32f10x_i2c.c │ ├── stm32f10x_iwdg.c │ ├── stm32f10x_pwr.c │ ├── stm32f10x_rcc.c │ ├── stm32f10x_rtc.c │ ├── stm32f10x_sdio.c │ ├── stm32f10x_spi.c │ ├── stm32f10x_tim.c │ ├── stm32f10x_usart.c │ └── stm32f10x_wwdg.c ├── Project └── STM32F10x_StdPeriph_Template │ ├── EWARM │ ├── Project.ewd │ ├── Project.ewp │ ├── Project.eww │ ├── readme.txt │ ├── stm32f10x_flash.icf │ ├── stm32f10x_flash_extsram.icf │ ├── stm32f10x_nor.icf │ └── stm32f10x_ram.icf │ ├── HiTOP │ ├── STM32100B-EVAL │ │ ├── Project.htp │ │ ├── Settings │ │ │ ├── StartupScript.scr │ │ │ ├── arm_arch.lsl │ │ │ ├── link.lnk │ │ │ ├── reset_appl.scr │ │ │ ├── reset_go_main.scr │ │ │ └── stm32f10x_MD_VL.lsl │ │ ├── cstart_thumb2.asm │ │ └── readme.txt │ ├── STM32100E-EVAL │ │ ├── Project.htp │ │ ├── Settings │ │ │ ├── StartupScript.scr │ │ │ ├── arm_arch.lsl │ │ │ ├── link.lnk │ │ │ ├── link_extsram.lnk │ │ │ ├── reset_appl.scr │ │ │ ├── reset_go_main.scr │ │ │ ├── stm32f10x_hd_vl.lsl │ │ │ └── stm32f10x_hd_vl_extsram.lsl │ │ ├── cstart_thumb2.asm │ │ ├── readme.txt │ │ └── setstack.asm │ ├── STM3210B-EVAL │ │ ├── Project.htp │ │ ├── Settings │ │ │ ├── STM32F10x_md.lsl │ │ │ ├── StartupScript.scr │ │ │ ├── arm_arch.lsl │ │ │ ├── link.lnk │ │ │ ├── reset_appl.scr │ │ │ └── reset_go_main.scr │ │ ├── cstart_thumb2.asm │ │ └── readme.txt │ ├── STM3210C-EVAL │ │ ├── Project.htp │ │ ├── Settings │ │ │ ├── STM32F10x_cl.lsl │ │ │ ├── StartupScript.scr │ │ │ ├── arm_arch.lsl │ │ │ ├── link.lnk │ │ │ ├── reset_appl.scr │ │ │ └── reset_go_main.scr │ │ ├── cstart_thumb2.asm │ │ └── readme.txt │ ├── STM3210E-EVAL │ │ ├── Project.htp │ │ ├── Settings │ │ │ ├── STM32F10x_extsram.lsl │ │ │ ├── STM32F10x_hd.lsl │ │ │ ├── STM32F10xnor.lsl │ │ │ ├── StartupScript.scr │ │ │ ├── arm_arch.lsl │ │ │ ├── flash_nor.scr │ │ │ ├── link.lnk │ │ │ ├── linkextsram.lnk │ │ │ ├── linknor.lnk │ │ │ ├── reset_appl.scr │ │ │ └── reset_go_main.scr │ │ ├── cstart_thumb2.asm │ │ ├── readme.txt │ │ └── setstack.asm │ └── STM3210E-EVAL_XL │ │ ├── Project.htp │ │ ├── Settings │ │ ├── STM32F10x_XL.lsl │ │ ├── STM32F10x_xl_extsram.lsl │ │ ├── StartupScript.scr │ │ ├── arm_arch.lsl │ │ ├── link.lnk │ │ ├── linkextsram.lnk │ │ ├── reset_appl.scr │ │ └── reset_go_main.scr │ │ ├── cstart_thumb2.asm │ │ ├── readme.txt │ │ └── setstack.asm │ ├── MDK-ARM │ ├── DebugConfig │ │ ├── STM32F1X-BOOTLOADER_STM32F103CB_1.0.0.dbgconf │ │ └── STM32F1X-BOOTLOADER_STM32F103VB_1.0.0.dbgconf │ ├── EventRecorderStub.scvd │ ├── Project.uvopt │ ├── Project.uvoptx │ ├── Project.uvprojx │ ├── RTE │ │ └── _STM32F1X-BOOTLOADER │ │ │ └── RTE_Components.h │ ├── note.txt │ ├── readme.txt │ └── script.bat │ ├── RIDE │ ├── Project.rapp │ ├── Project.rprj │ ├── readme.txt │ └── stm32f10x_flash_extsram.ld │ └── TrueSTUDIO │ ├── STM32100B-EVAL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── STM32100E-EVAL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── STM3210B-EVAL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── STM3210C-EVAL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── STM3210E-EVAL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── STM3210E-EVAL_XL │ ├── .cproject │ ├── .project │ ├── .settings │ │ └── com.atollic.truestudio.debug.hardware_device.prefs │ ├── readme.txt │ └── stm32_flash.ld │ ├── note.txt │ └── stm32f10x_flash_extsram.ld ├── Release_Notes.html ├── Scripts ├── copy_firmware.bat ├── create_bin.bat └── createbin.py ├── User ├── Release_Notes.html ├── main.c ├── stm32f10x_conf.h ├── stm32f10x_it.c ├── stm32f10x_it.h └── system_stm32f10x.c ├── _htmresc ├── CMSIS_Logo_Final.jpg └── logo.bmp └── stm32f10x_stdperiph_lib_um.chm /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stm32f10x-bootloader 2 | Bootloader for stm32f10x,IAP by usart3 3 | 4 | ![](/res/bootloader.png) 5 | 6 | If you think this project has helped you, please give me a star, which is the greatest encouragement to me. 7 | 如果你觉得该项目帮助到了你,请给我一颗星星,这是对我最大的鼓励。 8 | -------------------------------------------------------------------------------- /res/bootloader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/res/bootloader.png -------------------------------------------------------------------------------- /src/Bin/axftobin.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | if exist C:\Keil\ARM\BIN40\fromelf.exe ( 4 | if exist .\..\MDK-ARM\STM32100B-EVAL\STM32100B-EVAL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM32100B-EVAL\STM32100B-EVAL.axf" --bin --output ".\STM32100B-EVAL_SysTick.bin") 5 | if exist .\..\MDK-ARM\STM3210C-EVAL\STM3210C-EVAL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM3210C-EVAL\STM3210C-EVAL.axf" --bin --output ".\STM3210C-EVAL_SysTick.bin") 6 | if exist .\..\MDK-ARM\STM3210B-EVAL\STM3210B-EVAL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM3210B-EVAL\STM3210B-EVAL.axf" --bin --output ".\STM3210B-EVAL_SysTick.bin") 7 | if exist .\..\MDK-ARM\STM3210E-EVAL\STM3210E-EVAL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM3210E-EVAL\STM3210E-EVAL.axf" --bin --output ".\STM3210E-EVAL_SysTick.bin") 8 | if exist .\..\MDK-ARM\STM3210E-EVAL_XL\STM3210E-EVAL_XL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM3210E-EVAL_XL\STM3210E-EVAL_XL.axf" --bin --output ".\STM3210E-EVAL_XL_SysTick.bin") 9 | if exist .\..\MDK-ARM\STM32100E-EVAL\STM32100E-EVAL.axf (C:\Keil\ARM\BIN40\fromelf.exe ".\..\MDK-ARM\STM32100E-EVAL\STM32100E-EVAL.axf" --bin --output ".\STM32100E-EVAL_SysTick.bin") 10 | 11 | ) 12 | 13 | pause 14 | 15 | -------------------------------------------------------------------------------- /src/Bin/hextobin.bat: -------------------------------------------------------------------------------- 1 | if exist .\..\STM3210B-EVAL\*.hex (.\hex2bin.exe .\..\STM3210B-EVAL\*.hex ) 2 | exit 3 | -------------------------------------------------------------------------------- /src/Driver/sys_timer.c: -------------------------------------------------------------------------------- 1 | #include "sys_timer.h" 2 | #include "stm32f10x.h" 3 | #include "core_cm3.h" 4 | #include "system_stm32f10x.h" 5 | 6 | volatile uint32_t sys_time_cnt = 0; 7 | volatile uint32_t user_time_cnt = 0; 8 | 9 | void gw_hal_set_time_cnt(uint32_t val){ 10 | user_time_cnt = val; 11 | } 12 | 13 | uint32_t gw_hal_get_time_cnt(void){ 14 | return user_time_cnt; 15 | } 16 | 17 | void gw_hal_delay(volatile uint32_t ntime){ 18 | 19 | sys_time_cnt = ntime; 20 | while(sys_time_cnt != 0); 21 | 22 | } 23 | 24 | void gw_hal_dec(void){ 25 | if (sys_time_cnt != 0x00) 26 | { 27 | sys_time_cnt--; 28 | } 29 | if (user_time_cnt != 0x00){ 30 | user_time_cnt--; 31 | } 32 | } 33 | 34 | 35 | void hal_system_timer_config(void){ 36 | /* Setup SysTick Timer for 1 msec interrupts. 37 | ------------------------------------------ 38 | 1. The SysTick_Config() function is a CMSIS function which configure: 39 | - The SysTick Reload register with value passed as function parameter. 40 | - Configure the SysTick IRQ priority to the lowest value (0x0F). 41 | - Reset the SysTick Counter register. 42 | - Configure the SysTick Counter clock source to be Core Clock Source (HCLK). 43 | - Enable the SysTick Interrupt. 44 | - Start the SysTick Counter. 45 | 46 | 2. You can change the SysTick Clock source to be HCLK_Div8 by calling the 47 | SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8) just after the 48 | SysTick_Config() function call. The SysTick_CLKSourceConfig() is defined 49 | inside the misc.c file. 50 | 51 | 3. You can change the SysTick IRQ priority by calling the 52 | NVIC_SetPriority(SysTick_IRQn,...) just after the SysTick_Config() function 53 | call. The NVIC_SetPriority() is defined inside the core_cm3.h file. 54 | 55 | 4. To adjust the SysTick time base, use the following formula: 56 | 57 | Reload Value = SysTick Counter Clock (Hz) x Desired Time base (s) 58 | 59 | - Reload Value is the parameter to be passed for SysTick_Config() function 60 | - Reload Value should not exceed 0xFFFFFF 61 | */ 62 | if (SysTick_Config(SystemCoreClock / SYSTICK_FREQ)) 63 | { 64 | /* Capture error */ 65 | while (1); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/Driver/sys_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef SYS_TIMER_H 2 | #define SYS_TIMER_H 3 | #include 4 | 5 | //Timebase 1ms 6 | #define SYSTICK_FREQ 1000 7 | 8 | void gw_hal_set_time_cnt(uint32_t val); 9 | uint32_t gw_hal_get_time_cnt(void); 10 | void gw_hal_delay(volatile uint32_t ntime); 11 | void gw_hal_dec(void); 12 | void hal_system_timer_config(void); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/Driver/usart.c: -------------------------------------------------------------------------------- 1 | #include "usart.h" 2 | #include 3 | #include 4 | #include "stm32f10x_usart.h" 5 | #include "stm32f10x_gpio.h" 6 | 7 | static void rcc_init(void){ 8 | 9 | RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE); 10 | /* Enable GPIO clock */ 11 | RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB 12 | | RCC_APB2Periph_AFIO, ENABLE); 13 | RCC_APB1PeriphClockCmd( RCC_APB1Periph_USART3, ENABLE); 14 | } 15 | 16 | static void gpio_init(void){ 17 | 18 | GPIO_InitTypeDef GPIO_InitStructure; 19 | /* Configure USART Tx as alternate function push-pull */ 20 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; 21 | GPIO_InitStructure.GPIO_Pin = TX_PIN; 22 | GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 23 | GPIO_Init(GPIOB, &GPIO_InitStructure); 24 | 25 | /* Configure USART Rx as input floating */ 26 | GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING; 27 | GPIO_InitStructure.GPIO_Pin = RX_PIN; 28 | 29 | GPIO_Init(GPIOB, &GPIO_InitStructure); 30 | 31 | } 32 | 33 | void usart_send_char(char ch){ 34 | 35 | /* Loop until the end of transmission */ 36 | //while (USART_GetFlagStatus(COM_PORT, USART_FLAG_TC) == RESET){} 37 | while((COM_PORT->SR & USART_FLAG_TC) != USART_FLAG_TC){ 38 | 39 | } 40 | USART_SendData(COM_PORT, (uint8_t) ch); 41 | } 42 | 43 | uint8_t usart_recv_char(){ 44 | /* Wait the byte is entirely received by USARTy */ 45 | //while(USART_GetFlagStatus(COM_PORT, USART_FLAG_RXNE) == RESET){} 46 | while((COM_PORT->SR & USART_FLAG_RXNE) != USART_FLAG_RXNE){ 47 | 48 | } 49 | 50 | /* Store the received byte in the RxBuffer1 */ 51 | return (uint8_t)USART_ReceiveData(COM_PORT); 52 | } 53 | 54 | void usart_init(void){ 55 | 56 | USART_InitTypeDef USART_InitStructure; 57 | rcc_init (); 58 | gpio_init (); 59 | 60 | /* USARTx configured as follow: 61 | - BaudRate = 115200 baud 62 | - Word Length = 8 Bits 63 | - One Stop Bit 64 | - No parity 65 | - Hardware flow control disabled (RTS and CTS signals) 66 | - Receive and transmit enabled 67 | */ 68 | USART_InitStructure.USART_BaudRate = BAUDRATE; 69 | USART_InitStructure.USART_WordLength = USART_WordLength_8b; 70 | USART_InitStructure.USART_StopBits = USART_StopBits_1; 71 | USART_InitStructure.USART_Parity = USART_Parity_No; 72 | USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; 73 | USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; 74 | /* USART configuration */ 75 | USART_Init(COM_PORT, &USART_InitStructure); 76 | USART_Cmd(COM_PORT, ENABLE); 77 | } 78 | /* 79 | int usart_printf(const char *fmt, ... ) 80 | { 81 | uint8_t i = 0; 82 | uint8_t usart_tx_buf[128] = { 0 }; 83 | va_list ap; 84 | 85 | va_start(ap, fmt ); 86 | vsprintf((char*)usart_tx_buf, fmt, ap); 87 | va_end(ap); 88 | 89 | while(usart_tx_buf[i] && i < 128){ 90 | usart_send_char(usart_tx_buf[i]); 91 | i++; 92 | } 93 | usart_send_char('\0'); 94 | return 0; 95 | } 96 | */ 97 | 98 | -------------------------------------------------------------------------------- /src/Driver/usart.h: -------------------------------------------------------------------------------- 1 | #ifndef USART_H 2 | #define USART_H 3 | 4 | //default 8N1 5 | #define COM_PORT USART3 6 | #define TX_PIN GPIO_Pin_10 7 | #define RX_PIN GPIO_Pin_11 8 | #define BAUDRATE 115200 9 | 10 | void usart_init(void); 11 | int usart_printf(const char *fmt, ... ); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /src/Firmware/STM3210B-EVAL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Firmware/STM3210B-EVAL.bin -------------------------------------------------------------------------------- /src/Iap/common.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/inc/common.h 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief This file provides all the headers of the common functions. 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2010 STMicroelectronics

19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef _COMMON_H 23 | #define _COMMON_H 24 | 25 | /* Includes ------------------------------------------------------------------*/ 26 | #include "stdio.h" 27 | #include "string.h" 28 | #include "stm32f10x.h" 29 | #include "ymodem.h" 30 | #include "usart.h" 31 | 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | typedef void (*pFunction)(void); 35 | 36 | /* Exported constants --------------------------------------------------------*/ 37 | /* Constants used by Serial Command Line Mode */ 38 | #define BOOT_DELAY 5 //MAX 9 39 | 40 | #define CMD_STRING_SIZE 128 41 | 42 | #define CMD_DOWNLOAD '1' 43 | #define CMD_UPLOAD '2' 44 | #define CMD_LOAD_APP '3' 45 | #define CMD_DISABLE_FLASH_PROTECTION '4' 46 | 47 | #define ApplicationAddress 0x8003000 48 | 49 | #if defined (STM32F10X_MD) || defined (STM32F10X_MD_VL) 50 | #define PAGE_SIZE (0x400) /* 1 Kbyte */ 51 | #define FLASH_SIZE (0x20000) /* 128 KBytes */ 52 | #elif defined STM32F10X_CL 53 | #define PAGE_SIZE (0x800) /* 2 Kbytes */ 54 | #define FLASH_SIZE (0x40000) /* 256 KBytes */ 55 | #elif defined STM32F10X_HD || defined (STM32F10X_HD_VL) 56 | #define PAGE_SIZE (0x800) /* 2 Kbytes */ 57 | #define FLASH_SIZE (0x80000) /* 512 KBytes */ 58 | #elif defined STM32F10X_XL 59 | #define PAGE_SIZE (0x800) /* 2 Kbytes */ 60 | #define FLASH_SIZE (0x100000) /* 1 MByte */ 61 | #else 62 | #error "Please select first the STM32 device to be used (in stm32f10x.h)" 63 | #endif 64 | 65 | /* Compute the FLASH upload image size */ 66 | #define FLASH_IMAGE_SIZE (uint32_t) (FLASH_SIZE - (ApplicationAddress - 0x08000000)) 67 | 68 | /* Exported macro ------------------------------------------------------------*/ 69 | /* Common routines */ 70 | #define IS_AF(c) ((c >= 'A') && (c <= 'F')) 71 | #define IS_af(c) ((c >= 'a') && (c <= 'f')) 72 | #define IS_09(c) ((c >= '0') && (c <= '9')) 73 | #define ISVALIDHEX(c) IS_AF(c) || IS_af(c) || IS_09(c) 74 | #define ISVALIDDEC(c) IS_09(c) 75 | #define CONVERTDEC(c) (c - '0') 76 | 77 | #define CONVERTHEX_alpha(c) (IS_AF(c) ? (c - 'A'+10) : (c - 'a'+10)) 78 | #define CONVERTHEX(c) (IS_09(c) ? (c - '0') : CONVERTHEX_alpha(c)) 79 | 80 | #define SerialPutString(x) Serial_PutString((uint8_t*)(x)) 81 | 82 | /* Exported functions ------------------------------------------------------- */ 83 | void Int2Str(uint8_t* str,int32_t intnum); 84 | uint32_t Str2Int(uint8_t *inputstr,int32_t *intnum); 85 | uint32_t GetIntegerInput(int32_t * num); 86 | uint32_t SerialKeyPressed(uint8_t *key); 87 | uint8_t GetKey(void); 88 | void SerialPutChar(uint8_t c); 89 | void Serial_PutString(uint8_t *s); 90 | void GetInputString(uint8_t * buffP); 91 | uint32_t FLASH_PagesMask(__IO uint32_t Size); 92 | void FLASH_DisableWriteProtectionPages(void); 93 | void Main_Menu(void); 94 | void SerialDownload(void); 95 | void SerialUpload(void); 96 | 97 | #endif /* _COMMON_H */ 98 | 99 | /*******************(C)COPYRIGHT 2010 STMicroelectronics *****END OF FILE******/ 100 | -------------------------------------------------------------------------------- /src/Iap/download.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/src/download.c 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief This file provides the software which allows to download an image 8 | * to internal Flash. 9 | ****************************************************************************** 10 | * @copy 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2010 STMicroelectronics

20 | */ 21 | 22 | /** @addtogroup IAP 23 | * @{ 24 | */ 25 | /* Includes ------------------------------------------------------------------*/ 26 | #include "common.h" 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* Private define ------------------------------------------------------------*/ 30 | /* Private macro -------------------------------------------------------------*/ 31 | /* Private variables ---------------------------------------------------------*/ 32 | extern uint8_t file_name[FILE_NAME_LENGTH]; 33 | uint8_t tab_1024[1024] = 34 | { 35 | 0 36 | }; 37 | 38 | /* Private function prototypes -----------------------------------------------*/ 39 | /* Private functions ---------------------------------------------------------*/ 40 | 41 | /** 42 | * @brief Download a file via serial port 43 | * @param None 44 | * @retval None 45 | */ 46 | void SerialDownload(void) 47 | { 48 | uint8_t Number[10] = " "; 49 | int32_t Size = 0; 50 | 51 | SerialPutString("Waiting for the file to be sent ... (press 'a' to abort)\n\r"); 52 | Size = Ymodem_Receive(&tab_1024[0]); 53 | if (Size > 0) 54 | { 55 | SerialPutString("\n\n\r Programming Completed Successfully!\n\r--------------------------------\r\n Name: "); 56 | SerialPutString(file_name); 57 | Int2Str(Number, Size); 58 | SerialPutString("\n\r Size: "); 59 | SerialPutString(Number); 60 | SerialPutString(" Bytes\r\n"); 61 | SerialPutString("-------------------\n"); 62 | } 63 | else if (Size == -1) 64 | { 65 | SerialPutString("\n\n\rThe image size is higher than the allowed space memory!\n\r"); 66 | } 67 | else if (Size == -2) 68 | { 69 | SerialPutString("\n\n\rVerification failed!\n\r"); 70 | } 71 | else if (Size == -3) 72 | { 73 | SerialPutString("\r\n\nAborted by user.\n\r"); 74 | } 75 | else 76 | { 77 | SerialPutString("\n\rFailed to receive the file!\n\r"); 78 | } 79 | } 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /*******************(C)COPYRIGHT 2010 STMicroelectronics *****END OF FILE******/ 86 | -------------------------------------------------------------------------------- /src/Iap/stm32f10x_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/inc/stm32f10x_conf.h 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief Library configuration file. 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2010 STMicroelectronics

19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F10x_CONF_H 23 | #define __STM32F10x_CONF_H 24 | 25 | /* Includes ------------------------------------------------------------------*/ 26 | /* Uncomment the line below to enable peripheral header file inclusion */ 27 | /* #include "stm32f10x_adc.h" */ 28 | /* #include "stm32f10x_bkp.h" */ 29 | /* #include "stm32f10x_can.h" */ 30 | /* #include "stm32f10x_crc.h" */ 31 | /* #include "stm32f10x_dac.h" */ 32 | /* #include "stm32f10x_dbgmcu.h" */ 33 | /* #include "stm32f10x_dma.h" */ 34 | #include "stm32f10x_exti.h" 35 | #include "stm32f10x_flash.h" 36 | /* #include "stm32f10x_fsmc.h" */ 37 | #include "stm32f10x_gpio.h" 38 | /* #include "stm32f10x_i2c.h" */ 39 | /* #include "stm32f10x_iwdg.h" */ 40 | /* #include "stm32f10x_pwr.h" */ 41 | #include "stm32f10x_rcc.h" 42 | /* #include "stm32f10x_rtc.h" */ 43 | /* #include "stm32f10x_sdio.h" */ 44 | /* #include "stm32f10x_spi.h" */ 45 | /* #include "stm32f10x_tim.h" */ 46 | #include "stm32f10x_usart.h" 47 | /* #include "stm32f10x_wwdg.h" */ 48 | #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ 49 | 50 | /* Exported types ------------------------------------------------------------*/ 51 | /* Exported constants --------------------------------------------------------*/ 52 | /* Uncomment the line below to expanse the "assert_param" macro in the 53 | Standard Peripheral Library drivers code */ 54 | /* #define USE_FULL_ASSERT 1 */ 55 | 56 | /* Exported macro ------------------------------------------------------------*/ 57 | #ifdef USE_FULL_ASSERT 58 | 59 | /** 60 | * @brief The assert_param macro is used for function's parameters check. 61 | * @param expr: If expr is false, it calls assert_failed function 62 | * which reports the name of the source file and the source 63 | * line number of the call that failed. 64 | * If expr is true, it returns no value. 65 | * @retval None 66 | */ 67 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 68 | /* Exported functions ------------------------------------------------------- */ 69 | void assert_failed(uint8_t* file, uint32_t line); 70 | #else 71 | #define assert_param(expr) ((void)0) 72 | #endif /* USE_FULL_ASSERT */ 73 | 74 | #endif /* __STM32F10x_CONF_H */ 75 | 76 | /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/ 77 | -------------------------------------------------------------------------------- /src/Iap/upload.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/src/upload.c 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief This file provides the software which allows to upload an image 8 | * from internal Flash. 9 | ****************************************************************************** 10 | * @copy 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2010 STMicroelectronics

20 | */ 21 | 22 | /** @addtogroup IAP 23 | * @{ 24 | */ 25 | /* Includes ------------------------------------------------------------------*/ 26 | #include "common.h" 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* Private define ------------------------------------------------------------*/ 30 | /* Private macro -------------------------------------------------------------*/ 31 | /* Private variables ---------------------------------------------------------*/ 32 | /* Private function prototypes -----------------------------------------------*/ 33 | /* Private functions ---------------------------------------------------------*/ 34 | 35 | /** 36 | * @brief Upload a file via serial port. 37 | * @param None 38 | * @retval None 39 | */ 40 | void SerialUpload(void) 41 | { 42 | uint32_t status = 0; 43 | 44 | SerialPutString("\n\n\rSelect Receive File ... (press any key to abort)\n\r"); 45 | 46 | if (GetKey() == CRC16) 47 | { 48 | /* Transmit the flash image through ymodem protocol */ 49 | status = Ymodem_Transmit((uint8_t*)ApplicationAddress, (const uint8_t*)"UploadedFlashImage.bin", FLASH_IMAGE_SIZE); 50 | 51 | if (status != 0) 52 | { 53 | SerialPutString("\n\rError Occured while Transmitting File\n\r"); 54 | } 55 | else 56 | { 57 | SerialPutString("\n\rFile Trasmitted Successfully \n\r"); 58 | } 59 | } 60 | else 61 | { 62 | SerialPutString("\r\n\nAborted by user.\n\r"); 63 | } 64 | 65 | } 66 | 67 | /** 68 | * @} 69 | */ 70 | 71 | /*******************(C)COPYRIGHT 2010 STMicroelectronics *****END OF FILE******/ 72 | -------------------------------------------------------------------------------- /src/Iap/ymodem.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/inc/ymodem.h 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief This file provides all the software function headers of the ymodem.c 8 | * file. 9 | ****************************************************************************** 10 | * @copy 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2010 STMicroelectronics

20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef _YMODEM_H_ 24 | #define _YMODEM_H_ 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | 28 | /* Exported types ------------------------------------------------------------*/ 29 | /* Exported constants --------------------------------------------------------*/ 30 | #define PACKET_SEQNO_INDEX (1) 31 | #define PACKET_SEQNO_COMP_INDEX (2) 32 | 33 | #define PACKET_HEADER (3) 34 | #define PACKET_TRAILER (2) 35 | #define PACKET_OVERHEAD (PACKET_HEADER + PACKET_TRAILER) 36 | #define PACKET_SIZE (128) 37 | #define PACKET_1K_SIZE (1024) 38 | 39 | #define FILE_NAME_LENGTH (256) 40 | #define FILE_SIZE_LENGTH (16) 41 | 42 | #define SOH (0x01) /* start of 128-byte data packet */ 43 | #define STX (0x02) /* start of 1024-byte data packet */ 44 | #define EOT (0x04) /* end of transmission */ 45 | #define ACK (0x06) /* acknowledge */ 46 | #define NAK (0x15) /* negative acknowledge */ 47 | #define CA (0x18) /* two of these in succession aborts transfer */ 48 | #define CRC16 (0x43) /* 'C' == 0x43, request 16-bit CRC */ 49 | 50 | #define ABORT1 (0x41) /* 'A' == 0x41, abort by user */ 51 | #define ABORT2 (0x61) /* 'a' == 0x61, abort by user */ 52 | 53 | #define NAK_TIMEOUT (0x100000) 54 | #define MAX_ERRORS (5) 55 | 56 | /* Exported macro ------------------------------------------------------------*/ 57 | /* Exported functions ------------------------------------------------------- */ 58 | int32_t Ymodem_Receive (uint8_t *); 59 | uint8_t Ymodem_Transmit (uint8_t *,const uint8_t* , uint32_t ); 60 | 61 | #endif /* _YMODEM_H_ */ 62 | 63 | /*******************(C)COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/ 64 | -------------------------------------------------------------------------------- /src/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /src/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /src/Libraries/CMSIS/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/CMSIS/CMSIS debug support.htm -------------------------------------------------------------------------------- /src/Libraries/CMSIS/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/CMSIS/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /src/Libraries/CMSIS/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/CMSIS/License.doc -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CRC_H 25 | #define __STM32F10x_CRC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CRC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup CRC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Exported_Macros 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Exported_Functions 67 | * @{ 68 | */ 69 | 70 | void CRC_ResetDR(void); 71 | uint32_t CRC_CalcCRC(uint32_t Data); 72 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 73 | uint32_t CRC_GetCRC(void); 74 | void CRC_SetIDRegister(uint8_t IDValue); 75 | uint8_t CRC_GetIDRegister(void); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __STM32F10x_CRC_H */ 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_dbgmcu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_dbgmcu.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the DBGMCU 8 | * firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_DBGMCU_H 25 | #define __STM32F10x_DBGMCU_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup DBGMCU 39 | * @{ 40 | */ 41 | 42 | /** @defgroup DBGMCU_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup DBGMCU_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | #define DBGMCU_SLEEP ((uint32_t)0x00000001) 55 | #define DBGMCU_STOP ((uint32_t)0x00000002) 56 | #define DBGMCU_STANDBY ((uint32_t)0x00000004) 57 | #define DBGMCU_IWDG_STOP ((uint32_t)0x00000100) 58 | #define DBGMCU_WWDG_STOP ((uint32_t)0x00000200) 59 | #define DBGMCU_TIM1_STOP ((uint32_t)0x00000400) 60 | #define DBGMCU_TIM2_STOP ((uint32_t)0x00000800) 61 | #define DBGMCU_TIM3_STOP ((uint32_t)0x00001000) 62 | #define DBGMCU_TIM4_STOP ((uint32_t)0x00002000) 63 | #define DBGMCU_CAN1_STOP ((uint32_t)0x00004000) 64 | #define DBGMCU_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000) 65 | #define DBGMCU_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000) 66 | #define DBGMCU_TIM8_STOP ((uint32_t)0x00020000) 67 | #define DBGMCU_TIM5_STOP ((uint32_t)0x00040000) 68 | #define DBGMCU_TIM6_STOP ((uint32_t)0x00080000) 69 | #define DBGMCU_TIM7_STOP ((uint32_t)0x00100000) 70 | #define DBGMCU_CAN2_STOP ((uint32_t)0x00200000) 71 | #define DBGMCU_TIM15_STOP ((uint32_t)0x00400000) 72 | #define DBGMCU_TIM16_STOP ((uint32_t)0x00800000) 73 | #define DBGMCU_TIM17_STOP ((uint32_t)0x01000000) 74 | #define DBGMCU_TIM12_STOP ((uint32_t)0x02000000) 75 | #define DBGMCU_TIM13_STOP ((uint32_t)0x04000000) 76 | #define DBGMCU_TIM14_STOP ((uint32_t)0x08000000) 77 | #define DBGMCU_TIM9_STOP ((uint32_t)0x10000000) 78 | #define DBGMCU_TIM10_STOP ((uint32_t)0x20000000) 79 | #define DBGMCU_TIM11_STOP ((uint32_t)0x40000000) 80 | 81 | #define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0x800000F8) == 0x00) && ((PERIPH) != 0x00)) 82 | /** 83 | * @} 84 | */ 85 | 86 | /** @defgroup DBGMCU_Exported_Macros 87 | * @{ 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /** @defgroup DBGMCU_Exported_Functions 95 | * @{ 96 | */ 97 | 98 | uint32_t DBGMCU_GetREVID(void); 99 | uint32_t DBGMCU_GetDEVID(void); 100 | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState); 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif /* __STM32F10x_DBGMCU_H */ 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | /** 116 | * @} 117 | */ 118 | 119 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 120 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_iwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_iwdg.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the IWDG 8 | * firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_IWDG_H 25 | #define __STM32F10x_IWDG_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup IWDG 39 | * @{ 40 | */ 41 | 42 | /** @defgroup IWDG_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup IWDG_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup IWDG_WriteAccess 55 | * @{ 56 | */ 57 | 58 | #define IWDG_WriteAccess_Enable ((uint16_t)0x5555) 59 | #define IWDG_WriteAccess_Disable ((uint16_t)0x0000) 60 | #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ 61 | ((ACCESS) == IWDG_WriteAccess_Disable)) 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup IWDG_prescaler 67 | * @{ 68 | */ 69 | 70 | #define IWDG_Prescaler_4 ((uint8_t)0x00) 71 | #define IWDG_Prescaler_8 ((uint8_t)0x01) 72 | #define IWDG_Prescaler_16 ((uint8_t)0x02) 73 | #define IWDG_Prescaler_32 ((uint8_t)0x03) 74 | #define IWDG_Prescaler_64 ((uint8_t)0x04) 75 | #define IWDG_Prescaler_128 ((uint8_t)0x05) 76 | #define IWDG_Prescaler_256 ((uint8_t)0x06) 77 | #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ 78 | ((PRESCALER) == IWDG_Prescaler_8) || \ 79 | ((PRESCALER) == IWDG_Prescaler_16) || \ 80 | ((PRESCALER) == IWDG_Prescaler_32) || \ 81 | ((PRESCALER) == IWDG_Prescaler_64) || \ 82 | ((PRESCALER) == IWDG_Prescaler_128)|| \ 83 | ((PRESCALER) == IWDG_Prescaler_256)) 84 | /** 85 | * @} 86 | */ 87 | 88 | /** @defgroup IWDG_Flag 89 | * @{ 90 | */ 91 | 92 | #define IWDG_FLAG_PVU ((uint16_t)0x0001) 93 | #define IWDG_FLAG_RVU ((uint16_t)0x0002) 94 | #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)) 95 | #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) 96 | /** 97 | * @} 98 | */ 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | /** @defgroup IWDG_Exported_Macros 105 | * @{ 106 | */ 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | /** @defgroup IWDG_Exported_Functions 113 | * @{ 114 | */ 115 | 116 | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess); 117 | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler); 118 | void IWDG_SetReload(uint16_t Reload); 119 | void IWDG_ReloadCounter(void); 120 | void IWDG_Enable(void); 121 | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG); 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif /* __STM32F10x_IWDG_H */ 128 | /** 129 | * @} 130 | */ 131 | 132 | /** 133 | * @} 134 | */ 135 | 136 | /** 137 | * @} 138 | */ 139 | 140 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 141 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_pwr.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_pwr.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the PWR firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_PWR_H 25 | #define __STM32F10x_PWR_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup PWR 39 | * @{ 40 | */ 41 | 42 | /** @defgroup PWR_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup PWR_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup PVD_detection_level 55 | * @{ 56 | */ 57 | 58 | #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000) 59 | #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020) 60 | #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040) 61 | #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060) 62 | #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080) 63 | #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0) 64 | #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0) 65 | #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0) 66 | #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \ 67 | ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \ 68 | ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \ 69 | ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9)) 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @defgroup Regulator_state_is_STOP_mode 75 | * @{ 76 | */ 77 | 78 | #define PWR_Regulator_ON ((uint32_t)0x00000000) 79 | #define PWR_Regulator_LowPower ((uint32_t)0x00000001) 80 | #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \ 81 | ((REGULATOR) == PWR_Regulator_LowPower)) 82 | /** 83 | * @} 84 | */ 85 | 86 | /** @defgroup STOP_mode_entry 87 | * @{ 88 | */ 89 | 90 | #define PWR_STOPEntry_WFI ((uint8_t)0x01) 91 | #define PWR_STOPEntry_WFE ((uint8_t)0x02) 92 | #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE)) 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /** @defgroup PWR_Flag 99 | * @{ 100 | */ 101 | 102 | #define PWR_FLAG_WU ((uint32_t)0x00000001) 103 | #define PWR_FLAG_SB ((uint32_t)0x00000002) 104 | #define PWR_FLAG_PVDO ((uint32_t)0x00000004) 105 | #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \ 106 | ((FLAG) == PWR_FLAG_PVDO)) 107 | 108 | #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB)) 109 | /** 110 | * @} 111 | */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** @defgroup PWR_Exported_Macros 118 | * @{ 119 | */ 120 | 121 | /** 122 | * @} 123 | */ 124 | 125 | /** @defgroup PWR_Exported_Functions 126 | * @{ 127 | */ 128 | 129 | void PWR_DeInit(void); 130 | void PWR_BackupAccessCmd(FunctionalState NewState); 131 | void PWR_PVDCmd(FunctionalState NewState); 132 | void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel); 133 | void PWR_WakeUpPinCmd(FunctionalState NewState); 134 | void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry); 135 | void PWR_EnterSTANDBYMode(void); 136 | FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG); 137 | void PWR_ClearFlag(uint32_t PWR_FLAG); 138 | 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | 143 | #endif /* __STM32F10x_PWR_H */ 144 | /** 145 | * @} 146 | */ 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | /** 153 | * @} 154 | */ 155 | 156 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 157 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_rtc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_rtc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the RTC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_RTC_H 25 | #define __STM32F10x_RTC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup RTC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup RTC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup RTC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup RTC_interrupts_define 55 | * @{ 56 | */ 57 | 58 | #define RTC_IT_OW ((uint16_t)0x0004) /*!< Overflow interrupt */ 59 | #define RTC_IT_ALR ((uint16_t)0x0002) /*!< Alarm interrupt */ 60 | #define RTC_IT_SEC ((uint16_t)0x0001) /*!< Second interrupt */ 61 | #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00)) 62 | #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \ 63 | ((IT) == RTC_IT_SEC)) 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @defgroup RTC_interrupts_flags 69 | * @{ 70 | */ 71 | 72 | #define RTC_FLAG_RTOFF ((uint16_t)0x0020) /*!< RTC Operation OFF flag */ 73 | #define RTC_FLAG_RSF ((uint16_t)0x0008) /*!< Registers Synchronized flag */ 74 | #define RTC_FLAG_OW ((uint16_t)0x0004) /*!< Overflow flag */ 75 | #define RTC_FLAG_ALR ((uint16_t)0x0002) /*!< Alarm flag */ 76 | #define RTC_FLAG_SEC ((uint16_t)0x0001) /*!< Second flag */ 77 | #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00)) 78 | #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \ 79 | ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \ 80 | ((FLAG) == RTC_FLAG_SEC)) 81 | #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF) 82 | 83 | /** 84 | * @} 85 | */ 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | /** @defgroup RTC_Exported_Macros 92 | * @{ 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | 99 | /** @defgroup RTC_Exported_Functions 100 | * @{ 101 | */ 102 | 103 | void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState); 104 | void RTC_EnterConfigMode(void); 105 | void RTC_ExitConfigMode(void); 106 | uint32_t RTC_GetCounter(void); 107 | void RTC_SetCounter(uint32_t CounterValue); 108 | void RTC_SetPrescaler(uint32_t PrescalerValue); 109 | void RTC_SetAlarm(uint32_t AlarmValue); 110 | uint32_t RTC_GetDivider(void); 111 | void RTC_WaitForLastTask(void); 112 | void RTC_WaitForSynchro(void); 113 | FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG); 114 | void RTC_ClearFlag(uint16_t RTC_FLAG); 115 | ITStatus RTC_GetITStatus(uint16_t RTC_IT); 116 | void RTC_ClearITPendingBit(uint16_t RTC_IT); 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | #endif /* __STM32F10x_RTC_H */ 123 | /** 124 | * @} 125 | */ 126 | 127 | /** 128 | * @} 129 | */ 130 | 131 | /** 132 | * @} 133 | */ 134 | 135 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 136 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_wwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_wwdg.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the WWDG firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_WWDG_H 25 | #define __STM32F10x_WWDG_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup WWDG 39 | * @{ 40 | */ 41 | 42 | /** @defgroup WWDG_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup WWDG_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup WWDG_Prescaler 55 | * @{ 56 | */ 57 | 58 | #define WWDG_Prescaler_1 ((uint32_t)0x00000000) 59 | #define WWDG_Prescaler_2 ((uint32_t)0x00000080) 60 | #define WWDG_Prescaler_4 ((uint32_t)0x00000100) 61 | #define WWDG_Prescaler_8 ((uint32_t)0x00000180) 62 | #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \ 63 | ((PRESCALER) == WWDG_Prescaler_2) || \ 64 | ((PRESCALER) == WWDG_Prescaler_4) || \ 65 | ((PRESCALER) == WWDG_Prescaler_8)) 66 | #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F) 67 | #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F)) 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** @defgroup WWDG_Exported_Macros 78 | * @{ 79 | */ 80 | /** 81 | * @} 82 | */ 83 | 84 | /** @defgroup WWDG_Exported_Functions 85 | * @{ 86 | */ 87 | 88 | void WWDG_DeInit(void); 89 | void WWDG_SetPrescaler(uint32_t WWDG_Prescaler); 90 | void WWDG_SetWindowValue(uint8_t WindowValue); 91 | void WWDG_EnableIT(void); 92 | void WWDG_SetCounter(uint8_t Counter); 93 | void WWDG_Enable(uint8_t Counter); 94 | FlagStatus WWDG_GetFlagStatus(void); 95 | void WWDG_ClearFlag(void); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* __STM32F10x_WWDG_H */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 116 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the CRC firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_crc.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup CRC 30 | * @brief CRC driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup CRC_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup CRC_Private_Defines 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Private_Macros 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Private_Variables 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Private_FunctionPrototypes 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @defgroup CRC_Private_Functions 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @brief Resets the CRC Data register (DR). 80 | * @param None 81 | * @retval None 82 | */ 83 | void CRC_ResetDR(void) 84 | { 85 | /* Reset CRC generator */ 86 | CRC->CR = CRC_CR_RESET; 87 | } 88 | 89 | /** 90 | * @brief Computes the 32-bit CRC of a given data word(32-bit). 91 | * @param Data: data word(32-bit) to compute its CRC 92 | * @retval 32-bit CRC 93 | */ 94 | uint32_t CRC_CalcCRC(uint32_t Data) 95 | { 96 | CRC->DR = Data; 97 | 98 | return (CRC->DR); 99 | } 100 | 101 | /** 102 | * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit). 103 | * @param pBuffer: pointer to the buffer containing the data to be computed 104 | * @param BufferLength: length of the buffer to be computed 105 | * @retval 32-bit CRC 106 | */ 107 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength) 108 | { 109 | uint32_t index = 0; 110 | 111 | for(index = 0; index < BufferLength; index++) 112 | { 113 | CRC->DR = pBuffer[index]; 114 | } 115 | return (CRC->DR); 116 | } 117 | 118 | /** 119 | * @brief Returns the current CRC value. 120 | * @param None 121 | * @retval 32-bit CRC 122 | */ 123 | uint32_t CRC_GetCRC(void) 124 | { 125 | return (CRC->DR); 126 | } 127 | 128 | /** 129 | * @brief Stores a 8-bit data in the Independent Data(ID) register. 130 | * @param IDValue: 8-bit value to be stored in the ID register 131 | * @retval None 132 | */ 133 | void CRC_SetIDRegister(uint8_t IDValue) 134 | { 135 | CRC->IDR = IDValue; 136 | } 137 | 138 | /** 139 | * @brief Returns the 8-bit data stored in the Independent Data(ID) register 140 | * @param None 141 | * @retval 8-bit value of the ID register 142 | */ 143 | uint8_t CRC_GetIDRegister(void) 144 | { 145 | return (CRC->IDR); 146 | } 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | /** 153 | * @} 154 | */ 155 | 156 | /** 157 | * @} 158 | */ 159 | 160 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 161 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_dbgmcu.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the DBGMCU firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_dbgmcu.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup DBGMCU 30 | * @brief DBGMCU driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup DBGMCU_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup DBGMCU_Private_Defines 43 | * @{ 44 | */ 45 | 46 | #define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF) 47 | /** 48 | * @} 49 | */ 50 | 51 | /** @defgroup DBGMCU_Private_Macros 52 | * @{ 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @defgroup DBGMCU_Private_Variables 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @defgroup DBGMCU_Private_FunctionPrototypes 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @defgroup DBGMCU_Private_Functions 76 | * @{ 77 | */ 78 | 79 | /** 80 | * @brief Returns the device revision identifier. 81 | * @param None 82 | * @retval Device revision identifier 83 | */ 84 | uint32_t DBGMCU_GetREVID(void) 85 | { 86 | return(DBGMCU->IDCODE >> 16); 87 | } 88 | 89 | /** 90 | * @brief Returns the device identifier. 91 | * @param None 92 | * @retval Device identifier 93 | */ 94 | uint32_t DBGMCU_GetDEVID(void) 95 | { 96 | return(DBGMCU->IDCODE & IDCODE_DEVID_MASK); 97 | } 98 | 99 | /** 100 | * @brief Configures the specified peripheral and low power mode behavior 101 | * when the MCU under Debug mode. 102 | * @param DBGMCU_Periph: specifies the peripheral and low power mode. 103 | * This parameter can be any combination of the following values: 104 | * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode 105 | * @arg DBGMCU_STOP: Keep debugger connection during STOP mode 106 | * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode 107 | * @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted 108 | * @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted 109 | * @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted 110 | * @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted 111 | * @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted 112 | * @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted 113 | * @arg DBGMCU_CAN1_STOP: Debug CAN2 stopped when Core is halted 114 | * @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is halted 115 | * @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is halted 116 | * @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted 117 | * @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted 118 | * @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted 119 | * @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted 120 | * @arg DBGMCU_CAN2_STOP: Debug CAN2 stopped when Core is halted 121 | * @arg DBGMCU_TIM15_STOP: TIM15 counter stopped when Core is halted 122 | * @arg DBGMCU_TIM16_STOP: TIM16 counter stopped when Core is halted 123 | * @arg DBGMCU_TIM17_STOP: TIM17 counter stopped when Core is halted 124 | * @arg DBGMCU_TIM9_STOP: TIM9 counter stopped when Core is halted 125 | * @arg DBGMCU_TIM10_STOP: TIM10 counter stopped when Core is halted 126 | * @arg DBGMCU_TIM11_STOP: TIM11 counter stopped when Core is halted 127 | * @arg DBGMCU_TIM12_STOP: TIM12 counter stopped when Core is halted 128 | * @arg DBGMCU_TIM13_STOP: TIM13 counter stopped when Core is halted 129 | * @arg DBGMCU_TIM14_STOP: TIM14 counter stopped when Core is halted 130 | * @param NewState: new state of the specified peripheral in Debug mode. 131 | * This parameter can be: ENABLE or DISABLE. 132 | * @retval None 133 | */ 134 | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState) 135 | { 136 | /* Check the parameters */ 137 | assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph)); 138 | assert_param(IS_FUNCTIONAL_STATE(NewState)); 139 | 140 | if (NewState != DISABLE) 141 | { 142 | DBGMCU->CR |= DBGMCU_Periph; 143 | } 144 | else 145 | { 146 | DBGMCU->CR &= ~DBGMCU_Periph; 147 | } 148 | } 149 | 150 | /** 151 | * @} 152 | */ 153 | 154 | /** 155 | * @} 156 | */ 157 | 158 | /** 159 | * @} 160 | */ 161 | 162 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 163 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_iwdg.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the IWDG firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_iwdg.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup IWDG 30 | * @brief IWDG driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup IWDG_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup IWDG_Private_Defines 43 | * @{ 44 | */ 45 | 46 | /* ---------------------- IWDG registers bit mask ----------------------------*/ 47 | 48 | /* KR register bit mask */ 49 | #define KR_KEY_Reload ((uint16_t)0xAAAA) 50 | #define KR_KEY_Enable ((uint16_t)0xCCCC) 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | /** @defgroup IWDG_Private_Macros 57 | * @{ 58 | */ 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | /** @defgroup IWDG_Private_Variables 65 | * @{ 66 | */ 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | /** @defgroup IWDG_Private_FunctionPrototypes 73 | * @{ 74 | */ 75 | 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup IWDG_Private_Functions 81 | * @{ 82 | */ 83 | 84 | /** 85 | * @brief Enables or disables write access to IWDG_PR and IWDG_RLR registers. 86 | * @param IWDG_WriteAccess: new state of write access to IWDG_PR and IWDG_RLR registers. 87 | * This parameter can be one of the following values: 88 | * @arg IWDG_WriteAccess_Enable: Enable write access to IWDG_PR and IWDG_RLR registers 89 | * @arg IWDG_WriteAccess_Disable: Disable write access to IWDG_PR and IWDG_RLR registers 90 | * @retval None 91 | */ 92 | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess) 93 | { 94 | /* Check the parameters */ 95 | assert_param(IS_IWDG_WRITE_ACCESS(IWDG_WriteAccess)); 96 | IWDG->KR = IWDG_WriteAccess; 97 | } 98 | 99 | /** 100 | * @brief Sets IWDG Prescaler value. 101 | * @param IWDG_Prescaler: specifies the IWDG Prescaler value. 102 | * This parameter can be one of the following values: 103 | * @arg IWDG_Prescaler_4: IWDG prescaler set to 4 104 | * @arg IWDG_Prescaler_8: IWDG prescaler set to 8 105 | * @arg IWDG_Prescaler_16: IWDG prescaler set to 16 106 | * @arg IWDG_Prescaler_32: IWDG prescaler set to 32 107 | * @arg IWDG_Prescaler_64: IWDG prescaler set to 64 108 | * @arg IWDG_Prescaler_128: IWDG prescaler set to 128 109 | * @arg IWDG_Prescaler_256: IWDG prescaler set to 256 110 | * @retval None 111 | */ 112 | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler) 113 | { 114 | /* Check the parameters */ 115 | assert_param(IS_IWDG_PRESCALER(IWDG_Prescaler)); 116 | IWDG->PR = IWDG_Prescaler; 117 | } 118 | 119 | /** 120 | * @brief Sets IWDG Reload value. 121 | * @param Reload: specifies the IWDG Reload value. 122 | * This parameter must be a number between 0 and 0x0FFF. 123 | * @retval None 124 | */ 125 | void IWDG_SetReload(uint16_t Reload) 126 | { 127 | /* Check the parameters */ 128 | assert_param(IS_IWDG_RELOAD(Reload)); 129 | IWDG->RLR = Reload; 130 | } 131 | 132 | /** 133 | * @brief Reloads IWDG counter with value defined in the reload register 134 | * (write access to IWDG_PR and IWDG_RLR registers disabled). 135 | * @param None 136 | * @retval None 137 | */ 138 | void IWDG_ReloadCounter(void) 139 | { 140 | IWDG->KR = KR_KEY_Reload; 141 | } 142 | 143 | /** 144 | * @brief Enables IWDG (write access to IWDG_PR and IWDG_RLR registers disabled). 145 | * @param None 146 | * @retval None 147 | */ 148 | void IWDG_Enable(void) 149 | { 150 | IWDG->KR = KR_KEY_Enable; 151 | } 152 | 153 | /** 154 | * @brief Checks whether the specified IWDG flag is set or not. 155 | * @param IWDG_FLAG: specifies the flag to check. 156 | * This parameter can be one of the following values: 157 | * @arg IWDG_FLAG_PVU: Prescaler Value Update on going 158 | * @arg IWDG_FLAG_RVU: Reload Value Update on going 159 | * @retval The new state of IWDG_FLAG (SET or RESET). 160 | */ 161 | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG) 162 | { 163 | FlagStatus bitstatus = RESET; 164 | /* Check the parameters */ 165 | assert_param(IS_IWDG_FLAG(IWDG_FLAG)); 166 | if ((IWDG->SR & IWDG_FLAG) != (uint32_t)RESET) 167 | { 168 | bitstatus = SET; 169 | } 170 | else 171 | { 172 | bitstatus = RESET; 173 | } 174 | /* Return the flag status */ 175 | return bitstatus; 176 | } 177 | 178 | /** 179 | * @} 180 | */ 181 | 182 | /** 183 | * @} 184 | */ 185 | 186 | /** 187 | * @} 188 | */ 189 | 190 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 191 | -------------------------------------------------------------------------------- /src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/Project.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\Project.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page ewarm EWARM Project Template 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with IAR Embedded Workbench for ARM (EWARM) 13 | * software toolchain (version 5.50 and later). 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .ewd/.eww/.ewp: A pre-configured project file with the provided library 27 | structure that produces an executable image with IAR 28 | Embedded Workbench. 29 | 30 | - stm32f10x_flash.icf : This file is the IAR Linker configuration file used to 31 | place program code (readonly) in internal FLASH and data 32 | (readwrite, Stack and Heap)in internal SRAM. 33 | You can customize this file to your need. 34 | 35 | - stm32f10x_flash_extsram.icf: This file is the IAR Linker configuration file 36 | used to place program code (readonly) in internal 37 | FLASH and data (readwrite, Stack and Heap)in 38 | external SRAM. You can customize this file to your need. 39 | This file is used only with STM32 High-density devices. 40 | 41 | - stm32f10x_nor.icf: This file is the IAR Linker configuration file used to 42 | place program code (readonly) in external NOR FLASH and data 43 | (readwrite, Stack and Heap)in internal SRAM. 44 | You can customize this file to your need. 45 | This file is used only with STM32 High-density devices. 46 | 47 | - stm32f10x_ram.icf: This file is the IAR Linker configuration file used to 48 | place program code (readonly) and data (readwrite, Stack 49 | and Heap)in internal SRAM. 50 | You can customize this file to your need. 51 | 52 | @par How to use it ? 53 | 54 | - Open the Project.eww workspace. 55 | - In the workspace toolbar select the project config: 56 | - STM32100B-EVAL: to configure the project for STM32 Medium-density Value 57 | line devices 58 | @note The needed define symbols for this config are already declared in the 59 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD_VL, USE_STM32100B_EVAL 60 | 61 | - STM3210C-EVAL: to configure the project for STM32 Connectivity line devices 62 | @note The needed define symbols for this config are already declared in the 63 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_CL, USE_STM3210C_EVAL 64 | 65 | - STM3210B-EVAL: to configure the project for STM32 Medium-density devices 66 | @note The needed define symbols for this config are already declared in the 67 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD, USE_STM3210B_EVAL 68 | 69 | - STM3210E-EVAL: to configure the project for STM32 High-density devices 70 | @note The needed define symbols for this config are already declared in the 71 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD, USE_STM3210E_EVAL 72 | 73 | - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices 74 | @note The needed define symbols for this config are already declared in the 75 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_XL, USE_STM3210E_EVAL 76 | 77 | - STM32100E-EVAL: to configure the project for STM32 High-density Value line devices 78 | @note The needed define symbols for this config are already declared in the 79 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD_VL, USE_STM32100E_EVAL 80 | 81 | - Rebuild all files: Project->Rebuild all 82 | - Load project image: Project->Debug 83 | - Run program: Debug->Go(F5) 84 | 85 | @note 86 | - Low-density Value line devices are STM32F100xx microcontrollers where the 87 | Flash memory density ranges between 16 and 32 Kbytes. 88 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 89 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 90 | - Medium-density Value line devices are STM32F100xx microcontrollers where the 91 | Flash memory density ranges between 32 and 128 Kbytes. 92 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 93 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 94 | - High-density Value line devices are STM32F100xx microcontrollers where the 95 | Flash memory density ranges between 256 and 512 Kbytes. 96 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 97 | the Flash memory density ranges between 256 and 512 Kbytes. 98 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 99 | the Flash memory density ranges between 512 and 1024 Kbytes. 100 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 101 | 102 | *

© COPYRIGHT 2011 STMicroelectronics

103 | */ 104 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/stm32f10x_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; 32 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/stm32f10x_flash_extsram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x68000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x680FFFFF; 11 | 12 | /*-Sizes-*/ 13 | define symbol __ICFEDIT_size_cstack__ = 0x400; 14 | define symbol __ICFEDIT_size_heap__ = 0x200; 15 | /**** End of ICF editor section. ###ICF###*/ 16 | 17 | 18 | define memory mem with size = 4G; 19 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 20 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; /* EXTSRAM_region */ 21 | 22 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 23 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 24 | 25 | initialize by copy { readwrite }; 26 | do not initialize { section .noinit }; 27 | 28 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 29 | 30 | place in ROM_region { readonly }; 31 | place in RAM_region {readwrite, block CSTACK, block HEAP }; /* EXTSRAM_region */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/stm32f10x_nor.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x64000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x64000000 ; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x64FFFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; 32 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/EWARM/stm32f10x_ram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x2000FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20010000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; 32 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/stm32f10x_MD_VL.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100B-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM32100B HiTOP Project Template for STM32F10x Medium-density Value line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - link.lnk: This file is the HiTOP linker it invokes the stm32f10x_MD_VL.lsl. 39 | 40 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 41 | 42 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 43 | Counter at the "main" instruction. 44 | 45 | - StartupScript.scr: This file is a HiTOP script and it performs a target 46 | reset before loading The executable image. 47 | 48 | - stm32f10x_MD_VL.lsl: This file is used to place program code (readonly) 49 | in internal FLASH and data (readwrite, Stack and Heap) 50 | in internal SRAM. 51 | It contains also the vector table of the STM32 52 | Medium-density Value line devices. 53 | You can customize this file to your need. 54 | 55 | @par How to use it ? 56 | 57 | - Open the HiTOP toolchain. 58 | - Browse to open the project.htp 59 | - A "Download application" window is displayed, click "cancel". 60 | - Rebuild all files: Project->Rebuild all 61 | - Load project image : Click "ok" in the "Download application" window. 62 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 63 | - Run program: Debug->Go(F5). 64 | 65 | @note 66 | - Low-density Value line devices are STM32F100xx microcontrollers where the 67 | Flash memory density ranges between 16 and 32 Kbytes. 68 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 69 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 70 | - Medium-density Value line devices are STM32F100xx microcontrollers where 71 | the Flash memory density ranges between 64 and 128 Kbytes. 72 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 73 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 74 | - High-density Value line devices are STM32F100xx microcontrollers where the 75 | Flash memory density ranges between 256 and 512 Kbytes. 76 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 77 | the Flash memory density ranges between 256 and 512 Kbytes. 78 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 79 | the Flash memory density ranges between 512 and 1024 Kbytes. 80 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 81 | 82 | *

© COPYRIGHT 2011 STMicroelectronics

83 | */ 84 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/stm32f10x_hd_vl.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/Settings/link_extsram.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/stm32f10x_hd_vl_extsram.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | //Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM32100E HiTOP Project Template for STM32F10x High-density Value line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - link.lnk: This file is the HiTOP linker it invokes the stm32f10x_hd_vl.lsl 39 | 40 | - linkextsram.lnk: This file is the HiTOP linker it invokes the stm32f10x_hd_vl_extsram.lsl 41 | 42 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 43 | 44 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 45 | Counter at the "main" instruction. 46 | 47 | - StartupScript.scr: This file is a HiTOP script and it performs a target 48 | reset before loading The executable image. 49 | 50 | - stm32f10x_hd_vl.lsl: This file is used to place program code (readonly) 51 | in internal FLASH and data (readwrite, Stack and Heap) 52 | in internal SRAM. 53 | It contains also the vector table of the STM32 54 | High-density Value line devices. 55 | You can customize this file to your need. 56 | 57 | - stm32f10x_hd_vl_extsram.lsl: This file used to place program code (readonly) in 58 | internal FLASH and data (readwrite, Stack and Heap) 59 | in external SRAM. 60 | It contains also the vector table of the STM32 High-density 61 | Value line devices. 62 | You can customize this file to your need. 63 | This file is used only with STM32 High-density 64 | Value line devices. 65 | 66 | @par How to use it ? 67 | 68 | - Open the HiTOP toolchain. 69 | - Browse to open the project.htp 70 | - A "Download application" window is displayed, click "cancel". 71 | - Rebuild all files: Project->Rebuild all 72 | - Load project image : Click "ok" in the "Download application" window. 73 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 74 | - Run program: Debug->Go(F5). 75 | 76 | @note 77 | - Low-density Value line devices are STM32F100xx microcontrollers where the 78 | Flash memory density ranges between 16 and 32 Kbytes. 79 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 80 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 81 | - Medium-density Value line devices are STM32F100xx microcontrollers where 82 | the Flash memory density ranges between 64 and 128 Kbytes. 83 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 84 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 85 | - High-density Value line devices are STM32F100xx microcontrollers where the 86 | Flash memory density ranges between 256 and 512 Kbytes. 87 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 88 | the Flash memory density ranges between 256 and 512 Kbytes. 89 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 90 | the Flash memory density ranges between 512 and 1024 Kbytes. 91 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 92 | 93 | *

© COPYRIGHT 2011 STMicroelectronics

94 | */ 95 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM32100E-EVAL/setstack.asm: -------------------------------------------------------------------------------- 1 | .section .bss.stack 2 | .global _stacklabel 3 | _stacklabel: 4 | .endsec -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_md.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210B-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM3210B HiTOP Project Template for STM32F10x Medium-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - link.lnk: This file is the HiTOP linker it invokes the STM32F10x_md.lsl. 39 | 40 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 41 | 42 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 43 | Counter at the "main" instruction. 44 | 45 | - StartupScript.scr: This file is a HiTOP script and it performs a target 46 | reset before loading The executable image. 47 | 48 | - STM32F10x_md.lsl: This file is used to place program code (readonly) 49 | in internal FLASH and data (readwrite, Stack and Heap) 50 | in internal SRAM. 51 | It contains also the vector table of the STM32 52 | Medium-density devices. 53 | You can customize this file to your need. 54 | 55 | @par How to use it ? 56 | 57 | - Open the HiTOP toolchain. 58 | - Browse to open the project.htp 59 | - A "Download application" window is displayed, click "cancel". 60 | - Rebuild all files: Project->Rebuild all 61 | - Load project image : Click "ok" in the "Download application" window. 62 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 63 | - Run program: Debug->Go(F5). 64 | 65 | @note 66 | - Low-density Value line devices are STM32F100xx microcontrollers where the 67 | Flash memory density ranges between 16 and 32 Kbytes. 68 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 69 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 70 | - Medium-density Value line devices are STM32F100xx microcontrollers where 71 | the Flash memory density ranges between 64 and 128 Kbytes. 72 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 73 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 74 | - High-density Value line devices are STM32F100xx microcontrollers where the 75 | Flash memory density ranges between 256 and 512 Kbytes. 76 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 77 | the Flash memory density ranges between 256 and 512 Kbytes. 78 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 79 | the Flash memory density ranges between 512 and 1024 Kbytes. 80 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 81 | 82 | *

© COPYRIGHT 2011 STMicroelectronics

83 | */ 84 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_cl.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210C-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM3210C HiTOP Project Template for STM32F10x Connectivity line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - link.lnk: This file is the HiTOP linker it invokes the STM32F10x_cl.lsl. 39 | 40 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 41 | 42 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 43 | Counter at the "main" instruction. 44 | 45 | - StartupScript.scr: This file is a HiTOP script and it performs a target 46 | reset before loading The executable image. 47 | 48 | - STM32F10x_cl.lsl: This file is used to place program code (readonly) 49 | in internal FLASH and data (readwrite, Stack and Heap) 50 | in internal SRAM. 51 | It contains also the vector table of the STM32 52 | Connectivity line devices. 53 | You can customize this file to your need. 54 | 55 | 56 | @par How to use it ? 57 | 58 | - Open the HiTOP toolchain. 59 | - Browse to open the project.htp 60 | - A "Download application" window is displayed, click "cancel". 61 | - Rebuild all files: Project->Rebuild all 62 | - Load project image : Click "ok" in the "Download application" window. 63 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 64 | - Run program: Debug->Go(F5). 65 | 66 | @note 67 | - Low-density Value line devices are STM32F100xx microcontrollers where the 68 | Flash memory density ranges between 16 and 32 Kbytes. 69 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 70 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 71 | - Medium-density Value line devices are STM32F100xx microcontrollers where 72 | the Flash memory density ranges between 64 and 128 Kbytes. 73 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 74 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 75 | - High-density Value line devices are STM32F100xx microcontrollers where the 76 | Flash memory density ranges between 256 and 512 Kbytes. 77 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 78 | the Flash memory density ranges between 256 and 512 Kbytes. 79 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 80 | the Flash memory density ranges between 512 and 1024 Kbytes. 81 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 82 | 83 | *

© COPYRIGHT 2011 STMicroelectronics

84 | */ 85 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/flash_nor.scr: -------------------------------------------------------------------------------- 1 | // Hitex/We/04.02.2008 2 | // 3 | // StartupScript Script file for HiTOP Debugger 4 | // Target Hitex evaluation board with STM32Fxxx 5 | // Flash application 6 | 7 | //######################################################################################### 8 | // Enable APB2 GPIOA .. GPIOG + AFIO Peripheral Clock 9 | // 10 | // Register RCC_APB2ENR Adr: 0x40021000 + Offs. 0x18 value 0x1FD 11 | //######################################################################################### 12 | OUTPUT DWORD TO 0x40021014 = 0x00000114 13 | OUTPUT DWORD TO 0x40021018 = 0x000001FD 14 | 15 | 16 | //######################################################################################### 17 | // NOR Datalines GPIOD, GPIOE 18 | // 19 | // Set Bits 0,1,8,9,10,14,15 of Port D to PushPull, 50Mhz Speed 20 | // Register GPIOD_CRL Adr: 0x40011400 + Offs. 0x00 value 0x444444BB 21 | // Register GPIOD_CRH Adr: 0x40011400 + Offs. 0x04 value 0xBB444BBB 22 | // 23 | // Set Bits 7,8,9,10,11,12,13,14,15 of Port E to PushPull, 50Mhz Speed 24 | // Register GPIOD_CRL Adr: 0x40011800 + Offs. 0x00 value 0xB4444444 25 | // Register GPIOD_CRH Adr: 0x40011800 + Offs. 0x04 value 0xBBBBBBBB 26 | // 27 | //######################################################################################### 28 | // Port D 29 | OUTPUT DWORD TO 0x40011400 = 0x44BB44BB 30 | OUTPUT DWORD TO 0x40011404 = 0xBBBBBBBB 31 | // Port E 32 | OUTPUT DWORD TO 0x40011800 = 0xBBBBBB44 33 | OUTPUT DWORD TO 0x40011804 = 0xBBBBBBBB 34 | 35 | //######################################################################################### 36 | // NOR Addresslines GPIOF, GPIOG 37 | // 38 | // Set Bits 0,1,2,3,4,5,12,13,14,15 of Port F to PushPull, 50Mhz Speed 39 | // Register GPIOF_CRL Adr: 0x40011C00 + Offs. 0x00 value 0x444BBBBB 40 | // Register GPIOF_CRH Adr: 0x40011C00 + Offs. 0x04 value 0xBBBB4444 41 | // 42 | // Set Bits 0,1,2,3,4,5,13,14 of Port G to PushPull, 50Mhz Speed 43 | // Register GPIOG_CRL Adr: 0x40012000 + Offs. 0x00 value 0x44BBBBBB 44 | // Register GPIOG_CRH Adr: 0x40012000 + Offs. 0x04 value 0x4BB44444 45 | // 46 | // Set Bits 11,12,13 of Port D to PushPull, 50Mhz Speed 47 | // Register GPIOD_CRH Adr: 0x40011400 + Offs. 0x04 value 0xBBBBBBBB 48 | // 49 | // Set Bits 2,3,4,5,6 of Port E to PushPull, 50Mhz Speed 50 | // Register GPIOD_CRL Adr: 0x40011800 + Offs. 0x00 value 0xB4444444 51 | //######################################################################################### 52 | // Port F 53 | OUTPUT DWORD TO 0x40011C00 = 0x44BBBBBB 54 | OUTPUT DWORD TO 0x40011C04 = 0xBBBB4444 55 | // Port G 56 | OUTPUT DWORD TO 0x40012000 = 0x44BBBBBB 57 | OUTPUT DWORD TO 0x40012004 = 0x4BB444B4 58 | // Port D 59 | //OUTPUT DWORD TO 0x40011404 = 0xBBBBBBBB 60 | // Port E 61 | //OUTPUT DWORD TO 0x40011800 = 0xBBBBBBB4 62 | 63 | //######################################################################################### 64 | // NOE and NWE Configuration GPIOD 65 | // 66 | // Set Bits 4,5 of Port D to PushPull, 50Mhz Speed 67 | // Register GPIOD_CRL Adr: 0x40011400 + Offs. 0x00 value 0x44BB44BB 68 | // 69 | //######################################################################################### 70 | // Port D 71 | //OUTPUT DWORD TO 0x40011400 = 0x44BB44BB 72 | 73 | //######################################################################################### 74 | // NE2 Configuration GPIOG 75 | // 76 | // Set Bits 9 Port G to PushPull, 50Mhz Speed 77 | // Register GPIOD_CRH Adr: 0x40012000 + Offs. 0x04 value 0x4BB444B4 78 | // 79 | //######################################################################################### 80 | // Port G 81 | //OUTPUT DWORD TO 0x40012004 = 0x4BB444B4 82 | 83 | //######################################################################################### 84 | // FSMC Configuration 85 | // 86 | // Bank1 is used 87 | // if another Bank is required, then adjust the Register Addresses 88 | // 89 | // Register FSMC_BCR value 0x00001059 90 | // Register FSMC_BTR value 0x00010112 91 | // Register FSMC_BWTR value 0x0FFFFFFF 92 | //######################################################################################### 93 | 94 | OUTPUT DWORD TO 0xA0000000 = 0x000030DB 95 | 96 | 97 | OUTPUT DWORD TO 0xA0000008 = 0x00001059 98 | 99 | OUTPUT DWORD TO 0xA000000C= 0x30010112 100 | 101 | OUTPUT DWORD TO 0xA0000104 = 0x0FFFFFFF 102 | 103 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_hd.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/linkextsram.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_extsram.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/linknor.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10xnor.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM3210E HiTOP Project Template for STM32F10x High-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripherals 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - flash_nor.scr: This file is a HiTOP script allowing the FSMC configuration. 39 | It should be executed before programming the NOR flash of the 40 | STM32 High-density devices. 41 | 42 | - link.lnk: This file is the HiTOP linker it invokes the STM32F10x_hd.lsl. 43 | 44 | - linkextsram.lnk: This file is the HiTOP linker it invokes the STM32F10x_extsram.lsl. 45 | 46 | - linknor.lnk: This file is the HiTOP linker it invokes the STM32F10xnor.lsl. 47 | 48 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 49 | 50 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 51 | Counter at the "main" instruction. 52 | 53 | - StartupScript.scr: This file is a HiTOP script and it performs a target 54 | reset before loading The executable image. 55 | 56 | - STM32F10x_extsram.lsl: This file used to place program code (readonly) in 57 | internal FLASH and data (readwrite, Stack and Heap) 58 | in external SRAM. 59 | It contains also the vector table of the STM32 high-density 60 | devices. 61 | You can customize this file to your need. 62 | This file is used only with STM32 High-density devices. 63 | 64 | - STM32F10x_hd.lsl: This file is used to place program code (readonly) 65 | in internal FLASH and data (readwrite, Stack and Heap) 66 | in internal SRAM. 67 | It contains also the vector table of the STM32 68 | High-Density devices. 69 | You can customize this file to your need. 70 | 71 | - STM32F10xnor.lsl: This file used to place program code (readonly) in 72 | external NOR FLASH and data (readwrite, Stack and Heap) 73 | in internal SRAM. 74 | It contains also the vector table of the STM32 high-density 75 | devices. 76 | You can customize this file to your need. 77 | This file is used only with STM32 High-density devices. 78 | 79 | @par How to use it ? 80 | 81 | - Open the HiTOP toolchain. 82 | - Browse to open the project.htp 83 | - A "Download application" window is displayed, click "cancel". 84 | - Rebuild all files: Project->Rebuild all 85 | - Load project image : Click "ok" in the "Download application" window. 86 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 87 | - Run program: Debug->Go(F5). 88 | 89 | - When using High-density devices, it is mandatory to reset the target before 90 | loading the project into target 91 | - It is recommended to run the reset script ( click on TR button in the toolbar menu) 92 | after loading the project into target. 93 | 94 | @note 95 | - Low-density Value line devices are STM32F100xx microcontrollers where the 96 | Flash memory density ranges between 16 and 32 Kbytes. 97 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 98 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 99 | - Medium-density Value line devices are STM32F100xx microcontrollers where 100 | the Flash memory density ranges between 64 and 128 Kbytes. 101 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 102 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 103 | - High-density Value line devices are STM32F100xx microcontrollers where the 104 | Flash memory density ranges between 256 and 512 Kbytes. 105 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 106 | the Flash memory density ranges between 256 and 512 Kbytes. 107 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 108 | the Flash memory density ranges between 512 and 1024 Kbytes. 109 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 110 | 111 | *

© COPYRIGHT 2011 STMicroelectronics

112 | */ 113 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL/setstack.asm: -------------------------------------------------------------------------------- 1 | .section .bss.stack 2 | .global _stacklabel 3 | _stacklabel: 4 | .endsec -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/Settings/StartupScript.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/Settings/link.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_XL.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/Settings/linkextsram.lnk: -------------------------------------------------------------------------------- 1 | -d"./settings/STM32F10x_xl_extsram.lsl" 2 | --optimize=0 3 | --map-file-format=2 4 | $(LinkObjects) 5 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/Settings/reset_appl.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/Settings/reset_go_main.scr: -------------------------------------------------------------------------------- 1 | // Hitex/Lue/11.02.2008 2 | // Executable Script file for HiTOP Debugger 3 | // Reset application & Go main 4 | 5 | // Reset 6 | RESET TARGET 7 | 8 | 9 | // execute program till main 10 | Go UNTIL main 11 | wait 12 | 13 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/cstart_thumb2.asm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;; NOTE: To allow the use of this file for both ARMv6M and ARMv7M, 4 | ;; we will only use 16-bit Thumb intructions. 5 | 6 | .extern _lc_ub_stack ; usr/sys mode stack pointer 7 | .extern _lc_ue_stack ; symbol required by debugger 8 | .extern _lc_ub_table ; ROM to RAM copy table 9 | .extern main 10 | .extern _Exit 11 | .extern exit 12 | .weak exit 13 | .global __get_argcv 14 | .weak __get_argcv 15 | .extern __argcvbuf 16 | .weak __argcvbuf 17 | .extern __init_hardware 18 | .extern __init_vector_table 19 | .extern SystemInit 20 | 21 | .if @defined('__PROF_ENABLE__') 22 | .extern __prof_init 23 | .endif 24 | .if @defined('__POSIX__') 25 | .extern posix_main 26 | .extern _posix_boot_stack_top 27 | .endif 28 | 29 | .global _START 30 | 31 | .section .text.cstart 32 | 33 | .thumb 34 | _START: 35 | ;; anticipate possible ROM/RAM remapping 36 | ;; by loading the 'real' program address 37 | ldr r1,=_Next 38 | bx r1 39 | _Next: 40 | ;; initialize the stack pointer 41 | ldr r1,=_lc_ub_stack ; TODO: make this part of the vector table 42 | mov sp,r1 43 | 44 | ;; call a user function which initializes hardware 45 | ;; such as ROM/RAM re-mapping or MMU configuration 46 | bl __init_hardware 47 | 48 | ;ldr r0, =SystemInit 49 | ;bx r0 50 | bl SystemInit 51 | 52 | ;; copy initialized sections from ROM to RAM 53 | ;; and clear uninitialized data sections in RAM 54 | 55 | ldr r3,=_lc_ub_table 56 | movs r0,#0 57 | cploop: 58 | ldr r4,[r3,#0] ; load type 59 | ldr r5,[r3,#4] ; dst address 60 | ldr r6,[r3,#8] ; src address 61 | ldr r7,[r3,#12] ; size 62 | 63 | cmp r4,#1 64 | beq copy 65 | cmp r4,#2 66 | beq clear 67 | b done 68 | 69 | copy: 70 | subs r7,r7,#1 71 | ldrb r1,[r6,r7] 72 | strb r1,[r5,r7] 73 | bne copy 74 | 75 | adds r3,r3,#16 76 | b cploop 77 | 78 | clear: 79 | subs r7,r7,#1 80 | strb r0,[r5,r7] 81 | bne clear 82 | 83 | adds r3,r3,#16 84 | b cploop 85 | 86 | done: 87 | ;; initialize or copy the vector table 88 | bl __init_vector_table 89 | 90 | .if @defined('__POSIX__') 91 | 92 | ;; posix stack buffer for system upbringing 93 | ldr r0,=_posix_boot_stack_top 94 | ldr r0, [r0] 95 | mov sp,r0 96 | 97 | .else 98 | 99 | ;; load r10 with end of USR/SYS stack, which is 100 | ;; needed in case stack overflow checking is on 101 | ;; NOTE: use 16-bit instructions only, for ARMv6M 102 | ldr r0,=_lc_ue_stack 103 | mov r10,r0 104 | 105 | .endif 106 | 107 | .if @defined('__PROF_ENABLE__') 108 | bl __prof_init 109 | .endif 110 | 111 | .if @defined('__POSIX__') 112 | ;; call posix_main with no arguments 113 | bl posix_main 114 | .else 115 | ;; retrieve argc and argv (default argv[0]==NULL & argc==0) 116 | bl __get_argcv 117 | ldr r1,=__argcvbuf 118 | ;; call main 119 | bl main 120 | .endif 121 | 122 | ;; call exit using the return value from main() 123 | ;; Note. Calling exit will also run all functions 124 | ;; that were supplied through atexit(). 125 | bl exit 126 | 127 | __get_argcv: ; weak definition 128 | movs r0,#0 129 | bx lr 130 | 131 | .ltorg 132 | .endsec 133 | 134 | .calls '_START','__init_hardware' 135 | .calls '_START','__init_vector_table' 136 | .if @defined('__PROF_ENABLE__') 137 | .calls '_START','__prof_init' 138 | .endif 139 | .if @defined('__POSIX__') 140 | .calls '_START','posix_main' 141 | .else 142 | .calls '_START','__get_argcv' 143 | .calls '_START','main' 144 | .endif 145 | .calls '_START','exit' 146 | .calls '_START','',0 147 | 148 | .end 149 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page HiTOP5_STM3210E_XL HiTOP Project Template for STM32F10x XL-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with HiTOP software toolchain (version 5.40 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.htp: A pre-configured project file with the provided library 26 | structure that produces an executable image with HiTOP 27 | 28 | - cstart_thumb2.asm: This file initializes the stack pointer and copy initialized 29 | sections from ROM to RAM. 30 | 31 | - Objects: This mandatory directory contains the executable images. 32 | 33 | - Settings: This directory contains the linker and script files. 34 | - arm_arch.lsl: This file is used to place program code (readonly) 35 | in internal FLASH and data (readwrite, Stack and Heap) 36 | in internal SRAM. 37 | 38 | - link.lnk: This file is the HiTOP linker it invokes the STM32F10x_XL.lsl. 39 | 40 | - reset_appl.scr: This file is a HiTOP script it performs a target reset. 41 | 42 | - reset_go_main.scr: This file is a HiTOP script and it sets the Program 43 | Counter at the "main" instruction. 44 | 45 | - StartupScript.scr: This file is a HiTOP script and it performs a target 46 | reset before loading The executable image. 47 | 48 | - STM32F10x_Xl.lsl: This file is used to place program code (readonly) 49 | in internal FLASH and data (readwrite, Stack and Heap) 50 | in internal SRAM. 51 | It contains also the vector table of the STM32 52 | XL-density line devices. 53 | You can customize this file to your need. 54 | 55 | 56 | @par How to use it ? 57 | 58 | - Open the HiTOP toolchain. 59 | - Browse to open the project.htp 60 | - A "Download application" window is displayed, click "cancel". 61 | - Rebuild all files: Project->Rebuild all 62 | - Load project image : Click "ok" in the "Download application" window. 63 | - Run the "RESET_GO_MAIN" script to set the PC at the "main" 64 | - Run program: Debug->Go(F5). 65 | 66 | @note 67 | - Low-density Value line devices are STM32F100xx microcontrollers where the 68 | Flash memory density ranges between 16 and 32 Kbytes. 69 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 70 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 71 | - Medium-density Value line devices are STM32F100xx microcontrollers where 72 | the Flash memory density ranges between 64 and 128 Kbytes. 73 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 74 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 75 | - High-density Value line devices are STM32F100xx microcontrollers where the 76 | Flash memory density ranges between 256 and 512 Kbytes. 77 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 78 | the Flash memory density ranges between 256 and 512 Kbytes. 79 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 80 | the Flash memory density ranges between 512 and 1024 Kbytes. 81 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 82 | 83 | *

© COPYRIGHT 2011 STMicroelectronics

84 | */ 85 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/HiTOP/STM3210E-EVAL_XL/setstack.asm: -------------------------------------------------------------------------------- 1 | .section .bss.stack 2 | .global _stacklabel 3 | _stacklabel: 4 | .endsec -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/DebugConfig/STM32F1X-BOOTLOADER_STM32F103CB_1.0.0.dbgconf: -------------------------------------------------------------------------------- 1 | // File: STM32F101_102_103_105_107.dbgconf 2 | // Version: 1.0.0 3 | // Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008) 4 | // STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets 5 | 6 | // <<< Use Configuration Wizard in Context Menu >>> 7 | 8 | // Debug MCU configuration register (DBGMCU_CR) 9 | // Reserved bits must be kept at reset value 10 | // DBG_TIM11_STOP TIM11 counter stopped when core is halted 11 | // DBG_TIM10_STOP TIM10 counter stopped when core is halted 12 | // DBG_TIM9_STOP TIM9 counter stopped when core is halted 13 | // DBG_TIM14_STOP TIM14 counter stopped when core is halted 14 | // DBG_TIM13_STOP TIM13 counter stopped when core is halted 15 | // DBG_TIM12_STOP TIM12 counter stopped when core is halted 16 | // DBG_CAN2_STOP Debug CAN2 stopped when core is halted 17 | // DBG_TIM7_STOP TIM7 counter stopped when core is halted 18 | // DBG_TIM6_STOP TIM6 counter stopped when core is halted 19 | // DBG_TIM5_STOP TIM5 counter stopped when core is halted 20 | // DBG_TIM8_STOP TIM8 counter stopped when core is halted 21 | // DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 22 | // DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 23 | // DBG_CAN1_STOP Debug CAN1 stopped when Core is halted 24 | // DBG_TIM4_STOP TIM4 counter stopped when core is halted 25 | // DBG_TIM3_STOP TIM3 counter stopped when core is halted 26 | // DBG_TIM2_STOP TIM2 counter stopped when core is halted 27 | // DBG_TIM1_STOP TIM1 counter stopped when core is halted 28 | // DBG_WWDG_STOP Debug window watchdog stopped when core is halted 29 | // DBG_IWDG_STOP Debug independent watchdog stopped when core is halted 30 | // DBG_STANDBY Debug standby mode 31 | // DBG_STOP Debug stop mode 32 | // DBG_SLEEP Debug sleep mode 33 | // 34 | DbgMCU_CR = 0x00000007; 35 | 36 | // <<< end of configuration section >>> 37 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/DebugConfig/STM32F1X-BOOTLOADER_STM32F103VB_1.0.0.dbgconf: -------------------------------------------------------------------------------- 1 | // File: STM32F101_102_103_105_107.dbgconf 2 | // Version: 1.0.0 3 | // Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008) 4 | // STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets 5 | 6 | // <<< Use Configuration Wizard in Context Menu >>> 7 | 8 | // Debug MCU configuration register (DBGMCU_CR) 9 | // Reserved bits must be kept at reset value 10 | // DBG_TIM11_STOP TIM11 counter stopped when core is halted 11 | // DBG_TIM10_STOP TIM10 counter stopped when core is halted 12 | // DBG_TIM9_STOP TIM9 counter stopped when core is halted 13 | // DBG_TIM14_STOP TIM14 counter stopped when core is halted 14 | // DBG_TIM13_STOP TIM13 counter stopped when core is halted 15 | // DBG_TIM12_STOP TIM12 counter stopped when core is halted 16 | // DBG_CAN2_STOP Debug CAN2 stopped when core is halted 17 | // DBG_TIM7_STOP TIM7 counter stopped when core is halted 18 | // DBG_TIM6_STOP TIM6 counter stopped when core is halted 19 | // DBG_TIM5_STOP TIM5 counter stopped when core is halted 20 | // DBG_TIM8_STOP TIM8 counter stopped when core is halted 21 | // DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 22 | // DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted 23 | // DBG_CAN1_STOP Debug CAN1 stopped when Core is halted 24 | // DBG_TIM4_STOP TIM4 counter stopped when core is halted 25 | // DBG_TIM3_STOP TIM3 counter stopped when core is halted 26 | // DBG_TIM2_STOP TIM2 counter stopped when core is halted 27 | // DBG_TIM1_STOP TIM1 counter stopped when core is halted 28 | // DBG_WWDG_STOP Debug window watchdog stopped when core is halted 29 | // DBG_IWDG_STOP Debug independent watchdog stopped when core is halted 30 | // DBG_STANDBY Debug standby mode 31 | // DBG_STOP Debug stop mode 32 | // DBG_SLEEP Debug sleep mode 33 | // 34 | DbgMCU_CR = 0x00000007; 35 | 36 | // <<< end of configuration section >>> 37 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/EventRecorderStub.scvd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/RTE/_STM32F1X-BOOTLOADER/RTE_Components.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Auto generated Run-Time-Environment Component Configuration File 4 | * *** Do not modify ! *** 5 | * 6 | * Project: 'Project' 7 | * Target: 'STM32F1X-BOOTLOADER' 8 | */ 9 | 10 | #ifndef RTE_COMPONENTS_H 11 | #define RTE_COMPONENTS_H 12 | 13 | 14 | /* 15 | * Define the Device Header File: 16 | */ 17 | #define CMSIS_device_header "stm32f10x.h" 18 | 19 | 20 | #endif /* RTE_COMPONENTS_H */ 21 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/note.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page note Note for MDK-ARM 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file note.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This file contains the needed steps to use the default startup file 11 | * provided by RealView Microcontroller Development Kit(MDK-ARM). 12 | ****************************************************************************** 13 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 14 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 16 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 17 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 18 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | ****************************************************************************** 20 | 21 | 22 | With MDK-ARM toolchain, a simple putchar function executes a SWI and activates 23 | a low level putchar function. 24 | You have to redirect the low level to your own implementation of these functions. 25 | 26 | To guarantee that no functions using the semihosting SWI are included in your 27 | application, either: 28 | 29 | 1. Ensure that the MicroLib option is checked since the microlib does not support 30 | semihosting 31 | or 32 | 2. Use 33 | - IMPORT __use_no_semihosting_swi from assembly language 34 | - #pragma import(__use_no_semihosting_swi) from C. 35 | 36 | @endverbatim 37 | 38 | @note 39 | - Low-density Value line devices are STM32F100xx microcontrollers where the 40 | Flash memory density ranges between 16 and 32 Kbytes. 41 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 42 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 43 | - Medium-density Value line devices are STM32F100xx microcontrollers where 44 | the Flash memory density ranges between 32 and 128 Kbytes. 45 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 46 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 47 | - High-density Value line devices are STM32F100xx microcontrollers where the 48 | Flash memory density ranges between 256 and 512 Kbytes. 49 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 50 | the Flash memory density ranges between 256 and 512 Kbytes. 51 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 52 | the Flash memory density ranges between 512 and 1024 Kbytes. 53 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 54 | 55 | *

© COPYRIGHT 2011 STMicroelectronics

56 | */ 57 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page mdkarm MDK-ARM Project Template 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files needed 11 | * to create a new project linked with the STM32F10x Standard Peripheral 12 | * Library and working with RealView MDK-ARM toolchain (Version 4.12 and later). 13 | ****************************************************************************** 14 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | ****************************************************************************** 21 | @endverbatim 22 | 23 | @par Directory contents 24 | 25 | - Project.Uv2/.Opt: A pre-configured project file with the provided library structure 26 | that produces an executable image with MDK-ARM 27 | 28 | Enabling "Options for Target 'Output' Browser Information" is useful for quick 29 | source files navigation but may slow the compilation time. 30 | 31 | @note the @subpage note file contains the needed steps to follow when using the 32 | default startup file provided by MDK-ARM when creating new projects. 33 | 34 | @par How to use it ? 35 | 36 | - Open the Project.uvproj project 37 | - In the build toolbar select the project config: 38 | - STM32100B-EVAL: to configure the project for STM32 Medium-density Value 39 | line devices 40 | @note The needed define symbols for this config are already declared in the 41 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD_VL, USE_STM32100B_EVAL 42 | 43 | - STM3210C-EVAL: to configure the project for STM32 Connectivity line devices 44 | @note The needed define symbols for this config are already declared in the 45 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_CL, USE_STM3210C_EVAL 46 | 47 | - STM3210B-EVAL: to configure the project for STM32 Medium-density devices 48 | @note The needed define symbols for this config are already declared in the 49 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_MD, USE_STM3210B_EVAL 50 | 51 | - STM3210E-EVAL: to configure the project for STM32 High-density devices 52 | @note The needed define symbols for this config are already declared in the 53 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD, USE_STM3210E_EVAL 54 | 55 | - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices 56 | @note The needed define symbols for this config are already declared in the 57 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_XL, USE_STM3210E_EVAL 58 | 59 | - STM32100E-EVAL: to configure the project for STM32 High-density Value line devices 60 | @note The needed define symbols for this config are already declared in the 61 | preprocessor section: USE_STDPERIPH_DRIVER, STM32F10X_HD_VL, USE_STM32100E_EVAL 62 | 63 | - Rebuild all files: Project->Rebuild all target files 64 | - Load project image: Debug->Start/Stop Debug Session 65 | - Run program: Debug->Run (F5) 66 | 67 | @note 68 | - Low-density Value line devices are STM32F100xx microcontrollers where the 69 | Flash memory density ranges between 16 and 32 Kbytes. 70 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 71 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 72 | - Medium-density Value line devices are STM32F100xx microcontrollers where 73 | the Flash memory density ranges between 64 and 128 Kbytes. 74 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 75 | microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes. 76 | - High-density Value line devices are STM32F100xx microcontrollers where 77 | the Flash memory density ranges between 256 and 512 Kbytes. 78 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 79 | the Flash memory density ranges between 256 and 512 Kbytes. 80 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 81 | the Flash memory density ranges between 512 and 1024 Kbytes. 82 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 83 | 84 | *

© COPYRIGHT 2011 STMicroelectronics

85 | */ 86 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/MDK-ARM/script.bat: -------------------------------------------------------------------------------- 1 | XCOPY /Y /S /F .\Out\obj\*.hex .\ 2 | XCOPY /Y /S /F .\Out\obj\*.hex C:\Users\zhaoj\ -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/RIDE/Project.rprj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/RIDE/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page ride7 RIDE Project Template 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with RIDE7 software 13 | * toolchain (RIDE7 IDE:7.30.10, RKitARM for RIDE7:1.30.10) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .rprj/.rapp: A pre-configured project file with the provided library 27 | structure that produces an executable image with RIDE7. 28 | 29 | - stm32f10x_flash_extsram.ld: This file is the RAISONANCE linker script used to 30 | place program code (readonly) in internal FLASH 31 | and data (readwrite, Stack and Heap)in external 32 | SRAM. 33 | You can customize this file to your need. 34 | 35 | @par How to use it ? 36 | 37 | - Open the Project.rprj project. 38 | - In the configuration toolbar(Project->properties) select the project config: 39 | - STM32100E-EVAL: to configure the project for STM32 Value Line High-density devices 40 | - STM32100B-EVAL: to configure the project for STM32 Medium-density Value line devices 41 | - STM3210C-EVAL: to configure the project for STM32 Connectivity line devices 42 | - STM3210B-EVAL: to configure the project for STM32 Medium-density devices 43 | - STM3210E-EVAL: to configure the project for STM32 High-density devices 44 | - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices 45 | - Rebuild all files: Project->build project 46 | - Load project image: Debug->start(ctrl+D) 47 | - Run program: Debug->Run(ctrl+F9) 48 | 49 | @note 50 | - Low-density Value line devices are STM32F100xx microcontrollers where the 51 | Flash memory density ranges between 16 and 32 Kbytes. 52 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 53 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 54 | - Medium-density Value line devices are STM32F100xx microcontrollers where 55 | the Flash memory density ranges between 32 and 128 Kbytes. 56 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 57 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 58 | - High-density Value line devices are STM32F100xx microcontrollers where the 59 | Flash memory density ranges between 256 and 512 Kbytes. 60 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 61 | the Flash memory density ranges between 256 and 512 Kbytes. 62 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 63 | the Flash memory density ranges between 512 and 1024 Kbytes. 64 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 65 | 66 | *

© COPYRIGHT 2011 STMicroelectronics

67 | */ 68 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100B-EVAL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM32100B-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F100VB 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100B-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM32100B TrueSTUDIO Project Template for Medium-density Value line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM32100B-EVAL: to configure the project for STM32 Medium-density Value 45 | line devices. 46 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 47 | a variable path named "CurPath" which points to the folder containing 48 | "Libraries", "Project" and "Utilities" folders. 49 | - Rebuild all project files: Select the project in the "Project explorer" 50 | window then click on Project->build project menu. 51 | - Run program: Select the project in the "Project explorer" window then click 52 | Run->Debug (F11) 53 | 54 | @note 55 | - Low-density Value line devices are STM32F100xx microcontrollers where the 56 | Flash memory density ranges between 16 and 32 Kbytes. 57 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 58 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 59 | - Medium-density Value line devices are STM32F100xx microcontrollers where 60 | the Flash memory density ranges between 32 and 128 Kbytes. 61 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 62 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 63 | - High-density Value line devices are STM32F100xx microcontrollers where 64 | the Flash memory density ranges between 256 and 512 Kbytes. 65 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 66 | the Flash memory density ranges between 256 and 512 Kbytes. 67 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 68 | the Flash memory density ranges between 512 and 1024 Kbytes. 69 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 70 | 71 | *

© COPYRIGHT 2011 STMicroelectronics

72 | */ 73 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100B-EVAL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100B-EVAL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100E-EVAL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM32100E-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F100ZE 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100E-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM32100E TrueSTUDIO Project Template for High-density Value line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM32100E-EVAL: to configure the project for STM32 High-density Value 45 | line devices. 46 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 47 | a variable path named "CurPath" which points to the folder containing 48 | "Libraries", "Project" and "Utilities" folders. 49 | - Rebuild all project files: Select the project in the "Project explorer" 50 | window then click on Project->build project menu. 51 | - Run program: Select the project in the "Project explorer" window then click 52 | Run->Debug (F11) 53 | 54 | @note 55 | - Low-density Value line devices are STM32F100xx microcontrollers where the 56 | Flash memory density ranges between 16 and 32 Kbytes. 57 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 58 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 59 | - Medium-density Value line devices are STM32F100xx microcontrollers where 60 | the Flash memory density ranges between 32 and 128 Kbytes. 61 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 62 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 63 | - High-density Value line devices are STM32F100xx microcontrollers where 64 | the Flash memory density ranges between 256 and 512 Kbytes. 65 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 66 | the Flash memory density ranges between 256 and 512 Kbytes. 67 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 68 | the Flash memory density ranges between 512 and 1024 Kbytes. 69 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 70 | 71 | *

© COPYRIGHT 2011 STMicroelectronics

72 | */ 73 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100E-EVAL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM32100E-EVAL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210B-EVAL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM3210B-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F103VB 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210B-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM3210B TrueSTUDIO Project Template for Medium-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM3210B-EVAL: to configure the project for STM32 Medium-density devices. 45 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 46 | a variable path named "CurPath" which points to the folder containing 47 | "Libraries", "Project" and "Utilities" folders. 48 | - Rebuild all project files: Select the project in the "Project explorer" 49 | window then click on Project->build project menu. 50 | - Run program: Select the project in the "Project explorer" window then click 51 | Run->Debug (F11) 52 | 53 | @note 54 | - Low-density Value line devices are STM32F100xx microcontrollers where the 55 | Flash memory density ranges between 16 and 32 Kbytes. 56 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 57 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 58 | - Medium-density Value line devices are STM32F100xx microcontrollers where 59 | the Flash memory density ranges between 32 and 128 Kbytes. 60 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 61 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 62 | - High-density Value line devices are STM32F100xx microcontrollers where 63 | the Flash memory density ranges between 256 and 512 Kbytes. 64 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 65 | the Flash memory density ranges between 256 and 512 Kbytes. 66 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 67 | the Flash memory density ranges between 512 and 1024 Kbytes. 68 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 69 | 70 | *

© COPYRIGHT 2011 STMicroelectronics

71 | */ 72 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210B-EVAL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210B-EVAL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210C-EVAL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM3210C-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F107VC 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210C-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM3210C TrueSTUDIO Project Template for Connectivity line devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM3210C-EVAL: to configure the project for STM32 Connectivity line devices. 45 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 46 | a variable path named "CurPath" which points to the folder containing 47 | "Libraries", "Project" and "Utilities" folders. 48 | - Rebuild all project files: Select the project in the "Project explorer" 49 | window then click on Project->build project menu. 50 | - Run program: Select the project in the "Project explorer" window then click 51 | Run->Debug (F11) 52 | 53 | @note 54 | - Low-density Value line devices are STM32F100xx microcontrollers where the 55 | Flash memory density ranges between 16 and 32 Kbytes. 56 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 57 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 58 | - Medium-density Value line devices are STM32F100xx microcontrollers where 59 | the Flash memory density ranges between 32 and 128 Kbytes. 60 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 61 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 62 | - High-density Value line devices are STM32F100xx microcontrollers where 63 | the Flash memory density ranges between 256 and 512 Kbytes. 64 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 65 | the Flash memory density ranges between 256 and 512 Kbytes. 66 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 67 | the Flash memory density ranges between 512 and 1024 Kbytes. 68 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 69 | 70 | *

© COPYRIGHT 2011 STMicroelectronics

71 | */ 72 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210C-EVAL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210C-EVAL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM3210E-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F103ZE 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM3210E TrueSTUDIO Project Template for High-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM3210E-EVAL: to configure the project for STM32 High-density devices. 45 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 46 | a variable path named "CurPath" which points to the folder containing 47 | "Libraries", "Project" and "Utilities" folders. 48 | - Rebuild all project files: Select the project in the "Project explorer" 49 | window then click on Project->build project menu. 50 | - Run program: Select the project in the "Project explorer" window then click 51 | Run->Debug (F11) 52 | 53 | @note 54 | - Low-density Value line devices are STM32F100xx microcontrollers where the 55 | Flash memory density ranges between 16 and 32 Kbytes. 56 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 57 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 58 | - Medium-density Value line devices are STM32F100xx microcontrollers where 59 | the Flash memory density ranges between 32 and 128 Kbytes. 60 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 61 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 62 | - High-density Value line devices are STM32F100xx microcontrollers where 63 | the Flash memory density ranges between 256 and 512 Kbytes. 64 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 65 | the Flash memory density ranges between 256 and 512 Kbytes. 66 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 67 | the Flash memory density ranges between 512 and 1024 Kbytes. 68 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 69 | 70 | *

© COPYRIGHT 2011 STMicroelectronics

71 | */ 72 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL_XL/.settings/com.atollic.truestudio.debug.hardware_device.prefs: -------------------------------------------------------------------------------- 1 | #Tue Jul 13 09:06:52 GMT+01:00 2010 2 | BOARD=STM3210E-EVAL 3 | CODE_LOCATION=FLASH 4 | ENDIAN=Little-endian 5 | MCU=STM32F103ZG 6 | MODEL=Lite 7 | PROBE=ST-LINK 8 | PROJECT_FORMAT_VERSION=1 9 | TARGET=STM32 10 | VERSION=1.4.0 11 | eclipse.preferences.version=1 12 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL_XL/readme.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page TrueSTUDIO_STM3210E_XL TrueSTUDIO Project Template for XL-density devices 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* 6 | * @file readme.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This sub directory contains all the user modifiable files 11 | * needed to create a new project linked with the STM32F10x 12 | * Standard Peripheral Library and working with TrueSTUDIO software 13 | * toolchain (Version 2.0.1 and later) 14 | ****************************************************************************** 15 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 16 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 17 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 18 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 19 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 20 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 21 | ****************************************************************************** 22 | @endverbatim 23 | 24 | @par Directory contents 25 | 26 | - project .cproject/.project: A pre-configured project file with the provided 27 | library structure that produces an executable 28 | image with TrueSTUDIO. 29 | 30 | - stm32_flash.ld: This file is the TrueSTUDIO linker script used to 31 | place program code (readonly) in internal FLASH 32 | and data (readwrite, Stack and Heap)in internal 33 | SRAM. 34 | You can customize this file to your need. 35 | 36 | @par How to use it ? 37 | 38 | - Open the TrueSTUDIO toolchain. 39 | - Click on File->Switch Workspace->Other and browse to TrueSTUDIO workspace 40 | directory. 41 | - Click on File->Import, select General->'Existing Projects into Workspace' 42 | and then click "Next". 43 | - Browse to the TrueSTUDIO workspace directory and select the project: 44 | - STM3210E-EVAL_XL: to configure the project for STM32 XL-density devices. 45 | - Under Windows->Preferences->General->Workspace->Linked Resources, add 46 | a variable path named "CurPath" which points to the folder containing 47 | "Libraries", "Project" and "Utilities" folders. 48 | - Rebuild all project files: Select the project in the "Project explorer" 49 | window then click on Project->build project menu. 50 | - Run program: Select the project in the "Project explorer" window then click 51 | Run->Debug (F11) 52 | 53 | @note 54 | - Low-density Value line devices are STM32F100xx microcontrollers where the 55 | Flash memory density ranges between 16 and 32 Kbytes. 56 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 57 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 58 | - Medium-density Value line devices are STM32F100xx microcontrollers where 59 | the Flash memory density ranges between 32 and 128 Kbytes. 60 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 61 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 62 | - High-density Value line devices are STM32F100xx microcontrollers where 63 | the Flash memory density ranges between 256 and 512 Kbytes. 64 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 65 | the Flash memory density ranges between 256 and 512 Kbytes. 66 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 67 | the Flash memory density ranges between 512 and 1024 Kbytes. 68 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 69 | 70 | *

© COPYRIGHT 2011 STMicroelectronics

71 | */ 72 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL_XL/stm32_flash.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/STM3210E-EVAL_XL/stm32_flash.ld -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/note.txt: -------------------------------------------------------------------------------- 1 | /** 2 | @page note Note for TrueSTUDIO 3 | 4 | @verbatim 5 | ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************** 6 | * @file note.txt 7 | * @author MCD Application Team 8 | * @version V3.5.0 9 | * @date 08-April-2011 10 | * @brief This file contains the needed step to use "printf" with TrueSTUDIO 11 | * toolchain. 12 | ****************************************************************************** 13 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 14 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 16 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 17 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 18 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | ****************************************************************************** 20 | @endverbatim 21 | 22 | The C runtime library include many functions, including some that typically 23 | handle I/O. The I/O related runtime functions include printf(), fopen(), fclose(), 24 | and many others. 25 | 26 | It is common to redirect the I/O from these functions to the actual embedded 27 | platform, such as redirecting printf() output to an LCD display or a serial cable, 28 | or to redirect file operations like fopen() and fclose() to some Flash file 29 | system middleware. 30 | 31 | The free Lite version of TrueSTUDIO do not support I/O redirection, and instead 32 | have do-nothing stubs compiled into the C runtime library. 33 | 34 | To support printf() redirection in the professional version, you should do the following: 35 | - Open TrueSTUDIO professional and load your project. 36 | - In the Project explorer, Right click on the project and select New->Other... 37 | - Expand System calls 38 | - Select Minimal System Calls Implementation and click next. 39 | - Click on Finish and verify that "syscalls.c" is added to your project. 40 | - Add the following code in the _write() function in "syscalls.c". 41 | 42 | @code 43 | /*****************************************/ 44 | int Index; 45 | 46 | for (Index = 0; Index < len; Index++) 47 | { 48 | __io_putchar( *ptr++ ); 49 | } 50 | 51 | return len; 52 | /*****************************************/ 53 | @endcode 54 | 55 | - Finally, Rebuild your project. 56 | 57 | @note 58 | - Low-density Value line devices are STM32F100xx microcontrollers where the 59 | Flash memory density ranges between 16 and 32 Kbytes. 60 | - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx 61 | microcontrollers where the Flash memory density ranges between 16 and 32 Kbytes. 62 | - Medium-density Value line devices are STM32F100xx microcontrollers where 63 | the Flash memory density ranges between 32 and 128 Kbytes. 64 | - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx 65 | microcontrollers where the Flash memory density ranges between 32 and 128 Kbytes. 66 | - High-density Value line devices are STM32F100xx microcontrollers where the 67 | Flash memory density ranges between 256 and 512 Kbytes. 68 | - High-density devices are STM32F101xx and STM32F103xx microcontrollers where 69 | the Flash memory density ranges between 256 and 512 Kbytes. 70 | - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where 71 | the Flash memory density ranges between 512 and 1024 Kbytes. 72 | - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers. 73 | 74 | *

© COPYRIGHT 2011 STMicroelectronics

75 | */ 76 | -------------------------------------------------------------------------------- /src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/stm32f10x_flash_extsram.ld: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Project/STM32F10x_StdPeriph_Template/TrueSTUDIO/stm32f10x_flash_extsram.ld -------------------------------------------------------------------------------- /src/Release_Notes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Release_Notes.html -------------------------------------------------------------------------------- /src/Scripts/copy_firmware.bat: -------------------------------------------------------------------------------- 1 | echo %cd% 2 | 3 | set ROOT_PATH=.\..\.. 4 | set HEX_FILE=%ROOT_PATH%\..\Project\STM32F10x_StdPeriph_Template\MDK-ARM\STM3210B-EVAL\*.hex 5 | set BIN_FILE=%ROOT_PATH%\..\Project\STM32F10x_StdPeriph_Template\MDK-ARM\STM3210B-EVAL\*.bin 6 | set DST_DIR=%ROOT_PATH%\..\Firmware\ 7 | if exist %HEX_FILE% (XCOPY /Y /S /F %HEX_FILE% %DST_DIR%) 8 | if exist %BIN_FILE% (XCOPY /Y /S /F %BIN_FILE% %DST_DIR%) 9 | exit -------------------------------------------------------------------------------- /src/Scripts/create_bin.bat: -------------------------------------------------------------------------------- 1 | echo %cd% 2 | set ROOT_PATH=.\..\.. 3 | set SRC=%ROOT_PATH%\..\Project\STM32F10x_StdPeriph_Template\MDK-ARM\STM3210B-EVAL\*.hex 4 | set TOOL=%ROOT_PATH%\..\Bin\hex2bin.exe 5 | 6 | if exist %SRC% (%TOOL% %SRC%) 7 | exit -------------------------------------------------------------------------------- /src/Scripts/createbin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/Scripts/createbin.py -------------------------------------------------------------------------------- /src/User/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file IAP/src/main.c 4 | * @author MCD Application Team 5 | * @version V3.3.0 6 | * @date 10/15/2010 7 | * @brief Main program body 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2010 STMicroelectronics

19 | */ 20 | 21 | /** @addtogroup IAP 22 | * @{ 23 | */ 24 | 25 | /* Includes ------------------------------------------------------------------*/ 26 | #include "common.h" 27 | 28 | /* Private typedef -----------------------------------------------------------*/ 29 | /* Private define ------------------------------------------------------------*/ 30 | /* Private macro -------------------------------------------------------------*/ 31 | /* Private variables ---------------------------------------------------------*/ 32 | extern pFunction Jump_To_Application; 33 | extern uint32_t JumpAddress; 34 | 35 | /* Private function prototypes -----------------------------------------------*/ 36 | static void IAP_Init(void); 37 | 38 | /* Private functions ---------------------------------------------------------*/ 39 | uint8_t command = 0; 40 | /** 41 | * @brief Main program. 42 | * @param None 43 | * @retval None 44 | */ 45 | int main(void) 46 | { 47 | /* Flash unlock */ 48 | FLASH_Unlock(); 49 | 50 | /* Test if Key push-button on STM3210X-EVAL Board is pressed */ 51 | if (command == 0x00) 52 | { 53 | /* If Key is pressed */ 54 | /* Execute the IAP driver in order to re-program the Flash */ 55 | IAP_Init(); 56 | SerialPutString("\r\n"); 57 | SerialPutString("\r\n*******************************************************************************"); 58 | SerialPutString("\r\n* (C) COPYRIGHT 2019 UncleMac *"); 59 | SerialPutString("\r\n* *"); 60 | SerialPutString("\r\n* ____ __ __ __ *"); 61 | SerialPutString("\r\n* / __ )____ ____ / /_/ /___ ____ _____/ /__ _____ *"); 62 | SerialPutString("\r\n* / __ / __ \\/ __ \\/ __/ / __ \\/ __ `/ __ / _ \\/ ___/ *"); 63 | SerialPutString("\r\n* / /_/ / /_/ / /_/ / /_/ / /_/ / /_/ / /_/ / __/ / *"); 64 | SerialPutString("\r\n* /_____/\\____/\\____/\\__/_/\\____/\\__,_/\\__,_/\\___/_/ *"); 65 | SerialPutString("\r\n* *"); 66 | SerialPutString("\r\n* Bootloader for PMSM on stm32f10cbt6(Version 0.0.1) *"); 67 | SerialPutString("\r\n* *"); 68 | SerialPutString("\r\n* https://blog.csdn.net/u010632165 *"); 69 | SerialPutString("\r\n* *"); 70 | SerialPutString("\r\n* By UncleMac *"); 71 | SerialPutString("\r\n* *"); 72 | SerialPutString("\r\n*******************************************************************************"); 73 | SerialPutString("\r\n\r\n"); 74 | Main_Menu (); 75 | } 76 | /* Keep the user application running */ 77 | else 78 | { 79 | /* Test if user code is programmed starting from address "ApplicationAddress" */ 80 | if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000) 81 | { 82 | /* Jump to user application */ 83 | JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4); 84 | Jump_To_Application = (pFunction) JumpAddress; 85 | /* Initialize user application's Stack Pointer */ 86 | __set_MSP(*(__IO uint32_t*) ApplicationAddress); 87 | Jump_To_Application(); 88 | } 89 | } 90 | 91 | while (1) 92 | {} 93 | } 94 | #define COM_PORT USART3 95 | /** 96 | * @brief Initialize the IAP: Configure RCC, USART and GPIOs. 97 | * @param None 98 | * @retval None 99 | */ 100 | void IAP_Init(void) 101 | { 102 | usart_init(); 103 | } 104 | 105 | #ifdef USE_FULL_ASSERT 106 | /** 107 | * @brief Reports the name of the source file and the source line number 108 | * where the assert_param error has occurred. 109 | * @param file: pointer to the source file name 110 | * @param line: assert_param error line source number 111 | * @retval None 112 | */ 113 | void assert_failed(uint8_t* file, uint32_t line) 114 | { 115 | /* User can add his own implementation to report the file name and line number, 116 | ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ 117 | 118 | /* Infinite loop */ 119 | while (1) 120 | { 121 | } 122 | } 123 | #endif 124 | 125 | /** 126 | * @} 127 | */ 128 | 129 | /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/ 130 | -------------------------------------------------------------------------------- /src/User/stm32f10x_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_conf.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 08-April-2011 7 | * @brief Library configuration file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F10x_CONF_H 24 | #define __STM32F10x_CONF_H 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | /* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */ 28 | #include "stm32f10x_adc.h" 29 | #include "stm32f10x_bkp.h" 30 | #include "stm32f10x_can.h" 31 | #include "stm32f10x_cec.h" 32 | #include "stm32f10x_crc.h" 33 | #include "stm32f10x_dac.h" 34 | #include "stm32f10x_dbgmcu.h" 35 | #include "stm32f10x_dma.h" 36 | #include "stm32f10x_exti.h" 37 | #include "stm32f10x_flash.h" 38 | #include "stm32f10x_fsmc.h" 39 | #include "stm32f10x_gpio.h" 40 | #include "stm32f10x_i2c.h" 41 | #include "stm32f10x_iwdg.h" 42 | #include "stm32f10x_pwr.h" 43 | #include "stm32f10x_rcc.h" 44 | #include "stm32f10x_rtc.h" 45 | #include "stm32f10x_sdio.h" 46 | #include "stm32f10x_spi.h" 47 | #include "stm32f10x_tim.h" 48 | #include "stm32f10x_usart.h" 49 | #include "stm32f10x_wwdg.h" 50 | #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ 51 | 52 | /* Exported types ------------------------------------------------------------*/ 53 | /* Exported constants --------------------------------------------------------*/ 54 | /* Uncomment the line below to expanse the "assert_param" macro in the 55 | Standard Peripheral Library drivers code */ 56 | /* #define USE_FULL_ASSERT 1 */ 57 | 58 | /* Exported macro ------------------------------------------------------------*/ 59 | #ifdef USE_FULL_ASSERT 60 | 61 | /** 62 | * @brief The assert_param macro is used for function's parameters check. 63 | * @param expr: If expr is false, it calls assert_failed function which reports 64 | * the name of the source file and the source line number of the call 65 | * that failed. If expr is true, it returns no value. 66 | * @retval None 67 | */ 68 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 69 | /* Exported functions ------------------------------------------------------- */ 70 | void assert_failed(uint8_t* file, uint32_t line); 71 | #else 72 | #define assert_param(expr) ((void)0) 73 | #endif /* USE_FULL_ASSERT */ 74 | 75 | #endif /* __STM32F10x_CONF_H */ 76 | 77 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 78 | -------------------------------------------------------------------------------- /src/User/stm32f10x_it.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 08-April-2011 7 | * @brief Main Interrupt Service Routines. 8 | * This file provides template for all exceptions handler and 9 | * peripherals interrupt service routine. 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 14 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 15 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 16 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 17 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 18 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | * 20 | *

© COPYRIGHT 2011 STMicroelectronics

21 | ****************************************************************************** 22 | */ 23 | 24 | /* Includes ------------------------------------------------------------------*/ 25 | #include "stm32f10x_it.h" 26 | #include "sys_timer.h" 27 | /** @addtogroup STM32F10x_StdPeriph_Template 28 | * @{ 29 | */ 30 | 31 | /* Private typedef -----------------------------------------------------------*/ 32 | /* Private define ------------------------------------------------------------*/ 33 | /* Private macro -------------------------------------------------------------*/ 34 | /* Private variables ---------------------------------------------------------*/ 35 | /* Private function prototypes -----------------------------------------------*/ 36 | /* Private functions ---------------------------------------------------------*/ 37 | 38 | /******************************************************************************/ 39 | /* Cortex-M3 Processor Exceptions Handlers */ 40 | /******************************************************************************/ 41 | 42 | /** 43 | * @brief This function handles NMI exception. 44 | * @param None 45 | * @retval None 46 | */ 47 | void NMI_Handler(void) 48 | { 49 | } 50 | 51 | /** 52 | * @brief This function handles Hard Fault exception. 53 | * @param None 54 | * @retval None 55 | */ 56 | void HardFault_Handler(void) 57 | { 58 | /* Go to infinite loop when Hard Fault exception occurs */ 59 | while (1) 60 | { 61 | } 62 | } 63 | 64 | /** 65 | * @brief This function handles Memory Manage exception. 66 | * @param None 67 | * @retval None 68 | */ 69 | void MemManage_Handler(void) 70 | { 71 | /* Go to infinite loop when Memory Manage exception occurs */ 72 | while (1) 73 | { 74 | } 75 | } 76 | 77 | /** 78 | * @brief This function handles Bus Fault exception. 79 | * @param None 80 | * @retval None 81 | */ 82 | void BusFault_Handler(void) 83 | { 84 | /* Go to infinite loop when Bus Fault exception occurs */ 85 | while (1) 86 | { 87 | } 88 | } 89 | 90 | /** 91 | * @brief This function handles Usage Fault exception. 92 | * @param None 93 | * @retval None 94 | */ 95 | void UsageFault_Handler(void) 96 | { 97 | /* Go to infinite loop when Usage Fault exception occurs */ 98 | while (1) 99 | { 100 | } 101 | } 102 | 103 | /** 104 | * @brief This function handles SVCall exception. 105 | * @param None 106 | * @retval None 107 | */ 108 | void SVC_Handler(void) 109 | { 110 | } 111 | 112 | /** 113 | * @brief This function handles Debug Monitor exception. 114 | * @param None 115 | * @retval None 116 | */ 117 | void DebugMon_Handler(void) 118 | { 119 | } 120 | 121 | /** 122 | * @brief This function handles PendSVC exception. 123 | * @param None 124 | * @retval None 125 | */ 126 | void PendSV_Handler(void) 127 | { 128 | } 129 | 130 | /** 131 | * @brief This function handles SysTick Handler. 132 | * @param None 133 | * @retval None 134 | */ 135 | void SysTick_Handler(void) 136 | { 137 | gw_hal_dec(); 138 | } 139 | 140 | /******************************************************************************/ 141 | /* STM32F10x Peripherals Interrupt Handlers */ 142 | /* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ 143 | /* available peripheral interrupt handler's name please refer to the startup */ 144 | /* file (startup_stm32f10x_xx.s). */ 145 | /******************************************************************************/ 146 | 147 | /** 148 | * @brief This function handles PPP interrupt request. 149 | * @param None 150 | * @retval None 151 | */ 152 | /*void PPP_IRQHandler(void) 153 | { 154 | }*/ 155 | 156 | /** 157 | * @} 158 | */ 159 | 160 | 161 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 162 | -------------------------------------------------------------------------------- /src/User/stm32f10x_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 08-April-2011 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F10x_IT_H 24 | #define __STM32F10x_IT_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Includes ------------------------------------------------------------------*/ 31 | #include "stm32f10x.h" 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported macro ------------------------------------------------------------*/ 36 | /* Exported functions ------------------------------------------------------- */ 37 | 38 | void NMI_Handler(void); 39 | void HardFault_Handler(void); 40 | void MemManage_Handler(void); 41 | void BusFault_Handler(void); 42 | void UsageFault_Handler(void); 43 | void SVC_Handler(void); 44 | void DebugMon_Handler(void); 45 | void PendSV_Handler(void); 46 | void SysTick_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32F10x_IT_H */ 53 | 54 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /src/_htmresc/CMSIS_Logo_Final.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/_htmresc/CMSIS_Logo_Final.jpg -------------------------------------------------------------------------------- /src/_htmresc/logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/_htmresc/logo.bmp -------------------------------------------------------------------------------- /src/stm32f10x_stdperiph_lib_um.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hotsauce1861/stm32f10x-bootloader/51c8b996c7531a64f808cddeecdca47023d75019/src/stm32f10x_stdperiph_lib_um.chm --------------------------------------------------------------------------------