2016-06-22 01:47 AM
Hello forum,
i didn't find a tutorial on the web how to setup an IAR-project to send code to a STM32F103C8-Board with ST-LINK so i am asking here to find more information about it. First i am struggeling with the correct header file? I took a look in the ''arm\inc\ST\'' folder but there is no file for the STM32F103C8. There are only the these files:''iostm32f10xx4.h''''iostm32f10xxB.h''''iostm32f10xxE.h''''iostm32f10xxG.h''No matter which file i include i always get the error while compiling:''Fatal Error: cannot open source file''''Error while runing C/C++ compiler''Please help me! #iar-workbenc #!stm322016-06-22 04:43 AM
Hi gustamko.master,
I suggest you to start from the template project under the STM32F1 cube firmware package: STM32Cube_FW_F1_V1.4.0\Projects\STM32F103RB-Nucleo\TemplatesThese projects provide a reference template that can be used to build any firmware application.-Syrine-2016-06-22 05:23 AM
It is a little unclear what you are doing, but usually one doesn't ADD include files to a project, their inclusion inferred by the source. What you need to do is add a list of include directory paths.
I would suggest you also look at the examples/templates in the Standard Peripheral Library (SPL), and the files, command line defines, and include paths.2016-06-22 05:57 AM
> I would suggest you also look at the examples/templates in the Standard Peripheral Library (SPL), and the files, command line defines, and include paths.
I'd like to second clive1's point here - the SPL comes with IAR workspaces/projects (beside MDK and TrueStudio), so you can directly open them. Perhaps some conversions for newer EWARM versions are required - the IDE will tell you.
2016-06-28 02:08 AM
I don't have a Nucleo folder in my IAR program directory :(
2016-06-28 02:14 AM
Okay i downloaded the STDPeripheral files from here:
https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32license%3d1467108656html I took a look in the ''3ADCs_DMA'' example and i saw that a ''stm32f10x.h'' is included but this specific file is not part of the standard peripheral library! For the beginning i just want to set an output high, this is my attempt:#include ''stm32f10x.h''
int main()
{
GPIOB->ODR |= (1<<
3
);
GPIOB->CRH |= (1<<3);
return 0;
}
It looks like, IAR is also not familiar with the header file because i get an ''cannot open source file'' - error, even though there must be some header file which tells the compiler which register is at which address etc.?
2016-07-13 01:42 AM
Please guys, help me!
2016-07-13 04:31 AM
I'm not an IAR user
Isn't the file here? STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\stm32f10x.h You need to pay attention to the Include Paths that the project pulls files from, and the Defines it passes into the compiler. You will need to add the library source files to the project. Please review the template project for EWARM (IAR), to get an idea of how to use your tool-chain. STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Template\EWARM\Project.ewp Also don't return from main(), only bad things can happen.