Problem with using Shared variable in MultiCore Environment

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
WooHyuk
Newbie
Posts: 11
Joined: Mon Mar 09, 2015 2:07 pm

Problem with using Shared variable in MultiCore Environment

Post by WooHyuk » Tue Jun 02, 2015 11:51 am

Hello~ all!
I'm using TC275 and ERIKA ENTERPRISE for my project.
I made a project with RT-Druid C/C++ Project Example -> tricore -> infineon_TriBoard-TC2X5_V2.0 ->Multicore automatic tests -> Multicore Spinlocks test.
However, When I tried to build this project, Compilation failed because shared variables didn't be referenced. Shared Variables are initialized in master.c code. and in shared.h, they are also initialized as extern values. So, I think that there is no problem with using shared variables in slave2.c or slave1.c. I cannot understand why this undefined reference error had occurred.
Can anyone please tell me how I can get through with this problem?
Attachments
shared_variable3.PNG
shared_variable3.PNG (11.42 KiB) Viewed 2143 times
shared_variable2.PNG
shared_variable2.PNG (6.17 KiB) Viewed 2143 times
shared_variable.PNG
shared_variable.PNG (75.65 KiB) Viewed 2143 times

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: Problem with using Shared variable in MultiCore Environm

Post by e.guidieri » Thu Jun 04, 2015 8:23 pm

This really weird I just tried it yesterday and the test works.

hich compiler are you using, are you compiling in single ELF way. Could you attach your oil file?

WooHyuk
Newbie
Posts: 11
Joined: Mon Mar 09, 2015 2:07 pm

Re: Problem with using Shared variable in MultiCore Environm

Post by WooHyuk » Fri Jun 05, 2015 7:12 am

Thanks to reply, e.guidieri. I finally solved problem. But I have a question about using shared variable in ERIKA ENTERPRISE. I saw how to use shared variable in Wiki page.
To use shared variable, as a picture I attached, It is essential that EXPORT_FILE has to be assigned. and shared variable should be initiated in the export_master.exp file. Is there any other way to use shared variable in ERIKA ENTERPRISE?
When I initiate shared variable in export_master.exp file, is there difference between writing FUNCTION keyword and OBJECT keyword? I'm confused because, whenI used an integer variable for shared data, I wrote FUNCTION keyword but it worked well. Of course OBJECT keyword works well.
Attachments
external.PNG
external.PNG (28.69 KiB) Viewed 2129 times

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Problem with using Shared variable in MultiCore Environm

Post by paolo.gai » Fri Jun 05, 2015 9:00 am

That is currently what we have. But we are working on a single-ELF version of the kernel that shares the RTOS code among the various CPUs. It is done in the context of the P-SOCRATES FP7 Project, and will probably be available for Kalray MPPA around end of the year.

PJ

Post Reply