Forum : 8051
Post Information | Post |
---|---|
September 9, 2013 - 4:00pm
|
Hi I seem to have a problem with code generated to access field of a struct in idata. With a shared header.h file containing: typedef unsigned int INT16_U; typedef struct INT16_U TZSamplingTicks; }TT_LOGGING_STATE_VECTOR; extern TT_LOGGING_STATE_VECTOR idata StateVector; and sleepB3.c containing TT_LOGGING_STATE_VECTOR idata StateVector; INT16_U SleepTicksChunk; The assignment: 396 2 SleepTicksChunk = StateVector.TZSamplingTicks; generates the following code: ; SOURCE LINE # 396 The above code fails to make the required assignment. It appears to me that the necessary indirection is absent, and the effect of the MOV statements will be to pick up the bytes at the same addresses in data, rather than idata. Is this perhaps an error in your compiler? I am using version RC51 Compiler 6.14.12.0087 Thank you Damien |
Hello,
We confirm this issue! this appear when you set the optimisation to level 7 (not for 6).
The Rkit51 has been corrected and soon will arrive a new release of this kit.
I can send you this kit corrected if you cannot wait for the next release.
Best regards,
Hi Etienne
Thank you for confirming this and for fixing it quickly.
I also experienced a related issue that your fix may have cured: I have code which performs arithmetic (addition and subtraction) on unsigned 32 bit variables; the code worked correctly when the variables were in data, but it failed when they were moved to idata.
I put in a workaround to overcome this; but if necessary I can restore the old code and produce assember listings for you.
Best
Damien
Hi Damien,
Can you send us the old code to
Thank a lot for reporting issue.
Best regards,
The second issue has been solved. It works with the latest release.
Best regards,