cancel
Showing results for 
Search instead for 
Did you mean: 

Bit definition error - IAR Workbench with STM32F4Discovery

sommer
Associate II
Posted on July 28, 2015 at 14:28

I am a beginner with embedded programming and am using the IAR workbench for a project of mine using `STM32F4Discovery`. I am trying to compile an existing code and have a few errors at  a few places regarding the bit definitions like the following:

`Error[Pe020]: identifier ''GPIO_PIN_SET'' is undefined`

Now, the `GPIO_PIN_SET` is defined in the file `stm32f4xx_gpio_hal.h` and is already included in my project. In order to resolve this issue when I looked up online, I have found this

https://www.electronicsblog.net/start-with-iar-embedded-workbench-for-atmel-avr-attiny13-led-blink-with-timer-interrupt/

 solution. However, I don't have the `System`  tab in the `General Options` in my IAR Workbench. I have a full version of IAR Workbench and am not sure why the `System` tab is missing. 

I also tried defining

    &sharpdefine ENABLE_BIT_DEFINITIONS

as stated in

http://supp.iar.com/Support/?note=25083

 link in my `main.c` file but to no avail. Trying to set 

    &sharpdefine STM32F4XX

    &sharpdefine USE_STDPERIPH_DRIVER

in the `main.c` file or defining the symbols `STM32F4XX`, `USE_STDPERIPH_DRIVER` in the `Preprocessor` tab in `General Options` as mentioned

http://dccharacter.blogspot.de/2013/03/creating-new-project-for-stm32f4.html

 also didn't help.

The solution could be very simple that I am probably overlooking but am not able to figure out what could I be missing. Any help would be appreciated

#iar-workbenc #iar-workbenc #!stm32f4-disco #!stm32f4-disco
3 REPLIES 3
Posted on July 28, 2015 at 15:02

You'd need to do things which are HAL specific

The compiler needs the command line define

USE_HAL_DRIVER

Your project would need it's own stm32f4xx_hal_conf.h which breaks down which include files to pull in. Which is itself pulled in via you having #include ''stm32f4xx_hal.h'' in your file.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sommer
Associate II
Posted on July 28, 2015 at 15:18

When I included USE_HAL_DRIVER in the defined symbols, a few of the errors are now resolved. But I still have some errors existing, for example:

    Error[Pe020]: identifier ''PAN_ID'' is undefined

PAN_ID is defined in a file app_cfg.h. How do I know what symbols to define for this particular file like the USE_HAL_DRIVER that you mentioned?

Posted on July 28, 2015 at 15:59

I guess you'd review the project templates supplied as part of the HAL/Cube examples. Get comfortable with there construction.

You'd need to #include the files specific to your project, and where appropriate configure your ''Include Paths'' via the project options.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..