AnsweredAssumed Answered

Trouble sharing code across modules

Question asked by ChrisW679 on Nov 27, 2012
Latest reply on Nov 28, 2012 by JJoseph

Hello,

 

in my application there is a table which I want to share with another module. The table is implemented as a variable in the first module:

 

#pragma section("seg_dmda")

float32_t gl_gain_values[19];

 

To allow other modules to access a particular index in this table I am sharing the following function:

 

void GetGalaGain(float32_t* gain, int32_t step)

{

    *gain = gl_gain_values[step];

}

 

My LDF file contains:

 

KEEP(_GetGalaGain)

 

and the linker command looks like this:

 

elf2dyn -o "${ProjName}".dyn -e _BPROCESS_GalaTableAlgo -e _GetGalaGain "${ProjName}".dxe

 

The module which uses the function includes the symbol in its XML file:

 

<symbol name="_GetGalaGain" index="0" />

 

The function is then referenced using a function pointer:

 

void (*pfSSnModule)(float32_t* gain, int32_t step);

...

pfSSnModule = (void (*)(float32_t* gain, int32_t step))pSymbol[1];

...

pfSSnModule(&pGala_Params->m_gain, pGala_Params->m_gala_step);

 

It does not seem to be working, i.e. it somehow crashes when I add both modules in SigmaStudio.

I am using CCES 1.0.1.0. The patch has been installed.

 

Can anybody see what I am doing wrong?

 

BR

Christopher

Outcomes