This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1002008] New: using floating-point operations
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-bugs at ecos dot sourceware dot org
- Date: Wed, 03 Sep 2014 13:36:24 +0000
- Subject: [Bug 1002008] New: using floating-point operations
- Authentication-results: sourceware.org; auth=none
- Auto-submitted: auto-generated
Please do not reply to this email, use the link below.
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1002008
Bug ID: 1002008
Summary: using floating-point operations
Product: eCos
Version: 3.0
Target: All
Architecture/Host ARM
OS:
Status: UNCONFIRMED
Severity: critical
Priority: low
Component: Other
Assignee: unassigned@bugs.ecos.sourceware.org
Reporter: akinin_a@oaoesp.ru
CC: ecos-bugs@ecos.sourceware.org
Created attachment 2540
--> http://bugs.ecos.sourceware.org/attachment.cgi?id=2540&action=edit
Most of the program code and the description in the application. (pdf file)
Hello. We had a problem when programming in our controller.
That we have:
1. LPC3210, ARM-9, eCos 3.0
2. thread - "Main cycle"
cyg_thread_create (
PRI_MAIN_CYCLE,// priority
MainCycle, // entry
0, // entry parameter
"Main cycle", // name
&thread_stack[MAIN_THREAD], // stack
STACK_SIZE, // stack size
&handle[MAIN_THREAD], // handle
&thread_data[MAIN_THREAD]); // thread data structure
3. Interrupt ADC ( 1 per 200 microseconds)
4. Two different cycle on thred âMain cycle"
int it;
float mtest_element[101];
int mtest_intelement[101];
long long mtest_longelement[101];
part code 1:
mtest_longelement[it]=(long long)mtest_element[it];
if(mtest_longelement[it]!=(long long)it)
{
diag_printf("ERROR err_i %d int %d \n", mtest_longelement[it], it);
}
part code 2:
mtest_intelement[it]=(int)mtest_element[it];
if(mtest_intelement[it]!=it)
{
diag_printf("ERROR err_i %d int %d \n", mtest_intelement[it], it);
}
Case 1
When we use an array of "long long" type and ADC interrupt is enabled all is
OK.
Case 2
When we use an array of "int" type and ADC interrupt is enabled there is data
corruption.
Case 3
When we use an array of "int" type and ADC interrupt is disabled all is OK too.
What wrong?
We certainly observe that the interrupt handler working with VFP modifies float
data used in other thread. How and where is the VFP state saving realized?
Most of the program code in the attachment.
Thank you,
Andrey.
--
You are receiving this mail because:
You are on the CC list for the bug.