cancel
Showing results for 
Search instead for 
Did you mean: 

Compilation errors on Keil with OpenAmp project generated with CubeMX

hllelek33
Associate II

Hi,

I am new about dual core mcu. I have stm32h745 mcu. 

I am working about inter core comminication, Firstly setting some setting on CubeMx.

When I create project codes, CubeMx creat 2 openamp library for each mcu(m4/m7).

After that I am trying build, and getting error like this.

 Error: L6200E: Symbol OPENAMP_init_ept multiply defined (by openamp_1.o and openamp.o). 

16 times geting similar error like this. 

Why CubeMx create wrong library. 

CubeIde working properly. (create only 1 library set)

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Add-on:

For IAR in the .icf files add:

 

define symbol __OPENAMP_region_start__         = 0x38000400;
define symbol __OPENAMP_region_size__          = 0xB000;
export symbol __OPENAMP_region_start__;
export symbol __OPENAMP_region_size__; 

 

PS: 0x38000400 and 0xB000 are only examples. You can change them if you want. Just be sure they are not interleaving with other used memory regions.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

10 REPLIES 10
SofLit
ST Employee

Hello,

I tried to start a project with OpenAmp on stm32h745  and didn't face any issue.

Which IDE are you using?

I attached a project created with STM32CubeIDE.

PS: you can inspire from the examples provided in STM32CubeH7 from this link: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H747I-EVAL/Applications/OpenAMP

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thanks for replys.

My IDE Keil uVision V5.26.2.0

 

Hello,

Thank you for the feedback. Is that possible to generate the project with CubeIDE and tell what it happens?

PS: I have errors with KEIL (but are not the same as yours) and IAR  .. (already reported the issue internally on ticket 172397.

What is the CubeMx version you're using?

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

CubeMX version 6.9.0. When Update Cube Mx to 6.10.0, the error disappered. Now I have new errors.  

dual__CM4\dual__CM4.axf: Error: L6218E: Undefined symbol Image$$__OpenAMP_SHMEM__$$Base (referred from openamp.o).
dual__CM4\dual__CM4.axf: Error: L6218E: Undefined symbol Image$$__OpenAMP_SHMEM__$$ZI$$Length (referred from openamp.o).

 

I think it is about linker file. I can not configure linker file and this error occur. 

Is there  an any document for OpenAmp Linker configuration?

Or any advice about this error?

Hello,

This is the exact issue that I had.

As I said I've already reported internally to fix the issue in the ticket 172397. The dev team will handle this.

Thank you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
hllelek33
Associate II

Hi, 

Thank you. I am waiting for solution. Is there an any notification about solution for me?

Don't worry, if there will be any news I will let you know

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

In the linker files (.sct) add this line 

 

__OpenAMP_SHMEM__ 0x38000400  EMPTY 0x0000B000 {} ; Shared Memory area used by OpenAMP   

 

Read the comment in \OPENAMP\openamp_conf.h at line 126:

 

#elif defined(__CC_ARM) || defined (__clang__)
/*
 * For MDK-ARM, the scatter file .sct should contain the following line:
 * LR_IROM1 ....  {
 *  ...
 *   __OpenAMP_SHMEM__ 0x38000400  EMPTY 0x0000B000 {} ; Shared Memory area used by OpenAMP
 *  }
 *
 */
extern unsigned int Image$$__OpenAMP_SHMEM__$$Base;
extern unsigned int Image$$__OpenAMP_SHMEM__$$ZI$$Length;
#define SHM_START_ADDRESS (unsigned int)&Image$$__OpenAMP_SHMEM__$$Base
#define SHM_SIZE          ((size_t)&Image$$__OpenAMP_SHMEM__$$ZI$$Length)

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
SofLit
ST Employee

Add-on:

For IAR in the .icf files add:

 

define symbol __OPENAMP_region_start__         = 0x38000400;
define symbol __OPENAMP_region_size__          = 0xB000;
export symbol __OPENAMP_region_start__;
export symbol __OPENAMP_region_size__; 

 

PS: 0x38000400 and 0xB000 are only examples. You can change them if you want. Just be sure they are not interleaving with other used memory regions.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.