This one is really giving me fits. I'm attempting to port a version of Zmodem.c from 2002 that I used in 2005 on a project with a Freescale iMX6 to a rabbit 4000 (rcm4300) as a library. I have the code reformatted properly, functions that wait for data are cast as cofunc, and appropriately used with wfd. the problem is that I keep getting an internal error from the compiler that I can't determine the cause of.
line 1737 : ERROR ZMODEM.LIB : Internal error. Assertion "obj->LVALUE" failed in file "COMPCORE\MoveObject.cpp", line 439.
Zmodem.lib line 1737 reads as follows
the routine rComm_readByte is cast as a cofunc.
Never even heard about Dynamic C - thanks! .. I will have to look at this.
From my reading in the last few minutes, DC uses a static area for each task instead of using a stack. One of the critical things is cofunctions do not share objects without special conditions. Is 'ch' unique to that cofunc or is it shared?
Also - compile with all optimizations off. While it would seem this particular bug is not a result of optimization, the optimizer does funky things.
Are you able to look at the generated assembly? or does the compiler bomb out before generating the asm file?
try to create a very simple example of what you want to do. Strip away all of the cruft of dealing with HW, etc, and just make a program that does the core of what you want.
Sorry i cannot be more helpful. But the process of debugging anything is simplify the cases. If the simpler stuff works, you have a lower bound on the issue. If the simpler stuff fails, you have eliminated a lot of the cruft && can start simplifying it more until you find the bug, or it goes away (meaning you have bounded the bug).
But - I would not immediately assume it's the compiler (other than, perhaps, the optimizer).
I'm not sure if this helps, but remember - simplify...
Found the root cause of the initial error...
You were right, it was not the compiler, one of the original .h files that had global variables in it also had old function prototypes that I had overlooked, that did not have the "cofunc" declarations. Removed them! Problem gone!
time for a beer!!!
(I really meant for you to have a beer to celebrate - but I *do* appriciate the beer! My firsrt one here! WOO WOO!!
What the file "COMPCORE\MoveObject.cpp" has in line 439 and around this line?
COMPCORE\MoveObject.cpp is not part of my project. It appears to be an internal error in the compiler. In examination of the release notes for the compiler it appears that there have been similar issues in the past. In version 10.62 there was an internal library defect corrected.
- Defect #32032. Fixed error "Internal error Assertion "false"
failed in file COMPCORE\CC_IA.CPP, line 627"
This is the only reference I was able to find regarding COMPCORE
Update.. I moved the offending routine to the main file and the error moved with it... I can not see anything wrong with it...