[En-Nut-Discussion] NutEnterCritical

ml mludwig at adc-elektronik.de
Mon Oct 1 11:21:19 CEST 2007


Thank you Harald,

i forgot the basics :( I use Ethernut 3 Board with latest 4.4.0 Nut Version.
YAGARTO and Eclipse.
The above example looks in Assembler like

    NutEnterCritical();   
0x000015b0 <FlashWriteByte+20>:  mrs    r3, CPSR
0x000015b4 <FlashWriteByte+24>:  stmdb  sp!, {r3}
0x000015b8 <FlashWriteByte+28>:  orr    r3, r3, #192	; 0xc0
0x000015bc <FlashWriteByte+32>:  msr    CPSR_fc, r3
0x000015c0 <FlashWriteByte+36>:  str    r3, [sp, #12]
    if ((u_long)addr & 1) {
0x000015c4 <FlashWriteByte+40>:  ldr    r3, [sp, #4]
0x000015c8 <FlashWriteByte+44>:  and    r3, r3, #1	; 0x1
0x000015cc <FlashWriteByte+48>:  and    r3, r3, #255	; 0xff
0x000015d0 <FlashWriteByte+52>:  cmp    r3, #0	; 0x0
0x000015d4 <FlashWriteByte+56>:  beq    0x161c <FlashWriteByte+128

After the stmdb eclipse show´s me a wrong value for addr. programm doesn´t
work
anymore. I have no own threads in the Programm. It´s very very simple only
calling
this routine and some IO on RS232.

Any idea ?

best regards Martin



Harald Kipp wrote:
> 
> Martin,
> 
> It would have been helpful to know more about your environment, Nut/OS 
> version, target board, etc.
> 
> Possibly this ChangeLog entry helps:
> 
> 2007-09-11  Harald Kipp  <foo at bar>
> 
>         * include/arch/avr/atom.h: NutEnter/ExitCritical destroyed R0.
>         Many thanks to Jean Pierre Gauthier for tracking this hidden bug.
> 
> It is fixed in 4.4. If you don't want to upgrade now, replace the 
> NutEnter/ExitCritical macros with the newer versions from CVS
> http://ethernut.cvs.sourceforge.net/ethernut/nut/include/arch/arm/atom.h?revision=1.4
> 
> Harald
> 
> ml schrieb:
>> i try to use NutEnterCritical to switch of all Interrupts. In the
>> following
>> Example my Programm chrashed.
>>   
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> 

-- 
View this message in context: http://www.nabble.com/NutEnterCritical-tf4538764.html#a12975797
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list