CodeWarrior for Coldfire v6.3 - Strange behavior with parameter passing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CodeWarrior for Coldfire v6.3 - Strange behavior with parameter passing

1,326 Views
amprel
Contributor I
Hi everybody,
I'm trying to understand (unsuccessfully, so far ...) what's going on in the following situation (I'm working on a MCF5213-based board and I'm using CW 6.3 - although 6.2 behaves exactly the same way).
Consider the piece of code shown in fig. 1 (see attached file). The function TestParameters() is declared as follows:

static int8 TestParameters(uint16 EEPROMAddr,uint8 *RAMAddr);

If I set a breakpoint on line (actually PC) 00007392 and then I go to line 000073D8, register D0 contains 0x00000000 (see fig. 2) so the value passed to TestParameters() (move.w d0,(a7)) as first parameter (i.e. EEPROMAddr) is 0. This value is WRONG (the correct value is 0x00000100 as PageCount is 0 and EEPROMSettings is 0x100) and so TestParameters() incorrectly reports an error.

If instead I set a breakpoint on line 00007392 and then I single-step to line 000073D8, register D0 contains 0x00000100 (see fig. 3) so the value passed to TestParameters() as first parameter (i.e. EEPROMAddr) is 0x100, which is correct.

Needless to say (Murphy's Law), when the program runs at full speed it behaves incorrectly (as in the first case above).

Other interesting facts are:

1) If I change the link order just by swapping the position of two files, the correct parameter gets passed to TestParameters().
2) If the program is even slightly changed (i.e. some code is either added or removed), the correct parameter gets passed to TestParameters().

Thanks in advance for your help !

Alessandro

Message Edited by CrasyCat on 2007-04-02 11:31 AM

 

Code.doc

Message Edited by t.dowe on 2009-10-29 09:43 AM
Labels (1)
0 Kudos
1 Reply

307 Views
CrasyCat
Specialist III
Hello
 
This need to be investigated properly by our support people.
 
Please submit a service request (SR) around that and make sure to attach  a project reproducing the trouble as well as installed product information.
To generate Installed product information:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - Click on Save As and save the information in a text file that you attach to the SR.
 
To extract reproducible project you can use the Pack & Go Wizard.
  - Start CodeWarrior
  - Open the project
  - Select Help -> "Pack and Go" and follow the instruction on the screen.
     This will generate a zip file with reproducible project. Attach it to the SR too.
 
To create a service request click here
 
CrasyCat
0 Kudos