Forum : 8051
Original Post
Post Information | Post |
---|---|
February 28, 2007 - 6:05pm
|
Hi anybody, I got Raisonance IDE from company that I am working for. I moved my old project from my old compilator to Raisonance and compile it with the best compilator settings for my microcontroller (ADuC836 from Analog Devices). When I downloaded compiled hex to device, the behaviour of the device wasnt the same as in my old compilator. Device was permanently resetted. When I changed the settings of compiler, there was little change in behaviour, but I wasnt able to find the optimal settings of compilator. Could you help me with Raisonance compilator settings for my microcontroller? Thank you all. |
compilers have actual differences, so to answer your question till you tell which compiler you used 'before' would be pure guesswork.
Erik
Before now I used franklin software proview at the first, then raisonance (but I am not sure which version was it something above 6). When I move project from Proview to this version of raisonance it was running well. Then we upgrade to the newest version (IDE: 6.10.22, C: 6.4.43). After this when I compiled the same project from previous ride, it wasnt functional.
Hello,
could you send us your project? We could have a look here to understand where the problem comes from. You could also try to create a new project, apply the same configuration as in the Ride project for the older version, and try again.
Do you experience the problem when using the simulator? Do you have a hardware debugger or emulator for your device?
Thank you for these informations.
regards,
Lionel
Then we upgrade to the newest version (IDE: 6.10.22, C: 6.4.43). After this when I compiled the same project from previous ride, it wasnt functional.
This often happens with faulty code. I have on several occasions found that some code given to me failed for 'unexplained reasons' when a feature was addrs, the compiler upgraded or the optimization levelchanged or .... This has always been due to bad code. badly designed code sometimes "happen to work" simply because there is no timing relationship to show the bug. Then when something changes the timing get different and BOOM.
a recent example: I added a feature to some inherited code and an unrelated function started failing. I found the reason and, for the sake of proving the cause changed the T1 load value from -136 to -135 in the original code NO OTHER CHANGE. The original code that had been 'working' for 10+ years in 10,000+ units blew up with just that change. Ok after proving the "original sin" I fixed the cause and my addition had no ill side effects.
Erik
Hello again, I was working on some other projects so my problem with compiler wasn't actually for a little while. But now it is. I was trying any compiler settings but without the effect. Well, I would like to ask which files do you want to check and where could I send them? On ? Thank you for fast response.
I can't debug project because, we didnt buy simulator in package and program exceeds the demo simulator limitations. I have a real hardware device, where I am testing the software. But program compiled with Ride doesn't work there.
I would like your entire project, if possible (source files+project files .prj, .dbi etc...)
You can send it to
regards,
Lionel
Hi again,
I have suspicion that my problem can be in interpretation of unsigned int and float data types because device is restarted after downloading data from PC to device. PC is using "little-endian" as default interpretation of data types and Ride C is using "big-endian". Is there any directive which one can tell to compiller what interpretation of data types must be using during compilation?
I have another problem with this function:
...
at 0x0700 xdata unsigned char tmp_array[128];
...
void store_float_array(unsigned int address, unsigned int item, float value)
{
memcpy(&tmp_array[0], (unsigned char *)&eeprom_float[0], 128);
item *= 4;
*(float*)&tmp_array[item] = value;
store_temporary_array(EEPROM_FLOAT_ADDRESS);
}
anythings works fine except line:
item *= 4;
from unexplained reason this simple count is doesnt work. But when I put estimated value directly to variable, everythings works fine.
After some experiments I found the solution and changed input parameter type from unsigned int to unsigned char as follows:
...
void store_float_array(unsigned int address, unsigned char item, float value)
{
memcpy(&tmp_array[0], (unsigned char *)&eeprom_float[0], 128);
item *= 4;
*(float*)&tmp_array[item] = value;
store_temporary_array(EEPROM_FLOAT_ADDRESS);
}
and everythings works fine with char.
Can you tell me where do I have mistake in code with 'unsigned int' type parameter?
Thank you at all Hupi