Topic : Issues with bit handling

Forum : ST7/STM8

Original Post
Post Information Post
November 18, 2009 - 11:37pm
Guest

Just downloaded the latest ST7/STM8 toolkit (2.26.09.0317) to test it out. So far I've encountered an issue with bit variables shared across modules.

CFile1.c

extern bit TestFlag;

void main(void)
{
    TestFunc();
    if (TestFlag)
    {
        while(1);
    }

    while(1);
}

CFile2.c

bit TestFlag;

void TestFunc(void)
{
    TestFlag=1;
}

The code in TestFunc() modifies address 0x00 (pheripheral registers) instead of using a bit in RAM.

Replies
Post Information Post
+1
0
-1
November 19, 2009 - 11:47am
Raisonance Support Team

Hi Blasio,

Thank you for this report.

We reproduced you issue in our labs. The compiler is consistently using bit addresses, but these addresses are consistently wrong!

We are working on this issue, which may require a compiler patch.

Regards,
Bruno

+1
0
-1
December 1, 2009 - 9:27am
Guest

Any update on this?

--
Blasio

+1
0
-1
December 2, 2009 - 6:02pm
Raisonance Support Team

Hi Blasio,

Sorry for the latency. We have another open issue on the comipler, which should be fixed within few days. We will release a patch for both problems, but we still need some time to validate.

If waiting for few more days for the patch is a problem for you we can send you an engineering --unsupported-- compiler patch which corrects the bit issues. Let us know.

Thanks for your patience.

Regards,
Bruno

+1
0
-1
December 3, 2009 - 9:23am
Guest

Hi Bruno,

I've reverted to the previous release of the toolkit for the time being, so there's no hurry for the patch.

thanks,
Blasio

+1
0
-1
December 22, 2009 - 9:17am
Guest

Hello,

I've tried out the latest compiler version, with the patch (V2.26.09.317) and it seems to be working correctly now.

Other than some optimizations in the output code the only change I've noticed is that in listing files bit variables all have an offset of 0, while in the older listing files (V2.25.09.238) there are offset values. I'm guessing this is by design?

Regards

Blasio

+1
0
-1
December 22, 2009 - 11:56am
Raisonance Support Team

Hi Blasio,

There isn't any change in the bit display since version 2.24.09.238

Can you give us more information or a sample?

Regards,

Stéphane

+1
0
-1
December 22, 2009 - 12:20pm
Guest

With V2.25.09.238 of the compiler I get this in the listing:

NCFBusy. . . . . . . . . . . . . . . .  PUBLIC  bit     BIT     000000H 1      
NCFErrorOVF. . . . . . . . . . . . . .  PUBLIC  bit     BIT     000001H 1      
NCFRxEvent . . . . . . . . . . . . . .  PUBLIC  bit     BIT     000002H 1      
NCFDecayDone . . . . . . . . . . . . .  PUBLIC  bit     BIT     000003H 1      
D1Done . . . . . . . . . . . . . . . .  STATIC  bit     BIT     000004H 1      
D2Done . . . . . . . . . . . . . . . .  STATIC  bit     BIT     000005H 1      
Dx1StUpdate. . . . . . . . . . . . . .  STATIC  bit     BIT     000006H 1      

With V2.26.09.317 I get:

NCFBusy. . . . . . . . . . . . . . . .  PUBLIC  bit     BIT     000000H 1      
NCFErrorOVF. . . . . . . . . . . . . .  PUBLIC  bit     BIT     000000H 1      
NCFRxEvent . . . . . . . . . . . . . .  PUBLIC  bit     BIT     000000H 1      
NCFDecayDone . . . . . . . . . . . . .  PUBLIC  bit     BIT     000000H 1      
D1Done . . . . . . . . . . . . . . . .  STATIC  bit     BIT     000000H 1      
D2Done . . . . . . . . . . . . . . . .  STATIC  bit     BIT     000000H 1      
Dx1StUpdate. . . . . . . . . . . . . .  STATIC  bit     BIT     000000H 1      

I can send you the listings and/or source code if required.

--
Blasio

+1
0
-1
December 22, 2009 - 2:24pm
Raisonance Support Team

The offset of uninitialized variables is currently displayed too early (when 'symbols' command/pragma is provided).

Will be fixed in next release.

Stéphane

+1
0
-1
December 23, 2009 - 8:09pm
Guest

I am currently experiencing problems with external bit variables as well. Please inform me (by posting on this thread) when any new patches or releases are ready. Thank you.

+1
0
-1
December 28, 2009 - 6:11pm
Guest

Hello JQ,

Raisonance released a patch on the 14th that amongs others fixes the problem I was encountering when I made this post. If it's the same issue, that should solve it.

--
Blasio