Latest Post
(ARM,Cortex-M3, STM32F207) Mango-M32F2, Project 구성 및 빌드 (3)

Fatal Error[Pe1696]: cannot open source file "stm32f2xx.h" D:\Wk.Src\Mango-M32F2\src\main.c 23


이는 라이브러리 폴더에 대한 include 지정을 하지 않았기 때문입니다.

Mango-M32F2\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F2xx
stm32f2xx.h 폴더에 들어 있습니다.



$PROJ_DIR$\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F2xx
프로젝트 옵션의 C/C++ Compiler 부분의 Preprocessor 부분에 내용을 추가합니다.



Fatal Error[Pe1696]: cannot open source file "core_cm3.h" D:\Wk.Src\Mango-M32F2\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F2xx\stm32f2xx.h 229


이제 빌드를 하면 위와 같은 에러가 발생합니다.
같은 방식으로 Libraries\CMSIS\CM3\CoreSupport 부분을 추가하면 찾을 있기는 하지만
이러한 방식을 사용하지는 않습니다.



Error[Pe147]: declaration is incompatible with "__nounwind __interwork __softfp unsigned long __get_PSP(void)" (declared at line 52 of "C:\Program Files\IAR  D:\Wk.Src\Mango-M32F2\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h 1084
Systems\Embedded Workbench 6.0 Evaluation\arm\inc\c\intrinsics.h")


https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32F%20MEMS%20%20iNEMO/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32F%20MEMS%20%20iNEMO%2FErrors%20while%20compiling%20inemp2%20Firmware%202.3.0%20with%20EWARM&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580003E26E7DD54228C428E8F9FB5EE9C5185¤tviews=397

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32VLDiscovery/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32VLDiscovery%2FIAR-Jumpstart%28V6%29%2C%20Win7%2C%20can%27t%20compile%20any%20of%20the%20demo%20code&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000491D59B8574F8049B5DFA3E8B21CBA51¤tviews=521

링크들을 참조합니다.

만약 Libraries\CMSIS\CM3\CoreSupport 부분을 추가하고 빌드하면
이제는 다른 에러 메시지를 만나게 됩니다.

이를 해결하기 위해서는 아래의 방법을 사용해야 합니다.
일단 먼저 Libraries\CMSIS\CM3\CoreSupport 부분을 추가했던 것을 삭제합니다.





옵션에서 Use CMSIS 선택합니다.
IAR 5.x 버전에서는 없던 것이 추가된 것입니다.
이를 선택하는 만으로 해결이 됩니다.

옵션에서 Use CMSIS 선택하는 것이 많은 것을 변화시키고 있습니다.
예전에는 따로 소스를 포함시키고 빌드를 시켰어야 하는 것들이
IAR 안에 많은 부분이 들어 있습니다.
Libraries\CMSIS\CM3\CoreSupport core_cm3.c 같은 것을
원래는 반드시 포함시켜야 했던 것인데 Use CMSIS 선택하는 것으로 충분합니다.



Fatal Error[Pe1696]: cannot open source file "stm32_eval.h" D:\Wk.Src\Mango-M32F2\src\main.c 24


stm32_eval.h 사용하지 않기 때문에 과감히 삭제합니다.



Error[Pe020]: identifier "USART_InitTypeDef" is undefined D:\Wk.Src\Mango-M32F2\src\main.c 39


USART_InitTypeDef stm32f2xx_usart.h 정의되어 있습니다.
그런데 stm32f2xx_usart.h 찾지 못하겠다는 말이 나오는게 아니라
USART_InitTypeDef 정의되지 않았다고 나오는 것은
stm32f2xx_usart.h include 되지 않았다는 의미일 것입니다.

stm32f2xx_conf.h 모든 include들이 정의되어 있습니다.
파일을 include하도록 합니다.



Fatal Error[Pe1696]: cannot open source file "stm32f2xx_adc.h" D:\Wk.Src\Mango-M32F2\src\stm32f2xx_conf.h 28


이제는 위와 같이 헤더 파일을 찾을 없다는 에러가 나오게 됩니다.
$PROJ_DIR$\..\..\Libraries\STM32F2xx_StdPeriph_Driver\inc
프로젝트 옵션의 C/C++ Compiler 부분의 Preprocessor 부분에 내용을 추가합니다.



Warning[Pe223]: function "STM_EVAL_COMInit" declared implicitly D:\Wk.Src\Mango-M32F2\src\main.c 83


이제는 많은 에러들이 잡혔습니다.
에러는 STM Evaluation Board 적용되는 파일들을 포함하지 않았기 때문에 생기는 것입니다.
Utilities 보면 여러 보드에 대한 것들이 있지만 같은 F2 보드인 STM322xG_EVAL 보겠습니다.
Utilities\STM32_EVAL\STM322xG_EVAL 부분의 stm322xg_eval.c에서 함수 내용을 가져옵니다.

대부분의 경우 공통적으로 사용할 있는 내용이 많이 있을 것이기 때문에
hw_config.h, hw_config.c 파일을 만들어서 여기에 관련 내용을 포함하도록 합니다.



Error[Pe020]: identifier "FILE" is undefined D:\Wk.Src\Mango-M32F2\src\hw_config.c 140


모든 내용을 포함한 후에 빌드했을 위의 에러가 나타납니다.




부분은 라이브러리를 포함시켜주어야 해결되는 문제입니다.
프로젝트 옵션에서 Library 부분을 Full 변경합니다.



Error[Li005]: no definition for "USART_SendData" [referenced from D:\Wk.Src\Mango-M32F2\project\EWARM\Debug\Obj\hw_config.o]


이제는 컴파일 에러는 모두 잡았고 링크에러가 발생합니다.
uart 관련한 소스 파일을 포함하지 않았기 때문입니다.


Comments 1
:    :    :
이름 / 2014-11-20 / ★★★☆☆ [수정 / 삭제]

내용

Recent Comments
일방통행  |  ★★★★★
ISE 14.7 virtualbox를 설치했는데, ,iMPACT가 인식을 못하는데, 어케해야하나요?
min  |  ★★★★☆
These are the only Drives available to write images to: # major minor size name 1: 8 0 512805384 sda 2: 8 16 15558144 sdb Enter Device Number or n to exit: 2 Invalid selection! 왜 이런 오류가 나는 걸까요?
dino  |  ★★☆☆☆
NAND Scrub실행 후 에러가 나타납니다/ 조치방법을 알려주세요 에러내용 crz nand_erase_opts erase.addr=0x0, opt->offset=0x0, erase_ieng minfo_erases=0x20000 .....진행후 s3c-nand:ecc uncorrectable error detected---4개발생합니다 빠른 회신부탁드립니다 연락처:010-3752-6251 강희진
bluewind  |  ★★★★★
안녕하세요..구입했는데..회로도 부탁드립니다. percephy@naver.com 입니다.
조형철  |  ★★★★★
상기 Backlight 관련 회로를 구할 수 있을까요?
hwang  |  ★★★★★
구입한지 조금 됬는데 회로도 부탁합니다. rubens7777@paran.com 입니다.