일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Galileo Gen2
- 동부로봇
- Cortex-M3
- lg smart recovery
- ares note
- DRS-0101
- galileo
- CMSIS
- 허큘렉스
- openocd
- ubuntu
- QT
- Z435
- ICbanq
- Boyue
- HerkuleX
- STM32F10x
- 마스보드
- smartrobot board
- fdisk
- U-boot
- 갈릴레오
- emIDE
- JTAG
- ft2232
- 우분투
- pyside6
- Marsboard
- Python
- usb부팅
- Today
- Total
Life Seed
CMSIS v1.3 Optimize Option - GCC Compile Error 수정 본문
ST에서 제공하는 예제에는 CMSIS v1.3이 포함되어 있다. (ARM에서는 물론 더 상위 버전을 배포중이다.)
해당 코드에 최적화 옵션인 -O1~3 혹은 -Os를 사용하여 컴파일 할 경우 strexb, strexh 함수관련 컴파일 에러가 발생한다.
1) 최적화 옵션 추가
메뉴 > Project > Build Option 실행
Compiler settings의 Compiler Flags의 체크박스에 -O관련 옵션을 체크한다.
2) Compile Error Message
3) 에러 수정
이를 해결하기 위해 ./Libraries/CMSIS/CM3/CoreSupport/core_cm3.c 파일의 732, 749 line에 해당 함수만 optimze 0로 설정하는 attribute를 한줄씩 추가한다.
__attribute__( ( always_inline , optimize("O0")) ) static __INLINE
uint32_t __STREXB(uint8_t value, uint8_t *addr)
{
uint32_t result=0;
__ASM volatile ("strexb %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
return(result);
}
__attribute__( ( always_inline , optimize("O0")) ) static __INLINE
uint32_t __STREXH(uint16_t value, uint16_t *addr)
{
uint32_t result=0;
__ASM volatile ("strexh %0, %2, [%1]" : "=r" (result) : "r" (addr), "r" (value) );
return(result);
}
다시 빌드하면 문제없이 빌드 된다.
참조페이지 :: http://www.atollic.com/index.php/kb/1-kb_building/117-kb_error_in_strexb
cf) strex에 대한 세부적인 사항은 Cortex-M3 의 Devices Generic User Guide 를 참조하자.
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABFFBJB.html