This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1002008] New: using floating-point operations


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]