검색결과 리스트
CPU에 해당되는 글 19건
- 2014.05.19 망고 z1보드 컴파일러 설정 문제
- 2014.04.15 ADC Polling Mode 사용
- 2014.04.13 REMAP 기능 ( PB4 핀 GPIO사용위함) 1
- 2014.04.13 STOP MODE 설정방법
- 2014.04.13 EXTI (외부인터럽트 설정)
- 2014.04.12 Introducing to STM32 ADC programming(Internal Temperature Sensor)
- 2014.04.10 IAR 브레이크 포인트 잡히지 않을때 ???
- 2014.04.09 stm32f103c8 메모리 설정 확인
- 2013.06.20 BOOT MODE에 관한 내용
- 2013.06.20 Serial DownLoad방법
글
망고 z1보드 컴파일러 설정 문제
이번엔 망고 z1으로 zigbee를 이용한 데모보드를 작업하게 되었다.
http://crztech.iptime.org:8080/Release/mango-Z1/src/ 여기서 소스다운로드
http://www.mangoboard.com/ 는 회로도
근디 시작부터 컴파일 에러..헉..... 고객님 당황하셨어요???
IAR 6.1까지는 괜찬은데..난 6.3
요렇게..
결국 설정문제
1. option 에서 General Options -> Library Configuration 에 보면 전에 없던 CMSIS 체크부분이 있습니다 . 이부분을 체크
2. st제공 Libraries\CMSIS\Core\CM3에서 core_m3.c .h 인가 st 라이브러리에 있는 cmsis 파일 지우거나 해야됩니다
끝...
[출처] 라이브러리 컴파일 에러 (Embedded Crazy Boys) |작성자 qyan
[출처] 라이브러리 컴파일 에raries러 (Embedded Crazy Boys) |작성자 qyan
'CPU > STM32F103' 카테고리의 다른 글
ADC Polling Mode 사용 (0) | 2014.04.15 |
---|---|
REMAP 기능 ( PB4 핀 GPIO사용위함) (1) | 2014.04.13 |
STOP MODE 설정방법 (0) | 2014.04.13 |
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
설정
트랙백
댓글
글
ADC Polling Mode 사용
이번엔adc를 폴링 모드로 사용해보자.
32F103C8T6 CPU의 PA0( ADC12_IN0 ) 포트로 전압을 읽어 보자
VREF는 핀수가 많은 칩은 VREF핀이 따로 나오지만 C8칩은 VDDA , VSSA와 VREF가 내부적으로 연결 되어 있따.
설정은 다음과 같다.
1. GPIO 설정
2. CLOCK설정
3. ADC 설정
void ADC2_volt_Configuration(void)
{
ADC_InitTypeDef ADC_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
//====================================
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Enable ADC2 and GPIOC clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC2 , ENABLE);
/* ADC2 configuration ------------------------------------------------------*/
ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
ADC_InitStructure.ADC_ScanConvMode = DISABLE;
ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
ADC_InitStructure.ADC_NbrOfChannel = 1;
ADC_Init(ADC2, &ADC_InitStructure);
/* ADC2 regular channel12 configuration */
ADC_RegularChannelConfig(ADC2, ADC_Channel_0, 1, ADC_SampleTime_41Cycles5);
/* Enable ADC2 */
ADC_Cmd(ADC2, ENABLE);
/* Enable ADC2 reset calibaration register */
ADC_ResetCalibration(ADC2);
/* Check the end of ADC21 reset calibration register */
while(ADC_GetResetCalibrationStatus(ADC2));
/* Start ADC2 calibaration */
ADC_StartCalibration(ADC2);
/* Check the end of ADC1 calibration */
while(ADC_GetCalibrationStatus(ADC2));
}
사용법은 요렇게. VDDA가 3.3V
uint16_t ADC2_vold_Read(void)
{
uint16_t AD_value;
ADC_SoftwareStartConvCmd(ADC2, ENABLE);
//wait for conversion complete
while(!ADC_GetFlagStatus(ADC2, ADC_FLAG_EOC)){}
//read ADC value
AD_value=ADC_GetConversionValue(ADC2);
//clear EOC flag
ADC_ClearFlag(ADC2, ADC_FLAG_EOC);
return AD_value;
}
끝
'CPU > STM32F103' 카테고리의 다른 글
망고 z1보드 컴파일러 설정 문제 (0) | 2014.05.19 |
---|---|
REMAP 기능 ( PB4 핀 GPIO사용위함) (1) | 2014.04.13 |
STOP MODE 설정방법 (0) | 2014.04.13 |
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
설정
트랙백
댓글
글
REMAP 기능 ( PB4 핀 GPIO사용위함)
이번에는 REMAP를 해보겠습니다.
왜 하냐??? PB4핀이 움직이지 않아서 확인 해보았더니...JTAG기능으로 우선되어 있더군요.
NJTRST로 되어 있는 것을 PB4로 사용하기 위해서는 REMAP를 해주어야 합니다.
MCU_GPIO_Configuration();
/* Configure PC13.PA11 in interrupt mode */
EXTI15_10_Config();
GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE); // it's for PB4 PIN( org is NJTRST pin) , it have to locate last after gpio config.
순서는 GPIO를 초기화 후 마지막에 해주어야 됩니다. 먼저 해주니 움직이지 않는 군요.
경우엔 따라서 JTAG전체 핀을 사용해야 되는 경우도 생기겠죠?
그럴때 아래와 같이
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable , ENABLE);
요렇게 하거나 아래의 것을 참보하여 하면 됩니다.
#define GPIO_Remap_SWJ_NoJTRST ((uint32_t)0x00300100) /*!< Full SWJ Enabled (JTAG-DP + SW-DP) but without JTRST */
#define GPIO_Remap_SWJ_JTAGDisable ((uint32_t)0x00300200) /*!< JTAG-DP Disabled and SW-DP Enabled */
#define GPIO_Remap_SWJ_Disable ((uint32_t)0x00300400) /*!< Full SWJ Disabled (JTAG-DP + SW-DP) */
아래 디볼트 세팅에 관한 부분입니다. PB4가 기본 JNTRST고 리멥하면 PB4로 쓸수 있는 구조네요...
잘 만들었네요...
그럼
'CPU > STM32F103' 카테고리의 다른 글
망고 z1보드 컴파일러 설정 문제 (0) | 2014.05.19 |
---|---|
ADC Polling Mode 사용 (0) | 2014.04.15 |
STOP MODE 설정방법 (0) | 2014.04.13 |
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
설정
트랙백
댓글
글
STOP MODE 설정방법
이번에는 절전모드인 STOP MODE에 대해 구현해 보기로 한다.
아래 그림에 보듯이 절전을 위한 STOP모드는 3.3V 에서 24uA정도 소비한다.
결론적으로 STOP모드시 GPIO는 OUT 설정된 그대로 유지되지만, PWM은 출력되지 않는다.
STOP WAKEUP은 여러 경우가 있지만 EXTI를 통해서 WAKEUP를 하게 만들었다.
STOP복귀시는 RCC쪽 세팅을 다시 해주어야 하며, 이것만 해주면 모든 주변기기들이 동작한다.
STOP MODE 시작
/* Request to enter STOP mode with regulator in low power mode*/
PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
STOP WAKEUP 은 EXIT부분에 신호를 넣어서( 물론 외부 인터럽트 설정은 이전 글을 참조한다)
/* Configures system clock after wake-up from STOP: enable HSE, PLL and select
PLL as system clock source (HSE and PLL are disabled in STOP mode) */
SYSCLKConfig_STOP_Run();
void SYSCLKConfig_STOP_Run(void)
{
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
}
하지만 아래는 어떤 경우 사용되는지 알수 없지만 ST본 소스 초기화 에 설정된내용이나...없어도 동작함을 확인하였다.
//RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE); // power interface clock, backup interface clock
소비전류의 측정은 다음기회에.....
'CPU > STM32F103' 카테고리의 다른 글
ADC Polling Mode 사용 (0) | 2014.04.15 |
---|---|
REMAP 기능 ( PB4 핀 GPIO사용위함) (1) | 2014.04.13 |
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
IAR 브레이크 포인트 잡히지 않을때 ??? (0) | 2014.04.10 |
설정
트랙백
댓글
글
EXTI (외부인터럽트 설정)
위의 보는 것과 같이 외부 인터럽트는 EXTI0-----EXTI15 까지 이고 각 포트의 핀 번호가 인터럽트 핀과 매치된다. ( 그림과 같이 PA0,PB0......가 EXTI0 인터럽트로 연결된다.)
그리고 인터럽트 백터를 보면 EXTI0,1,2,3,4, 5-9, 10-15로 나뉜다. 또한 인터럽트 우선순위는 0부터 높고 10-15가 가장 낮다.
void EXTI0_Config(void)
{
/* Enable GPIOA clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
/* Configure PA.00 pin as input floating */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* Enable AFIO clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
/* Connect EXTI0 Line to PA.00 pin */
GPIO_EXTILineConfig(GPIO_PortSourceGPIOA, GPIO_PinSource0);
/* Configure EXTI0 line */
EXTI_InitStructure.EXTI_Line = EXTI_Line0;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Rising;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
/* Enable and set EXTI0 Interrupt to the lowest priority */
NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x0F;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
메인 에서 위의 소스를 초기화 작업한다.
stm32f10x_it.c에서 아래와 같이 백터를 추가한다.
void EXTI0_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line0) != RESET)
{
/* do something */
/* Clear the EXTI line 0 pending bit */
EXTI_ClearITPendingBit(EXTI_Line0);
}
}
stm32f10x_it.h 에 추가한다.
void EXTI0_IRQHandler(void);
그럼 설정된것 같이 인터럽트가 발생한다.
'CPU > STM32F103' 카테고리의 다른 글
REMAP 기능 ( PB4 핀 GPIO사용위함) (1) | 2014.04.13 |
---|---|
STOP MODE 설정방법 (0) | 2014.04.13 |
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
IAR 브레이크 포인트 잡히지 않을때 ??? (0) | 2014.04.10 |
stm32f103c8 메모리 설정 확인 (0) | 2014.04.09 |
설정
트랙백
댓글
글
Introducing to STM32 ADC programming(Internal Temperature Sensor)
http://www.embedds.com/introducing-to-stm32-adc-programming-part2/
After we had a quick overview of STM32 ADC peripheral we can start digging deeper in to specifics. In order to understand simple things lets go with simplest case – single conversion mode. In this mode ADC does one conversion and then stops. After ADC conversion result is stored in to 16-bit ADC_DR data register (remember that conversion result is 12-bit), then End of Conversion (EOC) flag is set and interrupt is generated if EOCIE flag is set. Same situation is if injected channel is converted. The difference is that result is stored in to corresponding ADC_DRJx register, JEOC flag is set and interrupt generated if JEOCIE flag is set.
In our example we are going to measure the internal temperature sensor value and send it using USART. Temperature sensor is internally connected to ADC1_IN16 channel. Algorithm will start single conversion and wait for conversion complete flag EOC. Then we are going to read ADC value from ADC_DR register, which later will be used to calculate in temperature value in Celsius and sent via USART. So we should see value in terminal screen. As usually we are going to use Standard peripheral library and CMSIS functions. The code for single conversion is pretty short:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #include "stm32f10x.h" #include "usart.h" #include <stdio.h> uint16_t AD_value; const uint16_t V25 = 1750; // when V25=1.41V at ref 3.3V const uint16_t Avg_Slope = 5; //when avg_slope=4.3mV/C at ref 3.3V uint16_t TemperatureC; int main( void ) { //initialize USART1 Usart1Init(); //enable ADC1 clock RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE); ADC_InitTypeDef ADC_InitStructure; //ADC1 configuration //select independent conversion mode (single) ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; //We will convert single channel only ADC_InitStructure.ADC_ScanConvMode = DISABLE; //we will convert one time ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; //select no external triggering ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; //right 12-bit data alignment in ADC data register ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; //single channel conversion ADC_InitStructure.ADC_NbrOfChannel = 1; //load structure values to control and status registers ADC_Init(ADC1, &ADC_InitStructure); //wake up temperature sensor ADC_TempSensorVrefintCmd(ENABLE); //ADC1 channel16 configuration //we select 41.5 cycles conversion for channel16 //and rank=1 which doesn't matter in single mode ADC_RegularChannelConfig(ADC1, ADC_Channel_16, 1, ADC_SampleTime_41Cycles5); //Enable ADC1 ADC_Cmd(ADC1, ENABLE); //Enable ADC1 reset calibration register ADC_ResetCalibration(ADC1); //Check the end of ADC1 reset calibration register while (ADC_GetResetCalibrationStatus(ADC1)); //Start ADC1 calibration ADC_StartCalibration(ADC1); //Check the end of ADC1 calibration while (ADC_GetCalibrationStatus(ADC1)); //Start ADC1 Software Conversion ADC_SoftwareStartConvCmd(ADC1, ENABLE); //wait for conversion complete while (!ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC)){} //read ADC value AD_value=ADC_GetConversionValue(ADC1); //clear EOC flag ADC_ClearFlag(ADC1, ADC_FLAG_EOC); printf ( "\r\n ADC value: %d \r\n" , AD_value); TemperatureC = (uint16_t)((V25-AD_value)/Avg_Slope+25); printf ( "Temperature: %d%cC\r\n" , TemperatureC, 176); while (1) { //interrupts does the job } } |
Using standard peripheral functions everything becomes obviously simple. First we set enable ADC peripheral clock:
1 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE); |
It is connected to APB2 bus. We aren’t using any prescallers here so it works at 24MHz here.
Next thing is to set up ADC mode using ADC_initstructure. Here we select ADC_Mode_Independent which in our case is single conversion. Then we disable scan mode and continuous scan as we want only single conversion and stop. We also disable any external triggering and select data to be right aligned. In order to access temperature sensor we need to bring it from power down by writing TSVREFE bit in ADC_CR2 register. This is done by using command:
1 | ADC_TempSensorVrefintCmd(ENABLE); |
After ADC is set up and sensor is waked we can configure channel 16. Here we need to set several parameters including channel number, index in group and channel sampling time:
1 | ADC_RegularChannelConfig(ADC1, ADC_Channel_16, 1, ADC_SampleTime_41Cycles5); |
Then we enable ADC:
1 | ADC_Cmd(ADC1, ENABLE); |
After microcontroller is powered on it is recommended to run ADC self calibration. This calculates error correction codes for capacitors and reduces over all error in result.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | //Enable ADC1 reset calibration register ADC_ResetCalibration(ADC1); //Check the end of ADC1 reset calibration register while (ADC_GetResetCalibrationStatus(ADC1)); //Start ADC1 calibration ADC_StartCalibration(ADC1); //Check the end of ADC1 calibration while (ADC_GetCalibrationStatus(ADC1)); |
Now its time to start conversion. The function for this is:
1 | ADC_SoftwareStartConvCmd(ADC1, ENABLE); |
Next thing is to wait for conversion complete by checking for ADC_FLAG_EOC flag in status register:
1 | while (!ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC)){} |
Then we can take ADC value from data register:
1 | AD_value=ADC_GetConversionValue(ADC1); |
After reading temperature sensor we get some 12-bit digital value. In order to calculate temperature we need to use formula:
Temperature = (V25-AD_value)/Avg_slope+25
V25 and Avg_slope values can be found on microcontroller datasheet:
Here we get that V25 is typically 1.41V and Avg_Slope=4.3. When using 3.3V supply as reference we get approximately V25=1750 and Avg_Slope=5. Having these temperature value can be easily calculated:
1 | TemperatureC = (uint16_t)((V25-AD_value)/Avg_Slope+25); |
Don’t actually rely on readings as manufacturer states it can vary from chip to chip up to 45ºC. It can serve only to detect temperature variations inside chip. It is always better to use external sensor for accurate readings.
This is how data looks in terminal screen. First temperature is read normally and second with some heat applied to microcontroller:
This code is only to demonstrate simplest ADC usage. Practically it is Very inefficient because there are loop used for waiting ADC to be complete. There are better ways of doing this like using interrupts or DMA. Next time we will try different ADC mode used in efficient way.
Example source code is here: STM32DiscoveryADCSingle.zip
'CPU > STM32F103' 카테고리의 다른 글
STOP MODE 설정방법 (0) | 2014.04.13 |
---|---|
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
IAR 브레이크 포인트 잡히지 않을때 ??? (0) | 2014.04.10 |
stm32f103c8 메모리 설정 확인 (0) | 2014.04.09 |
BOOT MODE에 관한 내용 (0) | 2013.06.20 |
설정
트랙백
댓글
글
IAR 브레이크 포인트 잡히지 않을때 ???
'CPU > STM32F103' 카테고리의 다른 글
EXTI (외부인터럽트 설정) (0) | 2014.04.13 |
---|---|
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
stm32f103c8 메모리 설정 확인 (0) | 2014.04.09 |
BOOT MODE에 관한 내용 (0) | 2013.06.20 |
Serial DownLoad방법 (0) | 2013.06.20 |
설정
트랙백
댓글
글
stm32f103c8 메모리 설정 확인
http://harinadha.wordpress.com/tag/iar-embedded-workbench/
'CPU > STM32F103' 카테고리의 다른 글
Introducing to STM32 ADC programming(Internal Temperature Sensor) (0) | 2014.04.12 |
---|---|
IAR 브레이크 포인트 잡히지 않을때 ??? (0) | 2014.04.10 |
BOOT MODE에 관한 내용 (0) | 2013.06.20 |
Serial DownLoad방법 (0) | 2013.06.20 |
STM32 TIM3 PWM MODE (0) | 2013.02.08 |
설정
트랙백
댓글
글
BOOT MODE에 관한 내용
이번엔 STM32F103의 BOOT모드에 대하여 알아 보겠습니다.
Bootloader activation
The bootloader is automatically activated by configuring the BOOT0 and BOOT1 pins in the
specific “System memory” configuration (see Table 2) and then by applying a reset.
Depending on the used pin configuration, the Flash memory, system memory or SRAM is
selected as the boot space, as shown in Table 2 below.
In some products, BOOT1 is not an I/O but a bit in the option byte area. This is the case for
the STM32F05x and STM32F3xx devices where BOOT1 is configured through nBoot1 bit in
the option bytes.
● When nBoot1 bit is set to 1, it corresponds to BOOT1 reset to 0 in Table 2
● When nBoot1 bit is reset to 0, it corresponds to BOOT1 set to 1 n Table 2.
Table 2 shows that the STM32 microcontrollers enter System memory boot mode if the
BOOT pins are configured as follows:
● BOOT0 = 1
● BOOT1 = 0
The values on the BOOT pins are latched on the fourth rising edge of SYSCLK after a reset.
Table 2. Boot pin configuration
Boot mode selection pins Boot mode Aliasing
BOOT1 BOOT0
X 0 User Flash memory User Flash memory is selected as the boot space
0 1 System memory System memory is selected as the boot space
1 1 Embedded SRAM Embedded SRAM is selected as the boot space
BOOT0를 가지고 1로 만들어 다운로드 하는 형태네요.
UART1를사용하여 하긴 했지만 문서상 여러가지 시리얼 다운로드가 가능한것 같은데...좀더 공부가 필요하지만 할것이 많아 PASS
내용중 DUAL BOOT모드가 있는데. XL 모델에서는 된다네요. 이건 원격 다운로드를 이용하여도 될듯하네요..
'CPU > STM32F103' 카테고리의 다른 글
IAR 브레이크 포인트 잡히지 않을때 ??? (0) | 2014.04.10 |
---|---|
stm32f103c8 메모리 설정 확인 (0) | 2014.04.09 |
Serial DownLoad방법 (0) | 2013.06.20 |
STM32 TIM3 PWM MODE (0) | 2013.02.08 |
STM32F103 TIM2 OUTPUT COMPARE TIMMING (0) | 2013.02.08 |
설정
트랙백
댓글
글
Serial DownLoad방법
이 번엔 stm32의 시리얼 다운로드를 알아보도록 하자.
1. bin 생성
IAR컴파일러에서 프로젝트이름 선택 - 왼쪽마우스 - OPTION선택 하여
오른쪽 선택에서 Output Convert 선택 하여 Generate addtional output를 선택
하면 project directory\exe\에 *.bin 파일이 생성된다.
2. HW boot mode 변경
부트옵션 핀이 BOOT0 = high, BOOT1 = low 으로 설정된 경우에
는 시스템 롬에 내장된 부트로더가 실행되고 UART1 포트를 통해 사용자 프로그램을 다운로드 할 수 있다. BOOT0 = low 인 경우에는 사용자 프로그램이 실행된다.
3. ST Flash Loader Demonstrator 실행
연결된 comport를 확인하여 설정하고 나머지는 위와 같이 설정한다. -> NEXT
NEXT
현 CPU는 STM32F103VBT6로서 128K가 자동설정된다.
DownLoad to device를 클릭하고 생성된 bin 파일을 선택한다.
@8000000는 플레시 어드레스 같다. 다운로드 선택 가능하다 즉 BOOT로더를 심을수 있을것 같다.
-->NEXT
다운로드가 진행된다.
다운로드가 끝나면 아래와 같이 표시된다.
RESET하면 APP가 실행된다.
끝...
PS> 예전 CPU는 Write전용 Tool이 꼭 필요했지만 STM는 시리얼 다운로드 기능이 있어 Writer없이도 사용가능하여 Tool를 준비 못한 상황에서 요기나게 쓸수 있다. 단 디버거용 RS-232포트가 추가적으로 필요하여 HW 비용이 약간 증가한다는 단점이 있기는 하지만 말이다.
'CPU > STM32F103' 카테고리의 다른 글
stm32f103c8 메모리 설정 확인 (0) | 2014.04.09 |
---|---|
BOOT MODE에 관한 내용 (0) | 2013.06.20 |
STM32 TIM3 PWM MODE (0) | 2013.02.08 |
STM32F103 TIM2 OUTPUT COMPARE TIMMING (0) | 2013.02.08 |
STM32 SysTick 사용하기 (0) | 2013.02.08 |