Problems with C++ and Codewarrior

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

Problems with C++ and Codewarrior

820 Views
ernestbori
Contributor I

Hi!

 

I'm trying to convert to C++  a project made in C, but I am having some problems.

 

I have tested them with Codewarior 10.2 on linux and Codewarrior 10.3 on Windows (Professional Edition license) with the same results on both of them. I have also tested them on our own board and on the demoboard with the same results.

 

We are developing it with Coldfire V1 MCF51AC256A.

 

The problem is that I'm porting a function that it is working on C, to C++ and it doesn't work as expected. That funcion enables a Fextimer to generate a periodic interrupt. I see that the number of interrupts generated in both cases are not the same. It can be related to the fact that when I generate a C++, even with the minimum code) when I debug it , always triggers an exception (vector 4 'Illegal instruction') and I don't know why, because I don't put any assembler code.

 

I hope anyone can give me a clue about it, because I'm stuck.

 

I've attached two projects one in C and one in C++ (with the same code, but ine generated as a C project and the other one in C++). I only enable the flextimer and set or reset the PortF bit to test with the oscilloscope the signal so I can see the frecuency generated.

 

I couldn't send the projects because it was detected as a virus, and I send only the code.

 

Thanks

Original Attachment has been moved to: testc++.zip

Original Attachment has been moved to: testc.zip

Labels (1)
Tags (3)
0 Kudos
Reply
0 Replies