Questions tagged [iar]

IAR is a company that specialize in creating development tools for embedded systems. This tag focuses on the IAR C/C++ compiler, IDE and runtime analysis tools.

IAR, an embedded system technology company founded in Sweden in 1983, specialize in creating development tools for embedded systems. Products include:

  • IAR Embedded Workbench: C/C++ compiler and debugger tool suite for applications based on 8-, 16-, and 32-bit MCUs
  • C-RUN: Runtime analysis tool for detecting data type casting, integer overflow and memory management errors
  • C-STAT: Static analysis tool with support for MISRA-C, CWE and CERT rules
  • IAR visualState: tools for designing, testing and implementing embedded applications based on state machines.
565 questions
52
votes
9 answers

Command Prompt Error 'C:\Program' is not recognized as an internal or external command, operable program or batch file

I am trying to run the following batch command. The command has been extracted from the IDE so is confirmed working. Getting the error mentioned below. I have tried a few variations with double quotes but they haven't worked. Even on powershell it…
Rohan Sharma
  • 978
  • 1
  • 9
  • 17
45
votes
5 answers

How to specify a compiler in CMake?

I would like to use the IAR compiler. I noticed CMake has already have a bunch of files about this compiler: https://github.com/jevinskie/cmake/blob/master/Modules/Compiler/IAR.cmake From what I read the common solution is to specify manually ALL…
nowox
  • 19,233
  • 18
  • 91
  • 202
31
votes
3 answers

Compiler optimization of bitwise not operation

I have a simple function testing if two arrays are each others inverse. They are seemingly identical, except for a tmp variable. One works the other doesn't. I can't for the life of me figure out why the compiler would optimize this out - if it…
SupAl
  • 481
  • 3
  • 10
22
votes
3 answers

Access symbols defined in the linker script by application

In my linker script file, I have defined two symbols define symbol _region_RAM_start__ = 0xC0000000; define symbol _region_RAM_end__ = 0xC00fffff; and then I have exported them as well as shown below export symbol…
ka05
  • 515
  • 1
  • 3
  • 11
9
votes
1 answer

Strange definition in C with @ sign

I have come across following definition in an embedded C source file: const preamble_t OAD_Preamble @ ".preamble" = { HAL_OAD_RC_MAX, // Default program length of max if not using post-processing tool. OAD_MANUFACTURER_ID, // Manufacturer…
doubleE
  • 805
  • 8
  • 26
9
votes
4 answers

I am at the point I need to purchase IAR, Code Composer 4, or something else for MSP430 development

I have been using IAR so far, but it crashes sometimes and doesn't have code completion. Also, the other dev environments I use are eclipse based. Which one should I buy?
michael
  • 2,357
  • 2
  • 37
  • 59
8
votes
0 answers

Can IAR produce a static library that GCC can link to?

There is a vendor whose software I'd like to work with. They have a code base which they can only compile using IAR Embedded Workbench (as far as I know, their code does not compile with GCC). Unfortunately their hardware only works with their…
Venemo
  • 17,191
  • 9
  • 78
  • 117
8
votes
1 answer

Is there any reason to declare something "volatile const" in C but only "volatile" in C++?

I was using a header file in my project that had the following define(s): #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus #define __I volatile /*!< Defines 'read only' permissions*/ #else #define __I …
SoftwareDev
  • 574
  • 1
  • 5
  • 14
8
votes
2 answers

How to display an array range via a pointer in the IAR IDE Watch window?

In the IAR Embedded Workbench I have a pointer pointing to a buffer in memory. When watching the pointer, I can see the contents of the word it points to. How can I tell the Watch view to list a range of the buffer, from the pointer onwards, for…
ysap
  • 7,015
  • 7
  • 51
  • 105
7
votes
2 answers

Place segments of external static library to specific locations

My application calls some functions which are placed in an external static library. I link the external static library to my application and everything works (in this case I'm using GCC). Nevertheless, the locations (addresses) of text, .data and…
HBv6
  • 3,389
  • 4
  • 26
  • 41
7
votes
3 answers

C compiler bug or program error?

I am using the IAR C compiler to build an application for an embedded micro (specifically a Renesas uPD78F0537). In this application I am using two nested for loops to initialize some data, as shown in the following MCVE: #include #define…
Grodriguez
  • 20,528
  • 10
  • 53
  • 97
7
votes
2 answers

Are static c libraries created with one compiler compatible with another?

In my case I have a library built with code sourcery gcc targeting arm cortex-m4. I am trying to then link that library into a project being compiled with IAR compiler. Is it possible to do this or does the library have to be rebuilt with the new…
Brandon Yates
  • 1,892
  • 3
  • 20
  • 32
7
votes
2 answers

My embedded application never finishes init to get to main() due to watchdog (IAR/MSP430)

I'm using an MSP430 chip with 10K of RAM. If I go above 5k of RAM usage, it's never capable of making it to main(). The init code calls __data20_memzero to clear out the used RAM space. It look like it increments through memory and clears bytes…
reza
  • 1,261
  • 21
  • 36
7
votes
1 answer

Error[Pe513]: a value of type "void *" cannot be assigned to an entity of type "uint8_t *"

I am attempting to convert a C project into C++. In the C project I countered this error while compiling into c++: Error[Pe513]: a value of type "void *" cannot be assigned to an entity of type "uint8_t *" The following code gives this…
andre
  • 6,611
  • 4
  • 36
  • 70
7
votes
4 answers

Casting enum definition to unsigned int

According to this SO post: What is the size of an enum in C? enum types have signed int type. I would like to convert an enum definition from signed int to unsigned int. For example, on my platform an unsigned int is 32-bits wide. I want to…
Thomas Matthews
  • 52,985
  • 12
  • 85
  • 144
1
2 3
37 38