Error li006 duplicate definitions for

Hi, I have modified an example project of IAR for STM32L1XX with a new library definition (one file .c and one file .h). In the file .h I have defined a variable that I use in the .c file. The function defined in the .h file are developed in the .c file and used in the main file. There aren't...

Skip to main content

Forum for Electronics

Forum for Electronics

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals… and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

  • Digital Design and Embedded Programming

  • Microcontrollers

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

[SOLVED] Error [LI006] — STM32L1xx — IAR — Linker error: Duplicate Definition


  • Thread starter

    valeriogiampa


  • Start date

    Feb 12, 2012

Status
Not open for further replies.

  • #1

Member level 3

Joined
Jul 3, 2008
Messages
58
Helped
5
Reputation

10

Reaction score
5
Trophy points
1,288
Location

ITALY

Activity points

1,897


Hi,
I have modified an example project of IAR for STM32L1XX with a new library definition (one file .c and one file .h). In the file .h I have defined a variable that I use in the .c file. The function defined in the .h file are developed in the .c file and used in the main file.
There aren’t any duplicate of the variable that I have defined in the .h file, but when I run the make command I can see this message:

Linking
Error[Li006]: duplicate definitions for «ADC_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Frequency»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Frequency_Detection»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Gate_Pulse_Off»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Half_Period_Length»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «LED_Blinking»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Period_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period_Length»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period_Prev»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Power_Level»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Power_Level_Prev»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Second_Half_Wave»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Soft_Change_Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Soft_Change_Speed»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Start_Up»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Timer»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Trimmer_Value»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Turn_On_Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «ZVS_Alarm»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «ZVS_Alarm_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error while running Linker

Total number of errors: 22
Total number of warnings: 0

One error for variable defined in the .h file. Why?
Can you help me?

Best Regards

Valerio

Last edited by a moderator: Feb 12, 2012

  • #2

Full Member level 3

Joined
May 28, 2009
Messages
172
Helped
26
Reputation

52

Reaction score
26
Trophy points
1,308
Activity points

2,084


Have you forgotten the little «extern» in the h file?

  • #3

Member level 3

Joined
Jul 3, 2008
Messages
58
Helped
5
Reputation

10

Reaction score
5
Trophy points
1,288
Location

ITALY

Activity points

1,897


The variable are defined in e .h file and use in the .c file. In the main file I don’t use this variable. only i call the function that is developed without in-out parameters.

Hi,
I have modified an example project of IAR for STM32L1XX with a new library definition (one file .c and one file .h). In the file .h I have defined a variable that I use in the .c file. The function defined in the .h file are developed in the .c file and used in the main file.
There aren’t any duplicate of the variable that I have defined in the .h file, but when I run the make command I can see this message:

One error for variable defined in the .h file. Why?
Can you help me?

Best Regards

Valerio

  • #4

Full Member level 3

Joined
May 28, 2009
Messages
172
Helped
26
Reputation

52

Reaction score
26
Trophy points
1,308
Activity points

2,084


The conventional way to write C-programs is to declare stuff in h-files and put definitions in c-files.
A silly example with two c-files and one h-file:

/* example.h */
#ifndef __EXAMPLE_H
#define __EXAMPLE_H
extern int counter;
void displayCounter(void);
#endif

/* example.c */
#include "example.h"

int counter;

int main(int argc, char **argv)
{

  for (;;) {
    counter++;

    displayCounter();
  }

} /* main */

/* display.c */
#include "example.h"
#include <stdio.h>

void displayCounter(void)
{

  printf("%d ", counter);

} /* displayCounter */

It can be compiled like this: gcc -Wall -o example example.c display.c
The #ifndef stuff in the header file is to avoid declaring things more than one time.

Status
Not open for further replies.

Similar threads

  • Digital Design and Embedded Programming

  • Microcontrollers

  • This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.

After exporting and compiling with IAR IDE, errors when trying to compile with ‘mbed compile’ #2711

Comments

Note: This is just a template, so feel free to use/remove the unnecessary things

Description

  • Type: Bug
  • Related issue: N/A
  • Priority: Minor

Target
N/A

Toolchain:
IAR (possibly others also)

Toolchain version:
IAR 7.40

mbed-cli version:
0.8.9

DAPLink version:
N/A

Expected behavior
After exporting to IAR IDE, I expect to be able to compile in IAR IDE, and still be able to go back to compiling on the command line, with IAR, ARM, or GCC_ARM, etc.

Actual behavior
After exporting to IAR IDE, the project files are created in the root project folder. After compiling with IAR IDE, IAR will create a ‘build’ folder. If you go back to the command line and try to compile, the linker will find objects in the ‘build’ folder, try to link them in. This causes duplicate definitions error with IAR on command line, or a crash with GCC_ARM on command line.

Steps to reproduce

mbed export -m K64F -i IAR

Open project workspace in IAR, compile.

Go back to command line:

mbed compile -m K64F -t IAR
.
.
.
Error[Li006]: duplicate definitions for «_alloc_box»; in «C:Usersmaclob01Doc
umentsmorpheusonsemiporting4.buildNCS36510IARmbed-osrtosrtx
TARGET_CORTEX_MTARGET_M3TOOLCHAIN_IARHAL_CM3.o», and «C:Usersmac
lob01Documentsmorpheusonsemiporting4buildiar_armObjHAL_CM3.o»
Error[Li006]: duplicate definitions for «_free_box»; in «C:Usersmaclob01Docu
mentsmorpheusonsemiporting4.buildNCS36510IARmbed-osrtosrtxT
ARGET_CORTEX_MTARGET_M3TOOLCHAIN_IARHAL_CM3.o», and «C:Usersmacl
ob01Documentsmorpheusonsemiporting4buildiar_armObjHAL_CM3.o»
Fatal error[Ms013]: Error limit reached
Fatal error detected, aborting.

Suggestion
The workaround is to delete the build folder, but it would be better if ‘mbed compile’ just ignored the build folder.

The text was updated successfully, but these errors were encountered:

Источник

[SOLVED] Error [LI006] — STM32L1xx — IAR — Linker error: Duplicate Definition

valeriogiampa

Member level 3

Hi,
I have modified an example project of IAR for STM32L1XX with a new library definition (one file .c and one file .h). In the file .h I have defined a variable that I use in the .c file. The function defined in the .h file are developed in the .c file and used in the main file.
There aren’t any duplicate of the variable that I have defined in the .h file, but when I run the make command I can see this message:

Linking
Error[Li006]: duplicate definitions for «ADC_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Frequency»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Frequency_Detection»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Gate_Pulse_Off»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Half_Period_Length»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «LED_Blinking»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Period_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period_Length»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Period_Prev»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Power_Level»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Power_Level_Prev»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Second_Half_Wave»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Soft_Change_Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Soft_Change_Speed»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Start_Up»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Timer»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1
RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjectsGettingStarted-VG1RAM_Debug
Objmain.o»
Error[Li006]: duplicate definitions for «Trimmer_Value»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «Turn_On_Delay»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «ZVS_Alarm»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error[Li006]: duplicate definitions for «ZVS_Alarm_Counter»; in «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjappSource.o», and «C:UsershpDesktopSTM32L1xxDemos_STM32-P152_v1.00DemosProjects
GettingStarted-VG1RAM_DebugObjmain.o»
Error while running Linker

Total number of errors: 22
Total number of warnings: 0

One error for variable defined in the .h file. Why?
Can you help me?

Источник

Little errors under IAR ARM compiler #131

Comments

Building configuration: ubertooth-one — Debug
Updating build tree.
usbhw_lpc.c
Error[Pe042]: operand types are incompatible («void (U16) » and «void *») Srccommonlpcusbtargetusbhw_lpc.c 546
Error[Pe042]: operand types are incompatible («void (U8) *» and «void *») Srccommonlpcusbtargetusbhw_lpc.c 566
Error[Pe042]: operand types are incompatible («void (
)(U8, U8)» and «void «) Srccommonlpcusbtargetusbhw_lpc.c 593
Error while running C/C++ Compiler
usbstdreq.c
Warning[Pe177]: variable «bInterfaceNumber» was declared but never referenced Srccommonlpcusbtargetusbstdreq.c 156
Error[Pe042]: operand types are incompatible («TFnHandleRequest *» and «void *») Srccommonlpcusbtargetusbstdreq.c 584
Error while running C/C++ Compiler
bluetooth_rx-tx.c
Warning[Pe068]: integer conversion resulted in a change of sign Srcbluetooth_rx-tx.c 54
Warning[Pe068]: integer conversion resulted in a change of sign Srcbluetooth_rx-tx.c 55
Error[Pe020]: identifier «INT8_MIN» is undefined Srcbluetooth_rx-tx.c 187
Error[Pe020]: identifier «INT8_MAX» is undefined Srcbluetooth_rx-tx.c 188
Warning[Pe177]: variable «ac_copy» was declared but never referenced Srcbluetooth_rx-tx.c 381
Error[Pe018]: expected a «)» Srcbluetooth_rx-tx.c 1318
Error[Pe020]: identifier «INT8_MIN» is undefined Srcbluetooth_rx-tx.c 1500
Warning[Pe177]: variable «i» was declared but never referenced Srcbluetooth_rx-tx.c 1456
Warning[Pe177]: variable «packet_offset» was declared but never referenced Srcbluetooth_rx-tx.c 1457
Warning[Pe174]: expression has no effect Srcbluetooth_rx-tx.c 1627
Error[Pe020]: identifier «INT8_MIN» is undefined Srcbluetooth_rx-tx.c 1694
Warning[Pe546]: transfer of control bypasses initialization of: Srcbluetooth_rx-tx.c 1718
variable «ret» (declared at line 1767 of «Srcbluetooth_rx-tx.c»)
Warning[Pe546]: transfer of control bypasses initialization of: Srcbluetooth_rx-tx.c 1751
variable «ret» (declared at line 1767 of «Srcbluetooth_rx-tx.c»)
Warning[Pe546]: transfer of control bypasses initialization of: Srcbluetooth_rx-tx.c 1843
variable «p» (declared at line 1853 of «Srcbluetooth_rx-tx.c»)
variable «whit» (declared at line 1856 of «Srcbluetooth_rx-tx.c»)
variable «len» (declared at line 1865 of «Srcbluetooth_rx-tx.c»)
variable «total_transfers» (declared at line 1871 of «Srcbluetooth_rx-tx.c»)
Warning[Pe546]: transfer of control bypasses initialization of: Srcbluetooth_rx-tx.c 1867
variable «total_transfers» (declared at line 1871 of «Srcbluetooth_rx-tx.c»)
Warning[Pe177]: variable «rssi» was declared but never referenced Srcbluetooth_rx-tx.c 1788
Warning[Pe177]: variable «adv_addr» was declared but never referenced Srcbluetooth_rx-tx.c 2057
Warning[Pe177]: variable «crc» was declared but never referenced Srcbluetooth_rx-tx.c 2061
Error[Pe513]: a value of type «int (
)()» cannot be assigned to an entity of type «data_cb_t» Srcbluetooth_rx-tx.c 2371
Warning[Pe177]: variable «epstat» was declared but never referenced Srcbluetooth_rx-tx.c 2453
Error[Pe167]: argument of type «uint8_t» is incompatible with parameter of type «ego_mode_t» Srcbluetooth_rx-tx.c 2625
Error while running C/C++ Compiler

Total number of errors: 11
Total number of warnings: 15

int dequeue_send(u32 clkn)
<
//usb_pkt_rx *pkt = dequeue(&pkt);
usb_pkt_rx *pkt = dequeue();

Linking
Error[Li006]: duplicate definitions for «afh_enabled»; in «DebugObj
Error[Li006]: duplicate definitions for «afh_map»; in «DebugObjbluetooth.o»
Error[Li006]: duplicate definitions for «rr»; in «DebugObjcc2400_rangetest.o»
Error[Li006]: duplicate definitions for «syncword»; in «DebugObjbluetooth.o»
Error[Li006]: duplicate definitions for «target»; in «DebugObjbluetooth.o»
Error[Li005]: no definition for «printf(char const *, . )» [referenced from Debug
Objusbcontrol.o
Error[Li005]: no definition for «bootloader_ctrl» [referenced from DebugObj
bluetooth_rx-tx.o]
Error while running Linker

The text was updated successfully, but these errors were encountered:

Источник

IAR support for RTX (can’t compile sources) #149

Comments

Include is here :

But I can not locate it in the tree, thus some definitions for IAR are missing. The lines referenced above do not look good neither, as for IAR there are lot of macros that should probably live in the iar specific header file (same is done for gcc, and other toolchains).

The text was updated successfully, but these errors were encountered:

The file cmsis_iar.h is shipped by IAR as part of their tool-chain.
If you have EWARM installed you should be able to locate it there or if you are not using IAR your tool-chain should ignore this section of the file completely as you must not have ICCARM being defined.

Thanks ! I was able to find the file, however I am still hitting the same problem that I suspected due to missing header file or its content. I explored that cmsis_iar.h does not contain any definitions for this error:

This is the code that files:

GCC defines them, for ARMCC there is a translation between their symbols and this __ARM_ARCH. What about for IAR? I noticed that this __ARM_ARCH macro is defined in one of .ewp files that does not look right. I am not using this .ewp (RTX_CM project in the tree) but only sources from this repository.

Even if I define __ARM_ARCH macro, I am getting more errors. I am investigating.

Should this be part of cmsis_compiler.h for IAR specific part?

That’s what I found that IAR uses CORE variable as identifier.

Then those symbols ARM_ARCH_xx could be removed from .ewp project files, the sources should compile.

I can’t find what version of IAR was used for those project files, I got 7.70.1 and receive a warning when I open the RTX_CM project, that means it was generated by older version of IAR (broken options detected warning).

Once I defined _ARM_ARCH macros for IAR as above, I progressed with errors in our code base, and hit this one:

It looks to me that atomic_wr8 is causing problems for IAR asm.

PS: I edited this issue, it became IAR support in this code base for RTX2, as I would like to have it working 🙂

Once we resolve these problems ( I commented them out at the moment), my blinky app compiles ! Please review this errors

seems like osRtxUserSVC is not getting proper weakly linkage in this case.

I sent 2 pull requests fixing problems I described here. The last one that I would like to fix is atomic_wr8 .

Any suggestions? I would like to progress regarding these 2:

I downloaded latest IAR beta, had some another internal error that did not allow me to continue, however did not spot this error anymore. A question is what is special for IAR , why I could not compile with 7.7 IAR version?

rtx_msgqueue.c»,111 Error[Ta117]: IT-block ends prematurely, or there is a label within the IT-block
Internal error: [AsmLine — OgAsm]: Error[425]: Conditional instruction is only allowed inside IT block
UXTBNE R1,R1
Fatal error detected, aborting.

and this duplicate symbol. Is svc_user.c intended to be in the application ? It looks like a template and defines a strong symbol. I patched it differently in the referenced PR above.

Error[Li006]: duplicate definitions for «osRtxUserSVC»; in «rtx_lib.o»
, and «BUILDK64FIARmbed-osrtosrtx2T
ARGET_CORTEX_Msvc_user.o»
[ERROR] Error[Li006]: duplicate definitions for «osRtxUserSVC»; in «rtx_lib.o»
, and «BUILDK64FIARmbed-osrtosrtx2T
ARGET_CORTEX_Msvc_user.o»

I downloaded latest IAR beta, had some another internal error that did not allow me to continue, however did not spot this error anymore. A question is what is special for IAR , why I could not compile with 7.7 IAR version?

I switched to the latest stable IAR version (7.8) and this problem is not there.

With IAR EWARM 7.80.4 and PR #150 this issue should be fixed.

With IAR EWARM 8.10 the missing defines are announced to be part of cmsis_iar.h shipped by IAR.

We now introduced the workaround for backward compatibility reasons into cmsis_compiler.h.

I am closing this, as now the sources should be allowed to compile with IAR 7.80. Thanks for the help @JonatanAntoni

Источник

Note: This is just a template, so feel free to use/remove the unnecessary things

Description

  • Type: Bug
  • Related issue: N/A
  • Priority: Minor

Bug

Target
N/A

Toolchain:
IAR (possibly others also)

Toolchain version:
IAR 7.40

mbed-cli version:
0.8.9

meed-os sha:
7669d7f

DAPLink version:
N/A

Expected behavior
After exporting to IAR IDE, I expect to be able to compile in IAR IDE, and still be able to go back to compiling on the command line, with IAR, ARM, or GCC_ARM, etc.

Actual behavior
After exporting to IAR IDE, the project files are created in the root project folder. After compiling with IAR IDE, IAR will create a ‘build’ folder. If you go back to the command line and try to compile, the linker will find objects in the ‘build’ folder, try to link them in. This causes duplicate definitions error with IAR on command line, or a crash with GCC_ARM on command line.

Steps to reproduce

mbed export -m K64F -i IAR

Open project workspace in IAR, compile.

Go back to command line:

mbed compile -m K64F -t IAR
.
.
.
Error[Li006]: duplicate definitions for «_alloc_box»; in «C:Usersmaclob01Doc
umentsmorpheusonsemiporting4.buildNCS36510IARmbed-osrtosrtx
TARGET_CORTEX_MTARGET_M3TOOLCHAIN_IARHAL_CM3.o», and «C:Usersmac
lob01Documentsmorpheusonsemiporting4buildiar_armObjHAL_CM3.o»
Error[Li006]: duplicate definitions for «_free_box»; in «C:Usersmaclob01Docu
mentsmorpheusonsemiporting4.buildNCS36510IARmbed-osrtosrtxT
ARGET_CORTEX_MTARGET_M3TOOLCHAIN_IARHAL_CM3.o», and «C:Usersmacl
ob01Documentsmorpheusonsemiporting4buildiar_armObjHAL_CM3.o»
Fatal error[Ms013]: Error limit reached
Fatal error detected, aborting.

Suggestion
The workaround is to delete the build folder, but it would be better if ‘mbed compile’ just ignored the build folder.

When the transplant code is met, I have a more wonderful problem, the record is as follows:

   Error[Li006]: duplicate definitions for «Uart3»; in «E:IAR_1768Pro_PCB799DebugObjUart3_init.o», and «E:IAR_1768Pro_PCB799DebugObjuModemG600.o» 

Repeat variable UART3

However, there is no UART3 variable in umodemg600.c file, only UART3.h’s header file, the problem occurs in this file.

The definition of this variable of the UART3 is placed in Uart3.h, and UART3.h has a #include, uart3.h in uart3.c and umodemg600.c, causing UART3.H to repeat compilation, variable repeated definition .

/ / =================== Question is completed, one is personal point of view ==================== =

My personal approach is that the variable / function is defined in the * .c file, the variable / function declaration is in the * .h file, and * .h file plus the compilation condition, place the repeated include, the format is as follows:

    user.c 

 1 //user.c file
 2 
 3 #include <stdio.h>
 4 #include <string.h>
 5 #include "user.h"
 6 
 7 signed char g_a = 0;
 8 unsigned char g_b = 0;
 9 signed int g_c = 0;
10  
11 void fun1(void)
12 {
13     //do something
14 }
15 
16 void fun2(void)
17 {
18     //do something
19 }

    user.h

#ifndef _USER_H_
#define _USER_H_

extern signed char g_a;
extern unsigned char g_b;
extern signed int g_c;

void fun1(void);
void fun2(void);

#endif

Понравилась статья? Поделить с друзьями:
  • Error level php ini
  • Error level f 400000031
  • Error level e 400070031
  • Error level e 400030035
  • Error level analysis программа