Forum : ST7/STM8
Post Information | Post |
---|---|
July 6, 2009 - 11:00pm
|
Hi, We're using a REva starter kit with: We're programming the SMT8S208RB chip using Ride7 and the RLink connector. The compiler is registered so we should be able to build 16kB binaries. All the REva examples provided build and run fine and we've written several of our own programs that build and run on the Eval board ok as well. However, we have one program that fails to build without giving any compiler or linker error messages - it looks like the compiler just crashes during the build and we get a message from Windows that says: "ST7-STM8 C compiler has encountered an error and has to close." Without any error messages from the compiler or linker it's a pretty difficult problem to debug. At first we thought it could be a file size problem - if we remove a small amount of code the program compiles and runs fine. Although this seems strange since we are nowhere near our 16kB limit. There might also be a clue in the code we need to remove for the build to succeed. Below is a segment of the program. When the while loop is included as written, the compiler crashes. When we remove some of the else-if statements that have no commands inside e.g. else if ((u8)(_RxMessage.Data[0]) == COMMAND_RC){ } then the build works. We've finally come to the conclusion that it is a problem with the compiler optimisation level. Again, if we include the while loop as written and reduce the compiler optimisation level from 3 to 2 then the build is successful. Is there an obvious problem with these else-if statements that we've missed? What is the compiler optimisation trying to do with them? And would you expect the compiler to have a more graceful exit than just crashing? Or could it be something other than compiler optimization that's causing the compiler crash?? Cheers Problematic code: while( ( CAN_MessagePending() ) < 1 ); CAN_Receive(&_RxMessage); //Read ADC //Set DAC //Start In-Application programming //Fires test pulser //Set row and column address //Enable or disable HV bits //Return board ID //Turn on either red or green LED //Return version number } |
Hi Clairet,
This issue has already been reported, and is fixed in the latest version of the compiler.
Please download the update from http://www.mcu-raisonance.com/mcu_downloads.html.
Let us know if this fixes your problem.
Regards,
Bruno
Hi Bruno,
I downloaded and installed the latest versions of Ride7 and RKit-STM8 and I'm afraid I still see the same problem - setting the optimisation level to 3 causes the compiler to crash.
Is there anything else I should try?
Cheers
Claire
Did you try version 2.22.09.0203 from July, 24th?
Stéphane
Hi Stephane,
Sorry for the long delay in replying - I've been on vacation.
I've just tried Ride7 version 2.22.09.0203 (along with RKit-STM8 version 2.24.09.0238). My build still fails when I use optimization level 3, however, the compiler no longer crashes - I now get this compiler error message:
*** FATAL ERROR C041 IN LINE 30 OF C:\ProgramFiles\Raisonance\Ride\Examples\STM8\REva\STM8S208RB\proto_firmware\read_ID.c : (null) (00,00,00,00,00,00,28)
Again, the build is successful if I use optimization level 2 or 1.
Cheers
Claire
Hi Claire,
We just recompiled the whole project you sent us early July: Everything goes fine with the latest tools Ride7-7.2.09.203 and RKit-STM8-2.24.09.0238, no problem at all on 2 different machines in both speed and size optimization modes.
It looks like the problem you encounter is different from the one we fixed one month earlier, as it was in your "CAN_message.c" file, and the new problem is in read_ID.c.
Can you send us a copy of your failing project so that we can fix this?
Thanks,
Bruno