Questions tagged [iar]

IAR Systems supplies software development tools and services that make embedded systems fast, efficient and reliable for companies worldwide. This tag focuses on the IAR C/C++ Compilers, IDE and code quality analysis tools.

IAR Systems, 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 a state-of-art debugger for developing applications targetting microcontrollers ranging from the smallest 8-bit devices up to high-performance 64-bit architectures from more than 70 silicon vendors.
  • IAR C-STAT: Static analysis add-on with support for MISRA-C, CWE and CERT rules
  • IAR C-RUN: Runtime analysis add-on for detecting data type casting, integer overflow and memory management errors
  • IAR Build Tools: All the build tools components from the Embedded Workbench for building from the command line, ideal for Continuous Integration and Modern Developent Workflows. Now also available for Linux.
  • IAR Visual State: tools for designing, testing and implementing embedded applications based on state machines.
638 questions
4
votes
2 answers

Automating linker configuration in IAR Embedded Workbench

I am working on a firmware project in which i have to do a crc16 check for flash integrity. The crc is calculated using IAR Xlink linker and kept at the end of the flash. Again crc is calculated at run time from the code and compared with the stored…
OnkarK
  • 127
  • 2
  • 9
4
votes
2 answers

Unexpected bit shift result on 8051 (8-bit) microcontroller

Consider the following code: #include int main() { uint16 crc16; // hal_types.h: typedef unsigned short uint16; crc16 = 0x43; // debugger: crc16 == 0x0043, as expected crc16 = crc16 << 8; // crc16 ==…
David
  • 1,167
  • 15
  • 24
3
votes
3 answers

How to correctly setup a C language project in Eclipse

I'm an experienced Java developer, and I'm very familiar with Eclipse. Lately I've been trying to migrate a Texas Instrumental(BLE), IAR C language project, into Eclipse, without using IAR official Eclipse plugin, I just want to use Eclipse as my…
TacB0sS
  • 10,106
  • 12
  • 75
  • 118
3
votes
1 answer

Is there a way to add a custom Intellisense mode?

In VisualStudio 2019 I can set different modes for IntelliSense, where i specify what compiler and architecture I am using. Is there a way to add a custom mode for another compiler (for example a mode for the IAR compiler), so Intellisense could…
Michael
  • 147
  • 7
3
votes
1 answer

IAR Workbench: No Definition for "HAL_SPI_Init" error

I am using IAR Workbench to compile my codes, Even I added all Stm32 Hal library in folder and objects>processor in my project I get this errors: [ErrorLi005]: no definition for "HAL_SPI_Init" [referenced from…
gogogo
  • 529
  • 1
  • 3
  • 11
3
votes
4 answers

TFTP on windows 7

I am using TFTP service to get/put files from an embedded board(IAR systems). This used to be working file with windows XP, however with windows 7 the tftp service doesn't work. I have confirmed network connection between windos 7 machine and the…
Punit
  • 83
  • 1
  • 6
3
votes
1 answer

Why do I need to subtract 1 from label in LDR instruction?

I am working on an ARM Cortex-M4 processor using IAR Embedded Workbench. When the main stack overflows I get a bus fault. I have therefore written a small function in assembly to check if the bus fault was caused by a stack overflow, set the stack…
3
votes
2 answers

Programing STM32 like STM8 (register-level GPIO)

I programmed STM8 GPIO like PD_ODR_ODR4 = 1;, but stm32f10x.h doesn't have this function. Is there any .h file that has definition for bits? Sorry, but I don't know how to explain this problem better. I tried multiple GPIO libraries.
jurgis1991
  • 43
  • 1
  • 4
3
votes
3 answers

Get rid of IAR compile warning Pa039 ? "use of address of unaligned structure member"

IAR compiler for ARM... I have a structure packed using #pragma pack(push, 4) typedef struct { int a; double b; } my_t; #pragma pack(pop) I want to take the address of a field and then cast to a char *. my_t d; char * p = (char…
3
votes
1 answer

Override syntax, specialized template method that returns a pointer to a fixed size array

Where should i put the override keyword? Eclipse indexer throws an error in one example and my compiler with the second example. Base class: template class Base { virtual type const (& Get()…
vuko_zrno
  • 635
  • 1
  • 8
  • 18
3
votes
3 answers

optimization of static function referenced once

I am writing embedded code for MSP430, using the IAR compiler at the highest optimization level (speed or size does not change anything). I define a function as static, then reference it only once, in the same file. Since the function has internal…
Gauthier
  • 40,309
  • 11
  • 63
  • 97
3
votes
1 answer

manually copy .data section from flash to ram with IAR EWARM

I have written a bootloader for a Kinetis K24 Cortex M4. The bootloader loads additional functionality over USB into ram at runtime. This ramcode exists as its own EWARM project generating a binary. The entry point to this binary must always be…
lusher00
  • 678
  • 1
  • 7
  • 18
3
votes
1 answer

C - Warning [pe069] integer conversion resulted in truncation

I know that this question has been asked several times, anyway I didn't find and answer to my specific case: IAR Embedded Workbench returs this warning on compiling: "Warning [pe069] integer conversion resulted in truncation" on the…
gigapico00
  • 417
  • 1
  • 7
  • 24
3
votes
1 answer

IAR , localtime, mktime

I am using the DLib for your IAR-Compiler and wanted to convert a UTC-timestamp to a local timestamp. I am located in Germany hence my implementation for the __getzone-method is as followed: char const * __getzone() { return…
3
votes
2 answers

Measuring time in IAR (for STM8) of routine called each 100 micro seconds

I am maintaining some code in C for STM8 using IAR Embedded. what is the way to measure execution time between one part of the code and another? (Take into account that if possible I don't want to stop the execution of the code (a la breakpoint) or…
KansaiRobot
  • 7,564
  • 11
  • 71
  • 150