IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Arduino Discussion :

Test if ignoré


Sujet :

Arduino

  1. #21
    Membre à l'essai
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 49
    Points : 20
    Points
    20
    Par défaut WDT sur Arduino Uno
    Bonjour Vincent PETIT


    Citation Envoyé par Vincent PETIT Voir le message
    Salut,

    Arduino active le WDT dans ton dos (et de toute manière au démarrage il est activé par défaut), de la même manière qu'il configure le TIMER0 pour la fonction delay etc... Arduino fait plein de trucs sans le dire.

    Dans ton programme le WDT est activé et c'est lui qui reset le micro au bout d'un certain temps.
    J'ai bien lu toutes les réponses et signalé qu'il N'y avait PAS de déclenchement du watchdog.
    Sur Arduino Uno , le WDT N'est PAS activé par défaut.
    Dans les cas de dysfonctionnement cités, le WDT N'est PAS en cause.

    Il est clairement établi que l'optimiseur, dans divers cas de figures , supprime la génération correcte du test de n_trame et de la boucle infinie.

    Cordialement,
    bidouilleelec

  2. #22
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 190
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Consultant en Systèmes Embarqués
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Avril 2002
    Messages : 3 190
    Points : 11 573
    Points
    11 573
    Par défaut
    Hummm ça n'est pas vraiment ce que je vois en dé-assemblant ton programme.

    J'ai fait un avr-objdump -h -d -l -S ton_programme.elf dans les deux versions, c'est à dire la version qui fonctionne sans le commentaire de la ligne 34 et avec le commentaire sur la ligne 34.

    Que l'optimisation supprime du code, c'est possible car je me suis déjà fait avoir et c'est pour cette raison que je l'ai dit dans le message #8 https://www.developpez.net/forums/d1.../#post10335282 mais là, après désassemblage on voit bien la présence de l'intégralité de ton programme, à la ligne 34 prés, que l'on soit dans la version qui marche ou celle qui ne marche pas.


    Pour apporter des éléments de lecture :
    Dans les fichiers désassemblés, par exemple la ligne /usr/share/arduino/sketch_jul10a.ino:31 correspond exactement à la ligne 31 de ton programme. Par exemple, le code désassemblé de la version avec commentaire, ne fait pas référence à la ligne 34. Mais si tu regardes de prés tu verras quand les deux versions le compilateur n'a pas supprimer du code.

    Ta condition if ( n_trame <= C_nb_trame ) se trouve à la ligne 33 dans ton programme ce qui correspond, dans les deux fichiers désassemblés, aux lignes /usr/share/arduino/sketch_jul10a.ino:33


    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    /*
     *Le programme attend la saisie d'un caractère 'c' pour afficher une trame de C_maxcar octets.
     *Ces octets contiennent les codes ascii consécutifs des caractères '0' à 'C'.
     *Cet affichage devrait se produire C_nb_trame fois.
     
     *Alors, le souci :
     *Si les instructions Serial.print de la ligne 34 sont commentées, le test de n_trame est ignoré.
     *Si ces instructions sont actives, le test est respecté !?!?!? 
     */
     
    const int C_maxcar = 20; //256  
    const unsigned long C_nb_trame = 3 ;    // nb envoi de C_nb_trames de C_maxcar byte
    const byte C_valeur_octetdedepart =  0x30;  // 0x00 ;  //0xFB;  //0x30 = code de zéro
    byte octet[(C_maxcar)] ;
    int n_trame = 1;
    bool recu = false;
    char incomingByte = 'a';
     
    // ***************************************************
    void setup() { 
     
    Serial.begin(115200);      //1024000 230400  768000
    delay(500);
    // *** initialise un tableau de byte
        for (int k = 0; k<= C_maxcar - 1; k++){
            octet[k]  = k + C_valeur_octetdedepart ;       // code ascii de 0123456789:;<=>?@ABC      
        } // fin for            
    } // fin setup
     
    // ***************************************************
    void loop() {  
      recu = false;              
          if ( n_trame <= C_nb_trame ){
              //Serial.println("after test n_trame ");Serial.print("C_nb_trame = "); Serial.print(C_nb_trame);
              // *** attend un caractère 'c'
              while ( !recu ){
                    if (Serial.available() > 0) {
                        incomingByte = Serial.read();            
                        if (incomingByte == 'c' ) {                         
                            incomingByte = 'z';           
                            recu = true;                        
                        } // fin in == 'c'
                    } // fin Serial.available   
              } // fin while
     
              Serial.write(octet , C_maxcar);
              Serial.flush();                    
               n_trame++;
               //Serial.println("after test n_trame ");Serial.print("C_nb_trame = "); Serial.print(C_nb_trame);
          } // fin if n_trame
          else                
          {
            while (true) ;
          } // fin while        
    } // fin loop

    Voici le code désassemblé de ton programme avec le commentaire de la ligne 34 (je ne mets que la fonction loop())
    Code A : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    000000ea <loop>:
    loop():
    /usr/share/arduino/sketch_jul10a.ino:31
      ea:	cf 93       	push	r28
      ec:	df 93       	push	r29
    /usr/share/arduino/sketch_jul10a.ino:32
      ee:	10 92 14 01 	sts	0x0114, r1
    /usr/share/arduino/sketch_jul10a.ino:33
      f2:	80 91 01 01 	lds	r24, 0x0101
      f6:	90 91 02 01 	lds	r25, 0x0102
      fa:	04 97       	sbiw	r24, 0x04	; 4
      fc:	08 f0       	brcs	.+2      	; 0x100 <loop+0x16>
      fe:	32 c0       	rjmp	.+100    	; 0x164 <loop+0x7a>
    /usr/share/arduino/sketch_jul10a.ino:40
     100:	ca e7       	ldi	r28, 0x7A	; 122
    /usr/share/arduino/sketch_jul10a.ino:41
     102:	d1 e0       	ldi	r29, 0x01	; 1
    /usr/share/arduino/sketch_jul10a.ino:36
     104:	80 91 14 01 	lds	r24, 0x0114
     108:	81 11       	cpse	r24, r1
     10a:	14 c0       	rjmp	.+40     	; 0x134 <loop+0x4a>
    /usr/share/arduino/sketch_jul10a.ino:37
     10c:	82 e3       	ldi	r24, 0x32	; 50
     10e:	91 e0       	ldi	r25, 0x01	; 1
     110:	0e 94 ab 01 	call	0x356	; 0x356 <_ZN14HardwareSerial9availableEv>
     114:	18 16       	cp	r1, r24
     116:	19 06       	cpc	r1, r25
     118:	ac f7       	brge	.-22     	; 0x104 <loop+0x1a>
    /usr/share/arduino/sketch_jul10a.ino:38
     11a:	82 e3       	ldi	r24, 0x32	; 50
     11c:	91 e0       	ldi	r25, 0x01	; 1
     11e:	0e 94 d7 01 	call	0x3ae	; 0x3ae <_ZN14HardwareSerial4readEv>
     122:	80 93 00 01 	sts	0x0100, r24
    /usr/share/arduino/sketch_jul10a.ino:39
     126:	83 36       	cpi	r24, 0x63	; 99
     128:	69 f7       	brne	.-38     	; 0x104 <loop+0x1a>
    /usr/share/arduino/sketch_jul10a.ino:40
     12a:	c0 93 00 01 	sts	0x0100, r28
    /usr/share/arduino/sketch_jul10a.ino:41
     12e:	d0 93 14 01 	sts	0x0114, r29
     132:	e8 cf       	rjmp	.-48     	; 0x104 <loop+0x1a>
    /usr/share/arduino/sketch_jul10a.ino:46
     134:	44 e1       	ldi	r20, 0x14	; 20
     136:	50 e0       	ldi	r21, 0x00	; 0
     138:	65 e1       	ldi	r22, 0x15	; 21
     13a:	71 e0       	ldi	r23, 0x01	; 1
     13c:	82 e3       	ldi	r24, 0x32	; 50
     13e:	91 e0       	ldi	r25, 0x01	; 1
     140:	0e 94 83 01 	call	0x306	; 0x306 <_ZN5Print5writeEPKhj>
    /usr/share/arduino/sketch_jul10a.ino:47
     144:	82 e3       	ldi	r24, 0x32	; 50
     146:	91 e0       	ldi	r25, 0x01	; 1
     148:	0e 94 f7 01 	call	0x3ee	; 0x3ee <_ZN14HardwareSerial5flushEv>
    /usr/share/arduino/sketch_jul10a.ino:48
     14c:	80 91 01 01 	lds	r24, 0x0101
     150:	90 91 02 01 	lds	r25, 0x0102
     154:	01 96       	adiw	r24, 0x01	; 1
     156:	90 93 02 01 	sts	0x0102, r25
     15a:	80 93 01 01 	sts	0x0101, r24
    /usr/share/arduino/sketch_jul10a.ino:55
     15e:	df 91       	pop	r29
     160:	cf 91       	pop	r28
     162:	08 95       	ret
    /usr/share/arduino/sketch_jul10a.ino:33
     164:	ff cf       	rjmp	.-2      	; 0x164 <loop+0x7a>

    Et ici, toujours le loop() de ton programme mais en retirant le commentaire de la ligne 34.
    Code A : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    000000ea <loop>:
    loop():
    /usr/share/arduino/sketch_jul10a.ino:31
      ea:	cf 93       	push	r28
      ec:	df 93       	push	r29
    /usr/share/arduino/sketch_jul10a.ino:32
      ee:	10 92 36 01 	sts	0x0136, r1
    /usr/share/arduino/sketch_jul10a.ino:33
      f2:	80 91 01 01 	lds	r24, 0x0101
      f6:	90 91 02 01 	lds	r25, 0x0102
      fa:	04 97       	sbiw	r24, 0x04	; 4
      fc:	08 f0       	brcs	.+2      	; 0x100 <loop+0x16>
      fe:	48 c0       	rjmp	.+144    	; 0x190 <loop+0xa6>
    /usr/share/arduino/sketch_jul10a.ino:34
     100:	63 e0       	ldi	r22, 0x03	; 3
     102:	71 e0       	ldi	r23, 0x01	; 1
     104:	84 e5       	ldi	r24, 0x54	; 84
     106:	91 e0       	ldi	r25, 0x01	; 1
     108:	0e 94 f3 01 	call	0x3e6	; 0x3e6 <_ZN5Print7printlnEPKc>
     10c:	67 e1       	ldi	r22, 0x17	; 23
     10e:	71 e0       	ldi	r23, 0x01	; 1
     110:	84 e5       	ldi	r24, 0x54	; 84
     112:	91 e0       	ldi	r25, 0x01	; 1
     114:	0e 94 d6 01 	call	0x3ac	; 0x3ac <_ZN5Print5printEPKc>
     118:	2a e0       	ldi	r18, 0x0A	; 10
     11a:	30 e0       	ldi	r19, 0x00	; 0
     11c:	43 e0       	ldi	r20, 0x03	; 3
     11e:	50 e0       	ldi	r21, 0x00	; 0
     120:	60 e0       	ldi	r22, 0x00	; 0
     122:	70 e0       	ldi	r23, 0x00	; 0
     124:	84 e5       	ldi	r24, 0x54	; 84
     126:	91 e0       	ldi	r25, 0x01	; 1
     128:	0e 94 5b 02 	call	0x4b6	; 0x4b6 <_ZN5Print5printEmi>
    /usr/share/arduino/sketch_jul10a.ino:40
     12c:	ca e7       	ldi	r28, 0x7A	; 122
    /usr/share/arduino/sketch_jul10a.ino:41
     12e:	d1 e0       	ldi	r29, 0x01	; 1
    /usr/share/arduino/sketch_jul10a.ino:36
     130:	80 91 36 01 	lds	r24, 0x0136
     134:	81 11       	cpse	r24, r1
     136:	14 c0       	rjmp	.+40     	; 0x160 <loop+0x76>
    /usr/share/arduino/sketch_jul10a.ino:37
     138:	84 e5       	ldi	r24, 0x54	; 84
     13a:	91 e0       	ldi	r25, 0x01	; 1
     13c:	0e 94 68 02 	call	0x4d0	; 0x4d0 <_ZN14HardwareSerial9availableEv>
     140:	18 16       	cp	r1, r24
     142:	19 06       	cpc	r1, r25
     144:	ac f7       	brge	.-22     	; 0x130 <loop+0x46>
    /usr/share/arduino/sketch_jul10a.ino:38
     146:	84 e5       	ldi	r24, 0x54	; 84
     148:	91 e0       	ldi	r25, 0x01	; 1
     14a:	0e 94 94 02 	call	0x528	; 0x528 <_ZN14HardwareSerial4readEv>
     14e:	80 93 00 01 	sts	0x0100, r24
    /usr/share/arduino/sketch_jul10a.ino:39
     152:	83 36       	cpi	r24, 0x63	; 99
     154:	69 f7       	brne	.-38     	; 0x130 <loop+0x46>
    /usr/share/arduino/sketch_jul10a.ino:40
     156:	c0 93 00 01 	sts	0x0100, r28
    /usr/share/arduino/sketch_jul10a.ino:41
     15a:	d0 93 36 01 	sts	0x0136, r29
     15e:	e8 cf       	rjmp	.-48     	; 0x130 <loop+0x46>
    /usr/share/arduino/sketch_jul10a.ino:46
     160:	44 e1       	ldi	r20, 0x14	; 20
     162:	50 e0       	ldi	r21, 0x00	; 0
     164:	67 e3       	ldi	r22, 0x37	; 55
     166:	71 e0       	ldi	r23, 0x01	; 1
     168:	84 e5       	ldi	r24, 0x54	; 84
     16a:	91 e0       	ldi	r25, 0x01	; 1
     16c:	0e 94 99 01 	call	0x332	; 0x332 <_ZN5Print5writeEPKhj>
    /usr/share/arduino/sketch_jul10a.ino:47
     170:	84 e5       	ldi	r24, 0x54	; 84
     172:	91 e0       	ldi	r25, 0x01	; 1
     174:	0e 94 b4 02 	call	0x568	; 0x568 <_ZN14HardwareSerial5flushEv>
    /usr/share/arduino/sketch_jul10a.ino:48
     178:	80 91 01 01 	lds	r24, 0x0101
     17c:	90 91 02 01 	lds	r25, 0x0102
     180:	01 96       	adiw	r24, 0x01	; 1
     182:	90 93 02 01 	sts	0x0102, r25
     186:	80 93 01 01 	sts	0x0101, r24
    /usr/share/arduino/sketch_jul10a.ino:55
     18a:	df 91       	pop	r29
     18c:	cf 91       	pop	r28
     18e:	08 95       	ret
    /usr/share/arduino/sketch_jul10a.ino:33
     190:	ff cf       	rjmp	.-2      	; 0x190 <loop+0xa6>
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  3. #23
    Membre à l'essai
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 49
    Points : 20
    Points
    20
    Par défaut Résultat dépendant de la chaine de génération?
    Bonjour Vincent PETIT

    Citation Envoyé par Vincent PETIT Voir le message
    Hummm ça n'est pas vraiment ce que je vois en dé-assemblant ton programme.

    après désassemblage on voit bien la présence de l'intégralité de ton programme, à la ligne 34 prés, que l'on soit dans la version qui marche ou celle qui ne marche pas.
    Merci de votre réponse.
    En effet .
    J'en reste tout ébaubi!
    Cela contredit de nombreuses vérifications par de multiples personnes.
    C'est furieusement intéressant et pourrait bien permettre d'avancer.

    Pourriez vous communiquer l'intégralité de votre résultat de compilation ?
    Compilez vous pour un Arduino UNO ? avec la chaine standard de l'IDE Arduino?

    Cordialement,
    bidouilleelec

  4. #24
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 190
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Consultant en Systèmes Embarqués
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Avril 2002
    Messages : 3 190
    Points : 11 573
    Points
    11 573
    Par défaut
    Salut,
    En effet j'ai compilé ton programme avec l'IDE Arduino officiel 2:1.0.5, je ne sais pas si c'est la dernière version mais c'est celle qui est fournie avec ma distribution Linux Ubuntu.

    Ps: j'ai donc activé les informations sur la compilation afin de détecter un éventuel problème.

    Nom : Capture du 2018-07-11 12-54-53.png
Affichages : 198
Taille : 312,9 Ko

    Voici le résultat de la compilation avec ou sans commentaire de la ligne 34.
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp -o /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.o

    sketch_jul10a.ino: In function ‘void loop()’:
    sketch_jul10a.ino:33:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]


    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/wiring.c -o /tmp/build5937091251372202973.tmp/wiring.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/wiring_shift.c -o /tmp/build5937091251372202973.tmp/wiring_shift.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/wiring_digital.c -o /tmp/build5937091251372202973.tmp/wiring_digital.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/WInterrupts.c -o /tmp/build5937091251372202973.tmp/WInterrupts.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/wiring_analog.c -o /tmp/build5937091251372202973.tmp/wiring_analog.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/avr-libc/realloc.c -o /tmp/build5937091251372202973.tmp/realloc.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/avr-libc/malloc.c -o /tmp/build5937091251372202973.tmp/malloc.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c -o /tmp/build5937091251372202973.tmp/wiring_pulse.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/WMath.cpp -o /tmp/build5937091251372202973.tmp/WMath.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/IPAddress.cpp -o /tmp/build5937091251372202973.tmp/IPAddress.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/new.cpp -o /tmp/build5937091251372202973.tmp/new.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/Print.cpp -o /tmp/build5937091251372202973.tmp/Print.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard

    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp -o /tmp/build5937091251372202973.tmp/HardwareSerial.cpp.o
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp: In function ‘void store_char(unsigned char, ring_buffer*)’:
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:100:9: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (i != buffer->tail) {
    ^
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp: In function ‘void __vector_18()’:

    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:129:21: warning: unused variable ‘c’ [-Wunused-variable]
    unsigned char c = UDR0;
    ^
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp: In member function ‘void HardwareSerial::begin(long unsigned int, byte)’:
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:370:11: warning: unused variable ‘current_config’ [-Wunused-variable]
    uint8_t current_config;
    ^
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp: In member function ‘virtual size_t HardwareSerial::write(uint8_t)’:
    /usr/share/arduino/hardware/arduino/cores/arduino/HardwareSerial.cpp:469:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while (i == _tx_buffer->tail)
    ^

    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/WString.cpp -o /tmp/build5937091251372202973.tmp/WString.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/USBCore.cpp -o /tmp/build5937091251372202973.tmp/USBCore.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/Stream.cpp -o /tmp/build5937091251372202973.tmp/Stream.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/Tone.cpp -o /tmp/build5937091251372202973.tmp/Tone.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/main.cpp -o /tmp/build5937091251372202973.tmp/main.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/CDC.cpp -o /tmp/build5937091251372202973.tmp/CDC.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=105 -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/standard /usr/share/arduino/hardware/arduino/cores/arduino/HID.cpp -o /tmp/build5937091251372202973.tmp/HID.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/wiring.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/wiring_shift.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/wiring_digital.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/WInterrupts.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/wiring_analog.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/realloc.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/malloc.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/wiring_pulse.c.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/WMath.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/IPAddress.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/new.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/Print.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/HardwareSerial.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/WString.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/USBCore.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/Stream.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/Tone.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/main.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/CDC.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-ar rcs /tmp/build5937091251372202973.tmp/core.a /tmp/build5937091251372202973.tmp/HID.cpp.o
    /usr/share/arduino/hardware/tools/avr/bin/avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.elf /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.o /tmp/build5937091251372202973.tmp/core.a -L/tmp/build5937091251372202973.tmp -lm
    /usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.elf /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.eep
    /usr/share/arduino/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.elf /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.hex
    Taille binaire du croquis*: 1*934 octets (d'un max de 32*256 octets)
    On y voit quelques warning mais rien de bien méchant.

    Ensuite j'ai fait un avr-objdump -h -d -l -S /tmp/build5937091251372202973.tmp/sketch_jul10a.cpp.elf et je t'ai montré la partie la plus intéressante du désassemblage, qui est bien plus volumineux.

    Citation Envoyé par ducelier
    Cela contredit de nombreuses vérifications par de multiples personnes.
    Ces personnes n'ont peut être pas été jusqu'à la décompilation ?




    J'ai du mal à comprendre ce qu'est sensé faire ton programme ? Peux tu m'expliquer ce qu'il doit faire ? Genre un petit mode opératoire (tu fais ci et tu reçois ça depuis le terminal). J'ai besoin de comprendre le programme pour essayer de comprendre le problème.

    Il faudrait modifier les options d'optimisation avr-g++ -Os pour en essayer d'autres et constater ou pas le problème.

    Je regarderai prochainement dans tous les fichiers que Arduino joint au sketch afin de vérifier l'état du watchdog car tu sembles certain qu'il n'est pas activé par défaut alors que moi il me semblait bien qu'il l'était.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    wiring.c.o 
    wiring_shift.c.o 
    wiring_digital.c.o 
    WInterrupts.c.o 
    wiring_analog.c.o 
    realloc.c.o 
    malloc.c.o 
    wiring_pulse.c.o 
    WMath.cpp.o 
    IPAddress.cpp.o 
    new.cpp.o 
    Print.cpp.o 
    HardwareSerial.cpp.o 
    WString.cpp.o 
    USBCore.cpp.o 
    Stream.cpp.o 
    Tone.cpp.o 
    main.cpp.o 
    CDC.cpp.o 
    HID.cpp.o
    Par contre je n'ai pas beaucoup de temps en ce moment, faudra me laisser un peu de temps ou le faire avec moi.
    A+
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  5. #25
    Membre à l'essai
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 49
    Points : 20
    Points
    20
    Par défaut chaine de production
    Hello Vincent Petit

    En effet j'ai compilé ton programme avec l'IDE Arduino officiel 2:1.0.5, je ne sais pas si c'est la dernière version mais c'est celle qui est fournie avec ma distribution Linux Ubuntu.
    Ah! Nous n'utilisons pas la même chaine de production : j'utilise l'IDE 1.8.4 et/ou 1.8.5 sous Windows 10.
    Sur les fils lancés sur les forums arduino.cc français et anglais, les personnes utilisant d'autres chaines de compilation (Arduino-Makefile) ou tournant sous OS X ou Linux ne constatent pas le phénomène.
    Cela pourrait bien être une explication pour nos divergences?

    Ces personnes n'ont peut être pas été jusqu'à la décompilation ?
    Oh! si!
    Et sur plusieurs versions du programme plus ou moins modifié et/ou simplifié.


    J'ai du mal à comprendre ce qu'est sensé faire ton programme ? Peux tu m'expliquer ce qu'il doit faire ? Genre un petit mode opératoire (tu fais ci et tu reçois ça depuis le terminal). J'ai besoin de comprendre le programme pour essayer de comprendre le problème.
    Au départ : à envoyer une trame d'octets binaires aléatoires via la liaison USB à un programme tournant sur le PC.

    Je regarderai prochainement dans tous les fichiers que Arduino joint au sketch afin de vérifier l'état du watchdog car tu sembles certain qu'il n'est pas activé par défaut alors que moi il me semblait bien qu'il l'était.
    Avec l'ESP8266, les watchdogs sont activés par défaut; pas avec l'arduino ( UNO en tous cas ). Certain et vérifié depuis longtemps.

    Encore merci pour vos réponses.

    Cordialement,
    bidouilleelec

  6. #26
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 190
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Consultant en Systèmes Embarqués
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Avril 2002
    Messages : 3 190
    Points : 11 573
    Points
    11 573
    Par défaut
    Citation Envoyé par ducelier Voir le message
    Ah! Nous n'utilisons pas la même chaine de production [...]
    Cela pourrait bien être une explication pour nos divergences?
    En effet ça semble possible.

    Citation Envoyé par ducelier Voir le message
    Oh! si!
    Et sur plusieurs versions du programme plus ou moins modifié et/ou simplifié.
    D'accord. Si ils ont constaté la disparition du code lors du désassemblage alors c'est que les options d'optimisation ont eu une influence trop importante sur le fonctionnement du soft. Il aurait été intéressant de ne pas l'optimiser afin de voir ce qu'il se passe.

    Citation Envoyé par ducelier Voir le message
    Avec l'ESP8266, les watchdogs sont activés par défaut; pas avec l'arduino ( UNO en tous cas ). Certain et vérifié depuis longtemps.
    Alors c'est moi qui était persuadé, à tord, du contraire. Je vais te croire sur parole et m'épargner une analyse de tout ça De toute façon je n'utilise pas Arduino en temps normal, je programme directement en C avec AVR-GCC comme ça si le WDT est activé ou pas, c'est forcément par moi
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  7. #27
    Membre à l'essai
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 49
    Points : 20
    Points
    20
    Par défaut variations sur les options d'optimisation
    Bonjour Vincent PETIT

    Citation Envoyé par Vincent PETIT Voir le message
    En effet ça semble possible.

    D'accord. Si ils ont constaté la disparition du code lors du désassemblage alors c'est que les options d'optimisation ont eu une influence trop importante sur le fonctionnement du soft. Il aurait été intéressant de ne pas l'optimiser afin de voir ce qu'il se passe.
    Important :
    ma chaine de production est :
    IDE Arduino 1.8.4 et/ou 1.8.5 ( Windows 10) qui utilise :
    _ avr-gcc 4.9.2
    _ avr-g++ 4.9.2
    _ avrdude V6.3
    _ un fichier Platform.txt avec l'option -Os


    J'appelle version NOK la version d'un programme compilé avec -Os ( option "standart de l'IDE Arduino) et qui ne fonctionne pas ,chez moi, comme attendu par un être humain standard.

    J'ai fait des essais avec plusieurs versions NOK en utilisant ( dans platform.txt 3 occurences de -Os) -O0 , -O2 , -O3 .

    Avec -O0 , -O2 : l'exécution est toujours OK.
    Avec -O3 : quelques fois le résultat devient OK.

    Avec les programmes utilisés et avec l'option -O2 , l'augmentation de taille du programme en Flash est négligeable, nulle en Ram.

    Cordialement et Bon match,
    bidouilleelec

  8. #28
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 190
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Consultant en Systèmes Embarqués
    Secteur : High Tech - Électronique et micro-électronique

    Informations forums :
    Inscription : Avril 2002
    Messages : 3 190
    Points : 11 573
    Points
    11 573
    Par défaut
    Tu pourrais me montrer un désassemblage avr-objdump -h -d -l -S /????/tonfichier.cpp.elf que je constate la disparition de ton code entre la version "ligne 34 en commentaire " et "ligne 34 opérationnelle" ?

    Merci.
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  9. #29
    Membre à l'essai
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    49
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 49
    Points : 20
    Points
    20
    Par défaut
    Bonjour Vincent PETIT

    Voici l'assembleur d'un exemple NOK.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
     
    int n_trame = 1;
    bool recu = false;
    char incomingByte = 'a';
     
    void setup() {
      Serial.begin(115200);
    } // fin setup
     
    void loop() {
     
      recu = false;  
      if ( n_trame <= 3 ) 
      { 
          while ( !recu ) 
          {
                 if (Serial.available() > 0) 
                 {
                     incomingByte = Serial.read();            
                     if (incomingByte == 'c' )
                     {                                                    
                         recu = true;                        
                     } // fin in == 'c'
                 } // fin Serial.available             
          } // fin while
          Serial.println(n_trame);
          n_trame++;      
      }  // fin if n_trame
      else
      {    
        while(1);   // {asm("");}  //OK avec asm(""); https://stackoverflow.com/questions/7083482/how-to-prevent-gcc-from-optimizing-out-a-busy-wait-loop
      } // fin else n_trame 
    } // fin loop
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
     
    5a4:	80 83       	st	Z, r24
     *********************************************************************************
    loop():
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:21
    **** recu = true;
     5a6:	11 e0       	ldi	r17, 0x01	; 1								//*** ???pour recu=true????
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:11
    **** recu = false;
    void loop();
     5a8:	10 92 18 01 	sts	0x0118, r1	; 0x800118 <__data_end>			//*** r1->recu
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:12
    **** if ( n_trame <= 3 )
    #line 5 +++++++Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino"
     5ac:	c0 91 01 01 	lds	r28, 0x0101	; 0x800101 <n_trame>			//*** n_trame->r28,r29
     5b0:	d0 91 02 01 	lds	r29, 0x0102	; 0x800102 <n_trame+0x1>
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:14
    while ( !recu )
     5b4:	80 91 18 01 	lds	r24, 0x0118	; 0x800118 <__data_end>			//*** recu->r24
     5b8:	81 11       	cpse	r24, r1									//*** saut à 5bc si r24=51 (recu = false)
     5ba:	12 c0       	rjmp	.+36     	; 0x5e0 <main+0x12a>		//*** saut si recu=vrai (pour print)
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:16
    **** if (Serial.available() > 0) 
     
     5bc:	82 e2       	ldi	r24, 0x22	; 34
     5be:	91 e0       	ldi	r25, 0x01	; 1
     5c0:	0e 94 c0 00 	call	0x180	; 0x180 <_ZN14HardwareSerial9availableEv>
     5c4:	18 16       	cp	r1, r24
     5c6:	19 06       	cpc	r1, r25
     5c8:	ac f7       	brge	.-22     	; 0x5b4 <main+0xfe>
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:18
    **** incomingByte = Serial.read();
     5ca:	82 e2       	ldi	r24, 0x22	; 34
     5cc:	91 e0       	ldi	r25, 0x01	; 1
     5ce:	0e 94 9e 00 	call	0x13c	; 0x13c <_ZN14HardwareSerial4readEv>
     5d2:	80 93 00 01 	sts	0x0100, r24	; 0x800100 <__data_start>		//*** r24->incomingByte
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:19
    **** if (incomingByte == 'c' )  
     5d6:	83 36       	cpi	r24, 0x63	; 99							//*** if (incomingByte == 'c' )
     5d8:	69 f7       	brne	.-38     	; 0x5b4 <main+0xfe>			//*** saut à while(!recu) si r24!= c
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:21
    **** recu = true;
     5da:	10 93 18 01 	sts	0x0118, r17	; 0x800118 <__data_end>			//*** r17->recu
     5de:	ea cf       	rjmp	.-44     	; 0x5b4 <main+0xfe>			//*** saut à while(!recu)
     5e0:	6e 01       	movw	r12, r28
     5e2:	0d 2e       	mov	r0, r29
     5e4:	00 0c       	add	r0, r0
     5e6:	ee 08       	sbc	r14, r14
     5e8:	ff 08       	sbc	r15, r15
    print():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.cpp:92
    size_t Print::print(long n, int base)
    {
      if (base == 0) {
        return write(n);
      } else if (base == 10) {
        if (n < 0) {
     5ea:	d7 ff       	sbrs	r29, 7
     5ec:	14 c0       	rjmp	.+40     	; 0x616 <main+0x160>
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.cpp:69
      return write(str);
    }
     
    size_t Print::print(char c)
    {
      return write(c);
     5ee:	e0 91 22 01 	lds	r30, 0x0122	; 0x800122 <Serial>
     5f2:	f0 91 23 01 	lds	r31, 0x0123	; 0x800123 <Serial+0x1>
     5f6:	01 90       	ld	r0, Z+
     5f8:	f0 81       	ld	r31, Z
     5fa:	e0 2d       	mov	r30, r0
     5fc:	6d e2       	ldi	r22, 0x2D	; 45
     5fe:	82 e2       	ldi	r24, 0x22	; 34
     600:	91 e0       	ldi	r25, 0x01	; 1
     602:	09 95       	icall
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.cpp:94
      if (base == 0) {
        return write(n);
      } else if (base == 10) {
        if (n < 0) {
          int t = print('-');
          n = -n;
     604:	66 27       	eor	r22, r22
     606:	77 27       	eor	r23, r23
     608:	cb 01       	movw	r24, r22
     60a:	6c 19       	sub	r22, r12
     60c:	7d 09       	sbc	r23, r13
     60e:	8e 09       	sbc	r24, r14
     610:	9f 09       	sbc	r25, r15
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.cpp:95
          return printNumber(n, 10) + t;
     612:	4a e0       	ldi	r20, 0x0A	; 10
     614:	03 c0       	rjmp	.+6      	; 0x61c <main+0x166>
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.cpp:97
        }
        return printNumber(n, 10);
     616:	4a e0       	ldi	r20, 0x0A	; 10
     618:	c7 01       	movw	r24, r14
     61a:	b6 01       	movw	r22, r12
     61c:	0e 94 66 01 	call	0x2cc	; 0x2cc <_ZN5Print11printNumberEmh.constprop.7>
    write():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.h:54
          return write((const uint8_t *)str, strlen(str));
     620:	42 e0       	ldi	r20, 0x02	; 2
     622:	50 e0       	ldi	r21, 0x00	; 0
     624:	65 e1       	ldi	r22, 0x15	; 21
     626:	71 e0       	ldi	r23, 0x01	; 1
     628:	82 e2       	ldi	r24, 0x22	; 34
     62a:	91 e0       	ldi	r25, 0x01	; 1
     62c:	0e 94 5f 00 	call	0xbe	; 0xbe <_ZN5Print5writeEPKhj>
    loop():
    ......./Bug_IF_Bpj_NOK_end-start_asm_simp_NOK_1-8-5_Os.ino:26
    **** n_trame++;            
     630:	80 91 01 01 	lds	r24, 0x0101	; 0x800101 <n_trame>			//*** n_trame->r24,r25
     634:	90 91 02 01 	lds	r25, 0x0102	; 0x800102 <n_trame+0x1>
     638:	01 96       	adiw	r24, 0x01	; 1
     63a:	90 93 02 01 	sts	0x0102, r25	; 0x800102 <n_trame+0x1>		//*** n_trame++
     63e:	80 93 01 01 	sts	0x0101, r24	; 0x800101 <n_trame>
    main():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/main.cpp:47
     
    **** if (serialEventRun) serialEventRun();
     642:	0e 94 5c 01 	call	0x2b8	; 0x2b8 <_Z14serialEventRunv>
     646:	b0 cf       	rjmp	.-160    	; 0x5a8 <main+0xf2>			//*** saut à début loop
    // ********************************************************************************************
    00000648 <_GLOBAL__sub_I___vector_18>:
    _ZN5PrintC2Ev():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Print.h:46
        size_t printNumber(unsigned long, uint8_t);
        size_t printFloat(double, uint8_t);
      protected:
        void setWriteError(int err = 1) { write_error = err; }
      public:
        Print() : write_error(0) {}
     648:	e2 e2       	ldi	r30, 0x22	; 34
     64a:	f1 e0       	ldi	r31, 0x01	; 1
     64c:	13 82       	std	Z+3, r1	; 0x03
     64e:	12 82       	std	Z+2, r1	; 0x02
    _GLOBAL__sub_I___vector_18():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/Stream.h:63
      public:
        virtual int available() = 0;
        virtual int read() = 0;
        virtual int peek() = 0;
     
        Stream() {_timeout=1000;}
     650:	88 ee       	ldi	r24, 0xE8	; 232
     652:	93 e0       	ldi	r25, 0x03	; 3
     654:	a0 e0       	ldi	r26, 0x00	; 0
     656:	b0 e0       	ldi	r27, 0x00	; 0
     658:	84 83       	std	Z+4, r24	; 0x04
     65a:	95 83       	std	Z+5, r25	; 0x05
     65c:	a6 83       	std	Z+6, r26	; 0x06
     65e:	b7 83       	std	Z+7, r27	; 0x07
    _ZN14HardwareSerialC2EPVhS1_S1_S1_S1_S1_():
    _Sauv_Arduino_1-8-5\hardware\arduino\avr\cores\arduino/HardwareSerial_private.h:95
      volatile uint8_t *ucsrc, volatile uint8_t *udr) :
        _ubrrh(ubrrh), _ubrrl(ubrrl),
        _ucsra(ucsra), _ucsrb(ucsrb), _ucsrc(ucsrc),
        _udr(udr),
        _rx_buffer_head(0), _rx_buffer_tail(0),
        _tx_buffer_head(0), _tx_buffer_tail(0)
     660:	87 e0       	ldi	r24, 0x07	; 7
     662:	91 e0       	ldi	r25, 0x01	; 1
     664:	91 83       	std	Z+1, r25	; 0x01
     666:	80 83       	st	Z, r24
     668:	85 ec       	ldi	r24, 0xC5	; 197
     66a:	90 e0       	ldi	r25, 0x00	; 0
     66c:	95 87       	std	Z+13, r25	; 0x0d
     66e:	84 87       	std	Z+12, r24	; 0x0c
     670:	84 ec       	ldi	r24, 0xC4	; 196
     672:	90 e0       	ldi	r25, 0x00	; 0
     674:	97 87       	std	Z+15, r25	; 0x0f
     676:	86 87       	std	Z+14, r24	; 0x0e
     678:	80 ec       	ldi	r24, 0xC0	; 192
     67a:	90 e0       	ldi	r25, 0x00	; 0
     67c:	91 8b       	std	Z+17, r25	; 0x11
     67e:	80 8b       	std	Z+16, r24	; 0x10
     680:	81 ec       	ldi	r24, 0xC1	; 193
     682:	90 e0       	ldi	r25, 0x00	; 0
     684:	93 8b       	std	Z+19, r25	; 0x13
     686:	82 8b       	std	Z+18, r24	; 0x12
     688:	82 ec       	ldi	r24, 0xC2	; 194
     68a:	90 e0       	ldi	r25, 0x00	; 0
     68c:	95 8b       	std	Z+21, r25	; 0x15
     68e:	84 8b       	std	Z+20, r24	; 0x14
     690:	86 ec       	ldi	r24, 0xC6	; 198
     692:	90 e0       	ldi	r25, 0x00	; 0
     694:	97 8b       	std	Z+23, r25	; 0x17
     696:	86 8b       	std	Z+22, r24	; 0x16
     698:	11 8e       	std	Z+25, r1	; 0x19
     69a:	12 8e       	std	Z+26, r1	; 0x1a
     69c:	13 8e       	std	Z+27, r1	; 0x1b
     69e:	14 8e       	std	Z+28, r1	; 0x1c
     6a0:	08 95       	ret
     
     
    000006f2 <abort>:
    abort():
     6f2:	81 e0       	ldi	r24, 0x01	; 1
     6f4:	90 e0       	ldi	r25, 0x00	; 0
     6f6:	f8 94       	cli
     6f8:	0c 94 7e 03 	jmp	0x6fc	; 0x6fc <_exit>
     
    000006fc <_exit>:
    exit():
     6fc:	f8 94       	cli
     
    000006fe <__stop_program>:
    __stop_program():
     6fe:	ff cf       	rjmp	.-2      	; 0x6fe <__stop_program>
    Je ne vois ni test de n_trame ni boucle infinie.

    Cordialement,
    bidouilleelec
    Fichiers attachés Fichiers attachés

Discussions similaires

  1. Ignorer une méthode pendant les tests
    Par oxilia dans le forum Spring
    Réponses: 2
    Dernier message: 22/01/2015, 16h54
  2. [NUnit] - Ignorer classe Test
    Par marcel_kobain dans le forum C#
    Réponses: 2
    Dernier message: 15/05/2009, 14h32
  3. [XSL] Test sur un xsl-if qui semble ignoré
    Par Shadow aok dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 18/04/2006, 18h23
  4. [XMLRAD] test de nullité
    Par Pm dans le forum XMLRAD
    Réponses: 5
    Dernier message: 29/11/2002, 10h57
  5. test collisions
    Par tatakinawa dans le forum OpenGL
    Réponses: 5
    Dernier message: 08/06/2002, 06h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo