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

Embarqué Discussion :

Update microcontrôleur ATMEL ATSAMD20J17 [SAM D]


Sujet :

Embarqué

  1. #41
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    la configuration qu'on a fait avec SERCOM4 est bonne car dans un simple programme (un programme normal donc) ça fonctionne ?
    Dans un simple programme le sercom se déclare différemment que dans le bootloader, mais ce qui est sûr c'est que ça marchait avec PB_10 et PB_11 en RX & TX.
    Voici comment il a été déclaré (dans un programme normal) :

    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
    void configure_usart_edison(void) //UART Test sercom4
    {
    	struct usart_config config_usart_edison;
    	usart_get_config_defaults(&config_usart_edison);
    
    	config_usart_edison.baudrate = 19200; //115200
    	config_usart_edison.mux_setting = USART_RX_3_TX_2_XCK_3; // PAD[2] == TX || PAD[3] == RX/XCK
    	config_usart_edison.pinmux_pad0 = PINMUX_PB08D_SERCOM4_PAD0;
    	config_usart_edison.pinmux_pad1 = PINMUX_PB09D_SERCOM4_PAD1;
    	config_usart_edison.pinmux_pad2 = PINMUX_PB10D_SERCOM4_PAD2; // PB 10 !
    	config_usart_edison.pinmux_pad3 = PINMUX_PB11D_SERCOM4_PAD3; // PB 11 !
    	config_usart_edison.character_size= USART_CHARACTER_SIZE_8BIT;
    	config_usart_edison.stopbits = USART_STOPBITS_1;
    
    	while (usart_init(&usart_instance_edison, SERCOM4, &config_usart_edison) != STATUS_OK);
    	stdio_serial_init(&usart_instance_edison, SERCOM4, &config_usart_edison); // Redirect output to uart
    	usart_enable(&usart_instance_edison);
    	printf("Usart init\r\n");
    }
    Sur la même board avec cette configuration ça marche.

    Maintenant quand je passe sur le bootloader, avec une déclaration SERCOM4 (à la place de SERCOM3) de la manière suivante :

    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
    void usart_open()
    {
    	/* Enable & configure alternate function C for pins PB10 & PB11 */
    	PORT->Group[0].PINCFG[10].bit.PMUXEN = 1;
    	PORT->Group[0].PINCFG[11].bit.PMUXEN = 1;
    	PORT->Group[0].PMUX[5].reg = 0x33;
    	/* Enable APB clock for SERCOM4 */
    	PM->APBCMASK.reg |= (1u << 6);
    	/* Configure GCLK generator 0 as clock source for SERCOM4 */
    	GCLK->CLKCTRL.reg = 0x4011;
    	/* Configure SERCOM4 USART with baud 115200 8-N-1 settings */
    	BOOT_USART_MODULE->USART.CTRLA.reg = SERCOM_USART_CTRLA_RXPO(3) | SERCOM_USART_CTRLA_TXPO | SERCOM_USART_CTRLA_MODE(1) | SERCOM_USART_CTRLA_DORD;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLB.reg = SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_CHSIZE(0);
    	BOOT_USART_MODULE->USART.BAUD.reg = 50436;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLA.bit.ENABLE = 1;
    	
    	//Initialize flag
    	b_sharp_received = false;
    	idx_rx_read = 0;
    	idx_rx_write = 0;
    	idx_tx_read = 0;
    	idx_tx_write = 0;
    
    	error_timeout = 0;
    }
    La ça ne fonctionne plus !

  2. #42
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Citation Envoyé par cracked Voir le message
    Dans un simple programme le sercom se déclare différemment que dans le bootloader, mais ce qui est sûr c'est que ça marchait avec PB_10 et PB_11 en RX & TX.
    Pourquoi c'est différent dans le programme ? Tu utilises un framework ou une API (genre ASF Atmel Software Framework de Atmel ?) pour le programme peut être ?

    Du coup on ne peut rien tirer comme conclusion puisque dans le bootloader on est carrément sur du "bare metal", je veux dire on attaque les registres directement en lisant la datasheet du composant.

    Il y a beaucoup de fichiers avec le bootloader ? Tu peux poster les fichiers ci dessous ainsi que les fichiers .c associés (si il y en a) et le main.c/h
    "conf_bootloader.h"
    "sam_ba_monitor.h"
    "usart_sam_ba.h"

    Pas besoin des fichiers standards stdio etc...
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  3. #43
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Pourquoi c'est différent dans le programme ? Tu utilises un framework ou une API (genre ASF Atmel Software Framework de Atmel ?) pour le programme peut être ?
    Effectivement j'utilise Atmel Studio 7 que ça soit pour le bootloader ou pour un programme. Sauf que pour un programme il y a effectivement des libs venant de ASF intégré.

    Il y a pas mal de choses dans les fichiers sources du bootloader, je te mets uniquement les fichiers .c/.h, ce sont les fichiers originaux (non modifié).

    conf_bootloader.h
    main.c
    sam_ba_monitor.c
    sam_ba_monitor.h
    usart_sam_ba.c
    usart_sam_ba.h

    Merci !

  4. #44
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Je n'ai pas touché aux commentaires, juste au code.

    conf_bootloader.h (modification d'un #define comme tu l'avais fait)
    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
    56
    57
    /**
     * \file
     *
     * \brief Bootloader specific configuration.
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * \page License
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    #ifndef CONF_BOOTLOADER_H_INCLUDED
    #define CONF_BOOTLOADER_H_INCLUDED  
     
    #define APP_START_ADDRESS          0x00000800
    #define BOOT_LED                   PIN_PA14
    #define BOOT_LOAD_PIN              PIN_PA15
    #define GPIO_BOOT_PIN_MASK         (1U << (BOOT_LOAD_PIN & 0x1F))
     
    #define BOOT_USART_MODULE          SERCOM4
     
    #define CPU_CLOCK_FREQ             8000000UL
     
    #define APP_START_PAGE             (APP_START_ADDRESS / FLASH_PAGE_SIZE)
     
    /* DEBUG LED output enable/disable */
    #define DEBUG_ENABLE               false
     
    #endif /* CONF_BOOTLOADER_H_INCLUDED */

    main.c (ajout de l'envoi d'un message par SERCOM4)
    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
    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
    /**
     * \file
     *
     * \brief SAM D20 SAM-BA Bootloader
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    /**
     * --------------------
     * SAM-BA Implementation on SAMD20
     * --------------------
     * Requirements to use SAM-BA :
     *
     * Supported communication interfaces :
     * --------------------
     *
     * SERCOM3 : TX:PA24 RX:PA25
     * Baudrate : 115200 8N1
     *
     * Pins Usage
     * --------------------
     * The following pins are used by the program :
     * PA25 : input
     * PA24 : output
     * PA15 : input
     *
     * The application board shall avoid driving the PA25,PA24 and PA15 signals
     * while the boot program is running (after a POR for example)
     *
     * Memory Mapping
     * --------------------
     * SAM-BA code will be located at 0x0 and executed before any applicative code.
     *
     * Applications compiled to be executed along with the bootloader will start at
     * 0x800
     * Before jumping to the application, the bootloader changes the VTOR register
     * to use the interrupt vectors of the application @0x800.<- not required as
     * application code is taking care of this
     *
    */
     
    #include "samd20.h"
     
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include "conf_bootloader.h"
    #include "sam_ba_monitor.h"
    #include "usart_sam_ba.h"
     
    static void check_start_application(void);
     
    /**
     * \brief Check the application startup condition
     *
     */
    static void check_start_application(void)
    {
    	uint32_t app_start_address;
     
    	/* Load the Reset Handler address of the application */
    	app_start_address = *(uint32_t *)(APP_START_ADDRESS + 4);
     
    	/**
             * Test reset vector of application @APP_START_ADDRESS+4
             * Stay in SAM-BA if *(APP_START+0x4) == 0xFFFFFFFF
             * Application erased condition
             */
    	if (app_start_address == 0xFFFFFFFF) {
    		/* Stay in bootloader */
    		return;
    	}
     
    	volatile PortGroup *boot_port = (volatile PortGroup *)(&(PORT->Group[BOOT_LOAD_PIN / 32]));
    	volatile bool boot_en;
     
    	/* Enable the input mode in Boot GPIO Pin */
    	boot_port->DIRCLR.reg = GPIO_BOOT_PIN_MASK;
    	boot_port->PINCFG[BOOT_LOAD_PIN & 0x1F].reg = PORT_PINCFG_INEN | PORT_PINCFG_PULLEN;
    	boot_port->OUTSET.reg = GPIO_BOOT_PIN_MASK;
    	/* Read the BOOT_LOAD_PIN status */
    	boot_en = (boot_port->IN.reg) & GPIO_BOOT_PIN_MASK;
     
    	/* Check the bootloader enable condition */
    	if (!boot_en) {
    		/* Stay in bootloader */
    		return;
    	}
     
    	/* Rebase the Stack Pointer */
    	__set_MSP(*(uint32_t *) APP_START_ADDRESS);
     
    	/* Rebase the vector table base address */
    	SCB->VTOR = ((uint32_t) APP_START_ADDRESS & SCB_VTOR_TBLOFF_Msk);
     
    	/* Jump to application Reset Handler in the application */
    	asm("bx %0"::"r"(app_start_address));
    }
     
     
    #if DEBUG_ENABLE
    #	define DEBUG_PIN_HIGH 	PORT->Group[0].OUTSET.reg=(1u<<BOOT_LED)
    #	define DEBUG_PIN_LOW 	PORT->Group[0].OUTCLR.reg=(1u<<BOOT_LED)
    #else
    #	define DEBUG_PIN_HIGH 	do{}while(0)
    #	define DEBUG_PIN_LOW 	do{}while(0)
    #endif
     
     
    /**
     *  \brief SAMD20 SAM-BA Main loop.
     *  \return Unused (ANSI-C compatibility).
     */
    int main(void)
    {
     
    #if DEBUG_ENABLE
            /* Set BOOT_LED pin as output */
            PORT->Group[0].DIRSET.reg=(1u<<BOOT_LED);
    #endif
    	DEBUG_PIN_HIGH;
     
    	/* validation SERCOM4 */
    	usart_putdata("Bootloader SERCOM4 start", 24);
    	usart_putdata("\n\r", 2);
     
    	/* Jump in application if condition is satisfied */
    	check_start_application();
     
            /* Make OSC8M prescalar to zero rather divide by 8 */
            SYSCTRL->OSC8M.bit.PRESC = 0;
     
    	/* UART is enabled in all cases */
    	usart_open();
     
    	DEBUG_PIN_LOW;
    	/* Wait for a complete enum on usb or a '#' char on serial line */
    	while (1) {
    		/* Check if a '#' has been received */
    		if (usart_sharp_received()) {
    			sam_ba_monitor_init(SAM_BA_INTERFACE_USART);
    			/* SAM-BA on UART loop */
    			while(1) {
    				sam_ba_monitor_run();
    			}
    		}
    	}
    }

    sam_ba_monitor.c (RAS)
    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
    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
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    /**
     * \file
     *
     * \brief Monitor functions for SAM-BA on SAM D20
     * Port of rom monitor functions from legacy sam-ba software
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * \page License
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    #include <string.h>
    #include <intrinsics.h>
    #include "samd20.h"
    #include "sam_ba_monitor.h"
    #include "usart_sam_ba.h"
     
    #define min(a, b)           (((a) < (b)) ?  (a) : (b))
     
    const char RomBOOT_Version[] = SAM_BA_VERSION;
     
    /* Provides one common interface to handle both USART and USB-CDC */
    typedef struct
    {
    	/* send one byte of data */
    	int (*putc)(uint8_t value);
    	/* Get one byte */
    	uint8_t (*getc)(void);
    	/* Receive buffer not empty */
    	bool (*is_rx_ready)(void);
    	/* Send given data (polling) */
    	uint32_t (*putdata)(void const* data, uint32_t length);
    	/* Get data from comm. device */
    	uint32_t (*getdata)(void* data, uint32_t length);
    	/* Send given data (polling) using xmodem (if necessary) */
    	uint32_t (*putdata_xmd)(void const* data, uint32_t length);
    	/* Get data from comm. device using xmodem (if necessary) */
    	uint32_t (*getdata_xmd)(void* data, uint32_t length);
    } t_monitor_if;
     
    /* Initialize structures with function pointers from supported interfaces */
    const t_monitor_if uart_if =
    { usart_putc, usart_getc, usart_is_rx_ready, usart_putdata, usart_getdata,
    		usart_putdata_xmd, usart_getdata_xmd };
     
    /* The pointer to the interface object use by the monitor */
    t_monitor_if * ptr_monitor_if;
     
    /* b_terminal_mode mode (ascii) or hex mode */
    volatile bool b_terminal_mode = false;
     
     
    /**
     * \brief This function initializes the SAM-BA monitor
     *
     * \param com_interface  Communication interface to be used.
     */
    void sam_ba_monitor_init(uint8_t com_interface)
    {
    	/* Selects the requested interface for future actions */
    	if (com_interface == SAM_BA_INTERFACE_USART)
    		ptr_monitor_if = (t_monitor_if*) &uart_if;
    }
     
     
    /**
     * \brief This function allows data rx by USART
     *
     * \param *data  Data pointer
     * \param length Length of the data
     */
    void sam_ba_putdata_term(uint8_t* data, uint32_t length)
    {
    	uint8_t temp, buf[12], *data_ascii;
    	uint32_t i, int_value;
     
    	if (b_terminal_mode)
    	{
    		if (length == 4)
    			int_value = *(uint32_t *) data;
    		else if (length == 2)
    			int_value = *(uint16_t *) data;
    		else
    			int_value = *(uint8_t *) data;
     
    		data_ascii = buf + 2;
    		data_ascii += length * 2 - 1;
     
    		for (i = 0; i < length * 2; i++)
    		{
    			temp = (uint8_t) (int_value & 0xf);
     
    			if (temp <= 0x9)
    				*data_ascii = temp | 0x30;
    			else
    				*data_ascii = temp + 0x37;
     
    			int_value >>= 4;
    			data_ascii--;
    		}
    		buf[0] = '0';
    		buf[1] = 'x';
    		buf[length * 2 + 2] = '\n';
    		buf[length * 2 + 3] = '\r';
    		ptr_monitor_if->putdata(buf, length * 2 + 4);
    	}
    	else
    		ptr_monitor_if->putdata(data, length);
    	return;
    }
     
     
    /**
     * \brief Execute an applet from the specified address
     *
     * \param address Applet address
     */
    // void call_applet(uint32_t address)
    // {
    	// uint32_t *ptr_reset_vector;
    	// uint32_t app_start_add;
    	// /* Get the pointer to reset handler from application exception table */
    	// ptr_reset_vector = (uint32_t *)(address + 4);
    	// /* Get the application reset handler address */
    	// app_start_add = (*ptr_reset_vector);
    	// /* Disable global interrupts */
    	// cpu_irq_disable();
    	// /* Jump to the application */
    	// asm("bx %0"::"r"(app_start_add));
    // }
    void call_applet(uint32_t address)
    {
    	uint32_t app_start_address;
     
    	/* Rebase the Stack Pointer */
    	__set_MSP(*(uint32_t *) address);
     
    	/* Rebase the vector table base address */
    	SCB->VTOR = ((uint32_t) address & SCB_VTOR_TBLOFF_Msk);
     
    	/* Load the Reset Handler address of the application */
    	app_start_address = *(uint32_t *)(address + 4);
     
    	/* Jump to application Reset Handler in the application */
    	asm("bx %0"::"r"(app_start_address));
    }
     
     
    uint32_t current_number;
    uint32_t i, length;
    uint8_t command, *ptr_data, *ptr, data[SIZEBUFMAX];
    uint8_t j;
    uint32_t u32tmp;
     
     
    /**
     * \brief This function starts the SAM-BA monitor.
     */
    void sam_ba_monitor_run(void)
    {
    	ptr_data = NULL;
    	command = 'z';
     
    	// Start waiting some cmd
    	while (1)
    	{
    		length = ptr_monitor_if->getdata(data, SIZEBUFMAX);
    		ptr = data;
    		for (i = 0; i < length; i++)
    		{
    			if (*ptr != 0xff)
    			{
    				if (*ptr == '#')
    				{
    					if (b_terminal_mode)
    					{
    						ptr_monitor_if->putdata("\n\r", 2);
    					}
    					if (command == 'S')
    					{
    						//Check if some data are remaining in the "data" buffer
    						if(length>i)
    						{
    							//Move current indexes to next avail data (currently ptr points to "#")
    							ptr++;
    							i++;
    							//We need to add first the remaining data of the current buffer already read from usb
    							//read a maximum of "current_number" bytes
    							u32tmp=min((length-i),current_number);
    							for(j=0;j<u32tmp;j++)
    							{
    								*ptr_data = *ptr; 
    								ptr_data++;
    								ptr++;
    								i++;
    							}
    						}
    						//update i with the data read from the buffer
    						i--;
    						ptr--;
    						//Do we expect more data ?
    						if(j<current_number)
    							ptr_monitor_if->getdata_xmd(ptr_data, current_number-j);
     
    						__asm("nop");
    					}
    					else if (command == 'R')
    					{
    						ptr_monitor_if->putdata_xmd(ptr_data, current_number);
    					}
    					else if (command == 'O')
    					{
    						*ptr_data = (char) current_number;
    					}
    					else if (command == 'H')
    					{
    						*((uint16_t *) ptr_data) = (uint16_t) current_number;
    					}
    					else if (command == 'W')
    					{
    						*((int *) ptr_data) = current_number;
    					}
    					else if (command == 'o')
    					{
    						sam_ba_putdata_term(ptr_data, 1);
    					}
    					else if (command == 'h')
    					{
    						current_number = *((uint16_t *) ptr_data);
    						sam_ba_putdata_term((uint8_t*) &current_number, 2);
    					}
    					else if (command == 'w')
    					{
    						current_number = *((uint32_t *) ptr_data);
    						sam_ba_putdata_term((uint8_t*) &current_number, 4);
    					}
    					else if (command == 'G')
    					{
    						call_applet(current_number);
                                                    ptr_monitor_if->putc(0x6);
    					}
    					else if (command == 'T')
    					{
    						b_terminal_mode = 1;
    						ptr_monitor_if->putdata("\n\r", 2);
    					}
    					else if (command == 'N')
    					{
    						if (b_terminal_mode == 0)
    						{
    							ptr_monitor_if->putdata("\n\r", 2);
    						}
    						b_terminal_mode = 0;
    					}
    					else if (command == 'V')
    					{
    						ptr_monitor_if->putdata("v", 1);
    						ptr_monitor_if->putdata((uint8_t *) RomBOOT_Version,
    								strlen(RomBOOT_Version));
    						ptr_monitor_if->putdata(" ", 1);
    						ptr = (uint8_t*) &(__DATE__);
    						i = 0;
    						while (*ptr++ != '\0')
    							i++;
    						ptr_monitor_if->putdata((uint8_t *) &(__DATE__), i);
    						ptr_monitor_if->putdata(" ", 1);
    						i = 0;
    						ptr = (uint8_t*) &(__TIME__);
    						while (*ptr++ != '\0')
    							i++;
    						ptr_monitor_if->putdata((uint8_t *) &(__TIME__), i);
    						ptr_monitor_if->putdata("\n\r", 2);
    					}
     
    					command = 'z';
    					current_number = 0;
     
    					if (b_terminal_mode)
    					{
    						ptr_monitor_if->putdata(">", 1);
    					}
    				}
    				else
    				{
    					if (('0' <= *ptr) && (*ptr <= '9'))
    					{
    						current_number = (current_number << 4) | (*ptr - '0');
     
    					}
    					else if (('A' <= *ptr) && (*ptr <= 'F'))
    					{
    						current_number = (current_number << 4)
    								| (*ptr - 'A' + 0xa);
     
    					}
    					else if (('a' <= *ptr) && (*ptr <= 'f'))
    					{
    						current_number = (current_number << 4)
    								| (*ptr - 'a' + 0xa);
     
    					}
    					else if (*ptr == ',')
    					{
    						ptr_data = (uint8_t *) current_number;
    						current_number = 0;
     
    					}
    					else
    					{
    						command = *ptr;
    						current_number = 0;
    					}
    				}
    				ptr++;
    			}
    		}
    	}
    }

    sam_ba_monitor.h (RAS)
    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    /**
     * \file
     *
     * \brief Monitor functions for SAM-BA on SAM D20
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * \page License
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    #ifndef _MONITOR_SAM_BA_H_
    #define _MONITOR_SAM_BA_H_
     
    #include <stdint.h>
     
    #define SAM_BA_VERSION              "1.1"
     
    /* Selects USART as the communication interface of the monitor */
    #define SAM_BA_INTERFACE_USART      1
    /* Selects USB as the communication interface of the monitor */
    #define SAM_BA_INTERFACE_USBCDC     0
     
    /* Selects USB as the communication interface of the monitor */
    #define SIZEBUFMAX                  64
     
    /**
     * \brief Initialize the monitor
     *
     */
    void sam_ba_monitor_init(uint8_t com_interface);
     
    /**
     * \brief Main function of the SAM-BA Monitor
     *
     */
    void sam_ba_monitor_run(void);
     
    /**
     * \brief
     *
     */
    void sam_ba_putdata_term(uint8_t* data, uint32_t length);
     
    /**
     * \brief
     *
     */
    void call_applet(uint32_t address);
     
    #endif // _MONITOR_SAM_BA_H_

    usart_sam_ba.c (modification de usart_open comme tu l'avais fait)
    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
    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
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    /**
     * \file
     *
     * \brief USART functions for SAM-BA on SAM D20
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * \page License
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    #include "samd20.h"
    #include "usart_sam_ba.h"
    #include "conf_bootloader.h"
     
    /* Variable to let the main task select the appropriate communication interface */
    volatile uint8_t b_sharp_received;
     
    /* RX and TX Buffers + rw pointers for each buffer */
    volatile uint8_t buffer_rx_usart[USART_BUFFER_SIZE];
     
    volatile uint8_t idx_rx_read;
    volatile uint8_t idx_rx_write;
     
    volatile uint8_t buffer_tx_usart[USART_BUFFER_SIZE];
     
    volatile uint8_t idx_tx_read;
    volatile uint8_t idx_tx_write;
     
    /* Test for timeout in AT91F_GetChar */
    uint8_t error_timeout;
    uint16_t size_of_data;
    uint8_t mode_of_transfer;
     
    void uart_disable(Sercom *sercom)
    {
            while(sercom->USART.STATUS.bit.SYNCBUSY);
    	sercom->USART.CTRLA.bit.ENABLE = 0;
    }
     
    void uart_write_byte(Sercom *sercom, uint8_t data)
    {
    	while(!sercom->USART.INTFLAG.bit.DRE);
    	sercom->USART.DATA.reg = (uint16_t)data;
    }
     
    uint8_t uart_read_byte(Sercom *sercom)
    {
    	while(!sercom->USART.INTFLAG.bit.RXC);
    	return((uint8_t)(sercom->USART.DATA.reg & 0x00FF));
    }
     
    /**
     * \brief Open the given USART
     */
    void usart_open()
    {
        PORT->Group[0].PINCFG[10].bit.PMUXEN = 1;           /* PB10 redirigé vers une alternate function (vers un périphérique) */
        PORT->Group[0].PINCFG[11].bit.PMUXEN = 1;           /* PB11 redirigé vers une alternate function (vers un périphérique)*/
        PORT->Group[0].PMUX[5].reg = 0x33;                  /* PB10 = alternate function D (SERCOM4) et PB11 = Alternate function D (SERCOM4) */
     
        /* Enable APB clock for SERCOM4 */
        PM->APBCMASK.reg |= (1u << 6);          
     
        /* Configure GCLK generator 0 as clock source for SERCOM4 */
        GCLK->CLKCTRL.reg = 0x4011;
     
        /* Configure SERCOM4 USART with baud 115200 8-N-1 settings */
            BOOT_USART_MODULE->USART.CTRLA.reg = SERCOM_USART_CTRLA_RXPO(3) | SERCOM_USART_CTRLA_TXPO | SERCOM_USART_CTRLA_MODE(1) | SERCOM_USART_CTRLA_DORD;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLB.reg = SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_CHSIZE(0);
    	BOOT_USART_MODULE->USART.BAUD.reg = 50436;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLA.bit.ENABLE = 1;
     
    	//Initialize flag
    	b_sharp_received = false;
    	idx_rx_read = 0;
    	idx_rx_write = 0;
    	idx_tx_read = 0;
    	idx_tx_write = 0;
     
    	error_timeout = 0;
    }
     
    /**
     * \brief Configures communication line
     *
     */
    void usart_close(void)
    {
    	uart_disable(BOOT_USART_MODULE);
    }
     
    /**
     * \brief Puts a byte on usart line
     * The type int is used to support printf redirection from compiler LIB.
     *
     * \param value      Value to put
     *
     * \return \c 1 if function was successfully done, otherwise \c 0.
     */
    int usart_putc(uint8_t value)
    {
            uart_write_byte(BOOT_USART_MODULE, value);
    	return 1;
    }
     
     
     
    uint8_t usart_getc(void) {
    	uint8_t retval;
    	//Wait until input buffer is filled
            retval = uart_read_byte(BOOT_USART_MODULE);
    	return (retval);
    }
     
    int usart_sharp_received(void) {
    	if (usart_is_rx_ready()) {
    		if (usart_getc() == SHARP_CHARACTER)
    			return (true);
    	}
    	return (false);
    }
     
    bool usart_is_rx_ready(void) {
    	return (BOOT_USART_MODULE->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC);
    }
     
    int usart_readc(void) {
    	int retval;
    	retval = buffer_rx_usart[idx_rx_read];
    	idx_rx_read = (idx_rx_read + 1) & (USART_BUFFER_SIZE - 1);
    	return (retval);
    }
     
    //Send given data (polling)
    uint32_t usart_putdata(void const* data, uint32_t length) {
    	uint32_t i;
    	uint8_t* ptrdata;
    	ptrdata = (uint8_t*) data;
    	for (i = 0; i < length; i++) {
    		usart_putc(*ptrdata);
    		ptrdata++;
    	}
    	return (i);
    }
     
    //Get data from comm. device
    uint32_t usart_getdata(void* data, uint32_t length) {
    	uint8_t* ptrdata;
    	ptrdata = (uint8_t*) data;
    	*ptrdata = usart_getc();
    	return (1);
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    add_crc
    //* \brief Compute the CRC
    //*----------------------------------------------------------------------------
    unsigned short add_crc(char ptr, unsigned short crc) {
     
    	unsigned short cmpt;
     
    	crc = crc ^ (int) ptr << 8;
     
    	for (cmpt = 0; cmpt < 8; cmpt++) {
    		if (crc & 0x8000)
    			crc = crc << 1 ^ CRC16POLY;
    		else
    			crc = crc << 1;
    	}
     
    	return (crc & 0xFFFF);
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    getbytes
    //* \brief
    //*----------------------------------------------------------------------------
    static uint16_t getbytes(uint8_t *ptr_data, uint16_t length) {
    	uint16_t crc = 0;
    	uint16_t cpt;
    	uint8_t c;
     
    	for (cpt = 0; cpt < length; ++cpt) {
    		c = usart_getc();
    		if (error_timeout)
    			return 1;
    		crc = add_crc(c, crc);
    		//crc = (crc << 8) ^ xcrc16tab[(crc>>8) ^ c];
    		if (size_of_data || mode_of_transfer) {
    			*ptr_data++ = c;
    			if (length == PKTLEN_128)
    				size_of_data--;
    		}
    	}
     
    	return crc;
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    putPacket
    //* \brief Used by Xup to send packets.
    //*----------------------------------------------------------------------------
    static int putPacket(uint8_t *tmppkt, uint8_t sno) {
    	uint32_t i;
    	uint16_t chksm;
    	uint8_t data;
     
    	chksm = 0;
     
    	usart_putc(SOH);
     
    	usart_putc(sno);
    	usart_putc((uint8_t) ~(sno));
     
    	for (i = 0; i < PKTLEN_128; i++) {
    		if (size_of_data || mode_of_transfer) {
    			data = *tmppkt++;
    			size_of_data--;
    		} else
    			data = 0x00;
     
    		usart_putc(data);
     
    		//chksm = (chksm<<8) ^ xcrc16tab[(chksm>>8)^data];
    		chksm = add_crc(data, chksm);
    	}
     
    	/* An "endian independent way to extract the CRC bytes. */
    	usart_putc((uint8_t) (chksm >> 8));
    	usart_putc((uint8_t) chksm);
     
    	return (usart_getc()); /* Wait for ack */
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    getPacket
    //* \brief Used by Xdown to retrieve packets.
    //*----------------------------------------------------------------------------
    uint8_t getPacket(uint8_t *ptr_data, uint8_t sno) {
    	uint8_t seq[2];
    	uint16_t crc, xcrc;
     
    	getbytes(seq, 2);
    	xcrc = getbytes(ptr_data, PKTLEN_128);
    	if (error_timeout)
    		return (false);
     
    	/* An "endian independent way to combine the CRC bytes. */
    	crc = (uint16_t) usart_getc() << 8;
    	crc += (uint16_t) usart_getc();
     
    	if (error_timeout == 1)
    		return (false);
     
    	if ((crc != xcrc) || (seq[0] != sno) || (seq[1] != (uint8_t) (~sno))) {
    		usart_putc(CAN);
    		return (false);
    	}
     
    	usart_putc(ACK);
    	return (true);
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    Xup
    //* \brief Called when a transfer from target to host is being made (considered
    //*        an upload).
    //*----------------------------------------------------------------------------
    //static void Xup(char *ptr_data, uint16_t length)
    //Send given data (polling) using xmodem (if necessary)
    uint32_t usart_putdata_xmd(void const* data, uint32_t length) {
    	uint8_t c, sno = 1;
    	uint8_t done;
    	uint8_t * ptr_data = (uint8_t *) data;
    	error_timeout = 0;
    	if (!length)
    		mode_of_transfer = 1;
    	else {
    		size_of_data = length;
    		mode_of_transfer = 0;
    	}
     
    	if (length & (PKTLEN_128 - 1)) {
    		length += PKTLEN_128;
    		length &= ~(PKTLEN_128 - 1);
    	}
     
    	/* Startup synchronization... */
    	/* Wait to receive a NAK or 'C' from receiver. */
    	done = 0;
    	while (!done) {
    		c = (uint8_t) usart_getc();
    		if (error_timeout) { // Test for timeout in usart_getc
    			error_timeout = 0;
    			c = (uint8_t) usart_getc();
    			if (error_timeout) {
    				error_timeout = 0;
    				return (0);
    //                return -2;
    			}
    		}
    		switch (c) {
    		case NAK:
    			done = 1;
    			// ("CSM");
    			break;
    		case 'C':
    			done = 1;
    			// ("CRC");
    			break;
    		case 'q': /* ELS addition, not part of XMODEM spec. */
    			return (0);
    //           return(0);
    		default:
    			break;
    		}
    	}
     
    	done = 0;
    	sno = 1;
    	while (!done) {
    		c = (uint8_t) putPacket((uint8_t *) ptr_data, sno);
    		if (error_timeout) { // Test for timeout in usart_getc
    			error_timeout = 0;
    			return (0);
    //            return (-1);
    		}
    		switch (c) {
    		case ACK:
    			++sno;
    			length -= PKTLEN_128;
    			ptr_data += PKTLEN_128;
    			// ("A");
    			break;
    		case NAK:
    			// ("N");
    			break;
    		case CAN:
    		case EOT:
    		default:
    			done = 0;
    			break;
    		}
    		if (!length) {
    			usart_putc(EOT);
    			usart_getc(); /* Flush the ACK */
    			break;
    		}
    		// ("!");
    	}
     
    	mode_of_transfer = 0;
    	// ("Xup_done.");
    	return (1);
    	//    return(0);
    }
     
    //*----------------------------------------------------------------------------
    //* \fn    Xdown
    //* \brief Called when a transfer from host to target is being made (considered
    //*        an download).
    //*----------------------------------------------------------------------------
    //static void Xdown(char *ptr_data, uint16_t length)
    //Get data from comm. device using xmodem (if necessary)
    uint32_t usart_getdata_xmd(void* data, uint32_t length) {
    	uint32_t timeout;
    	char c;
    	uint8_t * ptr_data = (uint8_t *) data;
    	uint32_t b_run, nbr_of_timeout = 100;
    	uint8_t sno = 0x01;
    	uint32_t data_transfered = 0;
     
    	//Copied from legacy source code ... might need some tweaking
    	uint32_t loops_per_second = CPU_CLOCK_FREQ / 10;
     
    	error_timeout = 0;
     
    	if (length == 0)
    		mode_of_transfer = 1;
    	else {
    		size_of_data = length;
    		mode_of_transfer = 0;
    	}
     
    	/* Startup synchronization... */
    	/* Continuously send NAK or 'C' until sender responds. */
    	// ("Xdown");
    	while (1) {
    		usart_putc('C');
    		timeout = loops_per_second;
    		while (!(usart_is_rx_ready()) && timeout)
    			timeout--;
    		if (timeout)
    			break;
     
    		if (!(--nbr_of_timeout))
    			return (0);
    //            return -1;
    	}
     
    	b_run = true;
    	// ("Got response");
    	while (b_run != false) {
    		c = (char) usart_getc();
    		if (error_timeout) { // Test for timeout in usart_getc
    			error_timeout = 0;
    			return (0);
    //            return (-1);
    		}
    		switch (c) {
    		case SOH: /* 128-byte incoming packet */
    			// ("O");
    			b_run = getPacket(ptr_data, sno);
    			if (error_timeout) { // Test for timeout in usart_getc
    				error_timeout = 0;
    				return (0);
    //                return (-1);
    			}
    			if (b_run == true) {
    				++sno;
    				ptr_data += PKTLEN_128;
    				data_transfered += PKTLEN_128;
    			}
    			break;
    		case EOT: // ("E");
    			usart_putc(ACK);
    			b_run = false;
    			break;
    		case CAN: // ("C");
    		case ESC: /* "X" User-invoked abort */
    		default:
    			b_run = false;
    			break;
    		}
    		// ("!");
    	}
    	mode_of_transfer = 0;
    	return (true);
    //    return(b_run);
    }

    usart_sam_ba.h (RAS)
    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
    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
    /**
     * \file
     *
     * \brief USART functions for SAM-BA on SAM D20
     *
     * Copyright (c) 2014 Atmel Corporation. All rights reserved.
     *
     * \page License
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions are met:
     *
     * 1. Redistributions of source code must retain the above copyright notice,
     *    this list of conditions and the following disclaimer.
     *
     * 2. Redistributions in binary form must reproduce the above copyright notice,
     *    this list of conditions and the following disclaimer in the documentation
     *    and/or other materials provided with the distribution.
     *
     * 3. The name of Atmel may not be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * 4. This software may only be redistributed and used in connection with an
     *    Atmel microcontroller product.
     *
     * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
     * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
     * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     * POSSIBILITY OF SUCH DAMAGE.
     *
     */
     
    #ifndef _USART_SAM_BA_H_
    #define _USART_SAM_BA_H_
     
    #include <stdint.h>
    #include <stdbool.h>
     
    /* USART buffer size (must be a power of two) */
    #define USART_BUFFER_SIZE        128
     
    /* Define the default time-out value for USART. */
    #define USART_DEFAULT_TIMEOUT    1000
     
    /* Xmodem related defines */
    /* CRC16  polynomial */
    #define CRC16POLY                0x1021
     
    #define SHARP_CHARACTER          '#'
     
    /* X/Ymodem protocol: */
    #define SOH                      0x01
    //#define STX                    0x02
    #define EOT                      0x04
    #define ACK                      0x06
    #define NAK                      0x15
    #define CAN                      0x18
    #define ESC                      0x1b
     
    #define PKTLEN_128               128
    //#define PKTLEN_1K   1024
     
     
    /**
     * \brief Open the given USART
     */
    void usart_open(void);
     
    /**
     * \brief Stops the USART
     */
    void usart_close(void);
     
    /**
     * \brief Puts a byte on usart line
     *
     * \param value      Value to put
     *
     * \return \c 1 if function was successfully done, otherwise \c 0.
     */
    int usart_putc(uint8_t value);
     
    /**
     * \brief Waits and gets a value on usart line
     *
     * \return value read on usart line
     */
    uint8_t usart_getc(void);
     
    /**
     * \brief Returns true if the SAM-BA Uart received the sharp char
     *
     * \return Returns true if the SAM-BA Uart received the sharp char
     */
    int usart_sharp_received(void);
     
    /**
     * \brief This function checks if a character has been received on the usart line
     *
     * \return \c 1 if a byte is ready to be read.
     */
    bool usart_is_rx_ready(void);
     
    /**
     * \brief Gets a value on usart line
     *
     * \return value read on usart line
     */
    int usart_readc(void);
     
    /**
     * \brief Send buffer on usart line
     *
     * \param data pointer
     * \param number of data to send
     * \return number of data sent
     */
    uint32_t usart_putdata(void const* data, uint32_t length); //Send given data (polling)
     
    /**
     * \brief Gets data from usart line
     *
     * \param data pointer
     * \param number of data to get
     * \return value read on usart line
     */
    uint32_t usart_getdata(void* data, uint32_t length); //Get data from comm. device
     
    /**
     * \brief Send buffer on usart line using Xmodem protocol
     *
     * \param data pointer
     * \param number of data to send
     * \return number of data sent
     */
    uint32_t usart_putdata_xmd(void const* data, uint32_t length); //Send given data (polling) using xmodem (if necessary)
     
    /**
     * \brief Gets data from usart line using Xmodem protocol
     *
     * \param data pointer
     * \param number of data to get
     * \return value read on usart line
     */
    uint32_t usart_getdata_xmd(void* data, uint32_t length); //Get data from comm. device using xmodem (if necessary)
     
    /**
     * \brief Gets data from usart line using Xmodem protocol
     *
     * \param data pointer
     * \param number of data to get
     * \return value read on usart line
     */
    unsigned short add_crc(char ptr, unsigned short crc);
     
    uint8_t getPacket(uint8_t *pData, uint8_t sno);
     
    #endif // _USART_SAM_BA_H_

    Je voudrai que :
    - tu compiles le bootloader avec Atmel Studio, sans aucun décalage de mémoire et que tu programmes le bootloader dans la carte.
    - que tu connectes putty sur PB10 et PB11 avec le réglage 115200 8bits - No parity -1 bit de stop
    - tu redémarres la carte en maintenant PA15 à l'état bas

    Et tu me dis si putty racontes quelque chose. Dans ce test pas besoin du logiciel SAM-BA, je veux juste voir si le bootloader sait causer via SERCOM4
    A+
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  5. #45
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Putty reste de marbre, le bootloader ne saurais pas communiquer sur SERCOM4 ?
    Pourtant je pense que le support de Microchip me l’aura signalé !

    Voici la dernière info que j'ai d'eux :

    I recommend that you debug the usart first, in the Atmel Studio, you can find the quick start for the SAMD20 Sercom usart driver, you can modify the code, and run on your board, please connect the PC with the baudrate 115200, to make sure it work well, then you can refer the SAM0 SAM-BA bootloader example –SAMD21, to write the SAMD20 bootloader code.
    Je pense qu'il fait référence à ceci : Datasheet SAMD21 bootloader

    - tu compiles le bootloader avec Atmel Studio, sans aucun décalage de mémoire et que tu programmes le bootloader dans la carte.
    - que tu connectes putty sur PB10 et PB11 avec le réglage 115200 8bits - No parity -1 bit de stop
    - tu redémarres la carte en maintenant PA15 à l'état bas
    J'ai copier-coller les fichiers que tu m'as donnés, j'y ai juste ajouter un petit allumage de LED.
    J'ai vérifié les paramètres de mon port USB et de Putty. Nom : Sans titre.png
Affichages : 491
Taille : 93,0 Ko
    La pin PA_15 est en permanence connecté à la masse (donc LOW). As-tu une manipulation pour redémarrer la carte ? La débrancher rebrancher est suffisant ! non ?

    Je vois dans le main() que tu envoi des données
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    	usart_putdata("Bootloader SERCOM4 start", 24);
    	usart_putdata("\n\r", 2); 
    
    	/* Jump in application if condition is satisfied */
    	check_start_application();
     
            /* Make OSC8M prescalar to zero rather divide by 8 */
            SYSCTRL->OSC8M.bit.PRESC = 0;
     
    	/* UART is enabled in all cases */
    	usart_open();
    avant la configuration de l'usart SERCOM4 (usart_open).

    C'est voulu ?

    Merci !

  6. #46
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Oups !
    Je me suis trompé.

    Les deux lignes qui envoient des données, dans le main.c doivent en effet être après usart_open(); sinon ça ne peut pas fonctionner.

    Tu peux refaire un essai en mettant les deux lignes (les deux surtout) au bon endroit et me dire si ça marche ?


    Pour le redémarrage, soit tu as bouton RESET soit tu redémarre comme tu le fais à ce jour. Ce pas bien grave sur un microcontroleur.
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  7. #47
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Oups !
    Je me suis trompé.
    Dans le doute j'avais déjà essayé, pas mieux ...

    Pour la configuration du baudrate, je configure le port USB en 115200 et je met putty en 115200, ou je laisse le port USB en 9600 et putty en 115200 ?

  8. #48
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Citation Envoyé par cracked Voir le message
    Dans le doute j'avais déjà essayé, pas mieux ...
    C'est fou ça !!!! Je ne vois absolument pas pourquoi ça ne fonctionnerait pas avec SERCOM4 !!!

    Et si tu laisses les deux lignes qui envoient les données (en les mettant au bon endroit) et que tu remets tout le reste comme avant donc sur SERCOM3, là ça marche bien ? Je veux dire, putty reçoit le message ?


    Citation Envoyé par cracked Voir le message
    Pour la configuration du baudrate, je configure le port USB en 115200 et je met putty en 115200, ou je laisse le port USB en 9600 et putty en 115200 ?
    J'imagine qu'il faut tout régler de la même façon, sur 115200.
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  9. #49
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Je viens de voir dans le code, dans le fichier "sercom.h"

    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
    #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
    typedef struct { /* USART Mode */
      __IO SERCOM_USART_CTRLA_Type   CTRLA;       /**< \brief Offset: 0x00 (R/W 32) USART Control A */
      __IO SERCOM_USART_CTRLB_Type   CTRLB;       /**< \brief Offset: 0x04 (R/W 32) USART Control B */
      __IO SERCOM_USART_DBGCTRL_Type DBGCTRL;     /**< \brief Offset: 0x08 (R/W  8) USART Debug Control */
           RoReg8                    Reserved1[0x1];
      __IO SERCOM_USART_BAUD_Type    BAUD;        /**< \brief Offset: 0x0A (R/W 16) USART Baud */
      __IO SERCOM_USART_INTENCLR_Type INTENCLR;    /**< \brief Offset: 0x0C (R/W  8) USART Interrupt Enable Clear */
      __IO SERCOM_USART_INTENSET_Type INTENSET;    /**< \brief Offset: 0x0D (R/W  8) USART Interrupt Enable Set */
      __IO SERCOM_USART_INTFLAG_Type INTFLAG;     /**< \brief Offset: 0x0E (R/W  8) USART Interrupt Flag Status and Clear */
           RoReg8                    Reserved2[0x1];
      __IO SERCOM_USART_STATUS_Type  STATUS;      /**< \brief Offset: 0x10 (R/W 16) USART Status */
           RoReg8                    Reserved3[0x6];
      __IO SERCOM_USART_DATA_Type    DATA;        /**< \brief Offset: 0x18 (R/W 16) USART Data */
    } SercomUsart;
    #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
    Les lignes qui me font percuter sont :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
      __IO SERCOM_USART_CTRLA_Type   CTRLA;       /**< \brief Offset: 0x00 (R/W 32) USART Control A */
      __IO SERCOM_USART_CTRLB_Type   CTRLB;       /**< \brief Offset: 0x04 (R/W 32) USART Control B */
    Dans le fichier "usart_sam_ba.c", dans la fonction usar_open :

    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
    void usart_open()
    {
        PORT->Group[0].PINCFG[10].bit.PMUXEN = 1;           /* PB10 redirigé vers une alternate function (vers un périphérique) */
        PORT->Group[0].PINCFG[11].bit.PMUXEN = 1;           /* PB11 redirigé vers une alternate function (vers un périphérique)*/
        PORT->Group[0].PMUX[5].reg = 0x22;                  /* PB10 = alternate function D (SERCOM4) et PB11 = Alternate function D (SERCOM4) */
     
        /* Enable APB clock for SERCOM4 */
        PM->APBCMASK.reg |= (1u << 6);
     
        /* Configure GCLK generator 0 as clock source for SERCOM4 */
        GCLK->CLKCTRL.reg = 0x4011;
     
        /* Configure SERCOM4 USART with baud 115200 8-N-1 settings */
            BOOT_USART_MODULE->USART.CTRLA.reg = SERCOM_USART_CTRLA_RXPO(3) | SERCOM_USART_CTRLA_TXPO | SERCOM_USART_CTRLA_MODE(1) | SERCOM_USART_CTRLA_DORD;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLB.reg = SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_CHSIZE(0);
    	BOOT_USART_MODULE->USART.BAUD.reg = 50436;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLA.bit.ENABLE = 1;
     
    	//Initialize flag
    	b_sharp_received = false;
    	idx_rx_read = 0;
    	idx_rx_write = 0;
    	idx_tx_read = 0;
    	idx_tx_write = 0;
     
    	error_timeout = 0;
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
        PORT->Group[0].PMUX[5].reg = 0x22;                  /* PB10 = alternate function D (SERCOM4) et PB11 = Alternate function D (SERCOM4) */
    Le fait d'avoir mis le mode en "alternante function D", caractéristique du SERCOM4, cela ne risque pas d'être en confrontation avec le "USART Control A/B" ?
    Je pense faire un amalgame, mais je cherche la petite bête

  10. #50
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Salut,
    C'est tentant mais malheureusement les registres CTRLA et B servent à tout autre chose. Ils servent a écrire un nouveau programme grosso modo.

    Dans la datasheet, §21 NVMCTRL – Non-Volatile Memory Controller page 297 (voir overview pour comprendre globalement ce que ça fait) et page 308 (la liste des registres dont CTRLA et B)


    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
       PORT->Group[0].PMUX[5].reg = 0x22;                  /* PB10 = alternate function D (SERCOM4) et PB11 = Alternate function D (SERCOM4) */
    C'est bizarre que le commentaire (après modification) ne colle pas avec la valeur 0x22 (avant modification) ?




    J'ai bien reçu ton message privé.
    Il est possible que le micro est pris un coup dans le nez puisque Atmel Studio ne le reconnait plus (il ne devrait donc plus être possible de le programmer) mais ça reste quand même rare. En plus de 12 ans d'électronique, ça ne m'est arrivé qu'une seule fois.

    Ce qui peut faire dégager un micro :
    • Une ESD (décharge électrostatique) qui se produit, lorsque ton doigts touche une partie métallique directement reliée au micro, comme une broche de connecteur etc...
    • Une mauvaise alimentation du micro lors du démarrage, par exemple légère surtension liée à une oscillation ou à snubber mal dimensionné et qu'on reproduit a chaque réalimentation.
    • Des inversions de broches, deux sorties reliées entres elles. D'ailleurs, il ne faudra plus inverser Rx et Tx pour tester la communication car il est possible que le hard ne sache pas gérer une tel cas de figure.

    Mais en aucun cas de multiples programmations.


    J'attends donc de tes nouvelles
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  11. #51
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    PORT->Group[0].PMUX[5].reg = 0x22;                  /* PB10 = alternate function D (SERCOM4) et PB11 = Alternate function D (SERCOM4) */
    C'est bizarre que le commentaire (après modification) ne colle pas avec la valeur 0x22 (avant modification) ?
    Ne t'en fais pas, c'est simplement que j'ai tester deux trois trucs. Il est bien en 0x33 pour SERCOM4.

    On a reçu les nouvelles puces et on a refait une board, mais depuis hier on est bloqué car atmel n'arrive pas à lire la "Device signature". On pensait que cela venait de la puce, mais là le problème est autre. Une idée ?
    Il s'agit de l'erreur 4109, le Atmel Ice détecte qu'il est connecté, atmel peux lire la "Target Voltage", mais pas le modèle de puce :/

    Une fois que cela marchera, je vais pouvoir tester le bootloader sur toutes les pins, donc très utile pour notre cas !

  12. #52
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Surtout assurez vous qu'il n'y a pas de problème de pilote du côté PC car c'est le principal problème des outils de débogages comme Atmel ICE ou les sondes chez Texas (je ne me rappelle plus du nom.) Chez Texas que je connais beaucoup mieux, ils donnent les drivers pour mettre à jour ton pilote car sans ça, ça ne fonctionne pas.

    Sinon, j'imagine que le brochage du connecteur ICE et ok et que dans Atmel Studio c'est le bon microcontrôleur qui est choisi ?
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  13. #53
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Niveau drivers normalement pas de soucis, quand je branche une board qui a le même micro sa marche très bien, seulement pour une board avec uniquement le micro dessus ça ne veut pas ...

    Sinon, j'imagine que le brochage du connecteur ICE et ok et que dans Atmel Studio c'est le bon microcontrôleur qui est choisi ?
    Tout est ok à ce niveau aussi. Je te donne du nouveau quand il y en a, merci.

  14. #54
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Ça marche, j'attends.
    De toute façon sans schéma et sans être devant la carte, je ne peux rien faire d'autre
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  15. #55
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Bon il y a du nouveau !
    Après avoir réussi à faire réagir Microchip j'ai eu quelques informations inintéressantes !
    Bien que la datasheet pour le bootloader par défauld nous dit que "si l'on utilise Atmel Studio, il suffit de créer un nouveau projet et d'importer tous les fichiers sources".
    Et bien c'est faux ! C'est un projet IAR et il ne peut donc pas être utiliser via Atmel sans modification !
    Un projet IAR va faire appel à des libs et define qui ne sont tout simplement pas dans Atmel (ce qui explique l'include que j'ai dû commenter).

    Ce qui fait que dans notre cas, la fonction Usart_open() n'est tout bonnement pas utilisable ! il faut créer une fonction configure_usart() ainsi que modifier le fichier "ASF/sam0/boards/samd20_xplained_pro/samd20_xplained_pro.h".

    Ce qui donne :

    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
    void configure_usart(void)
    {
    	//! [setup_config]
    	struct usart_config config_usart;
    	//! [setup_config]
    	//! [setup_config_defaults]
    	usart_get_config_defaults(&config_usart);
    	//! [setup_config_defaults]
    
    	//! [setup_change_config]
    	config_usart.baudrate = 115200;
    	config_usart.mux_setting = EDBG_CDC_SERCOM_MUX_SETTING;
    	config_usart.pinmux_pad0 = EDBG_CDC_SERCOM_PINMUX_PAD0;
    	config_usart.pinmux_pad1 = EDBG_CDC_SERCOM_PINMUX_PAD1;
    	config_usart.pinmux_pad2 = PINMUX_PB10D_SERCOM4_PAD2;
    	config_usart.pinmux_pad3 = PINMUX_PB11D_SERCOM4_PAD3;
    	//! [setup_change_config]
    
    	//! [setup_set_config]
    	while (usart_init(&usart_instance, EDBG_CDC_MODULE, &config_usart) != STATUS_OK);
    	//! [setup_set_config]
    
    	//! [setup_enable]
    	usart_enable(&usart_instance);
    	//! [setup_enable]
    }
    Et pour le fichier samd20_xplained_pro.h :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    /** \name Embedded debugger CDC Gateway USART interface definitions
     * @{
     */
    #define EDBG_CDC_MODULE              SERCOM4
    #define EDBG_CDC_SERCOM_MUX_SETTING  USART_RX_3_TX_2_XCK_3
    #define EDBG_CDC_SERCOM_PINMUX_PAD0  PINMUX_UNUSED
    #define EDBG_CDC_SERCOM_PINMUX_PAD1  PINMUX_UNUSED
    #define EDBG_CDC_SERCOM_PINMUX_PAD2  PINMUX_PA24C_SERCOM3_PAD2
    #define EDBG_CDC_SERCOM_PINMUX_PAD3  PINMUX_PA25C_SERCOM3_PAD3
    /** @} */
    Maintenant un autre problème se pose !
    Lorsque je lance sam-bav2.16 et que j'essaye de me connecter, sam-ba a deux réactions.

    La première : la connexion est bien faite (pas de message d'erreur, et la board allume sa LED quand la condition usart_sharp_received() est vrai) MAIS ! Aucune fenetre ne s'ouvre, et un processus "tclkit, a sandalone runtime for Tcl/Tk (32 bits)" est ouvert et tourne en arrière-plan. Et ça bouge plus.

    La deuxième : sam-ba me renvois le même message d'erreur ("Invalid Chip ID ... etc"), mais dans ce cas là, la LED de la board ne s'allume pas, donc cela doit venir d'un problème de communication sur le moment T.

    Voila ou j'en suis, ça bouge, pas de beaucoup mais dans le bon sens !

  16. #56
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Citation Envoyé par cracked Voir le message
    Et bien c'est faux ! C'est un projet IAR et il ne peut donc pas être utiliser via Atmel sans modification !
    Ah d'accord, on pouvait se casser le cul longtemps

    Je vois que tu as modifié ceci :
    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    void configure_usart(void)
    {
    	[...]
    	config_usart.pinmux_pad2 = PINMUX_PB10D_SERCOM4_PAD2;
    	config_usart.pinmux_pad3 = PINMUX_PB11D_SERCOM4_PAD3;
    	[...]
    }

    Mais es tu sur que EDBG_CDC_SERCOM_PINMUX_PAD2 ainsi que EDBG_CDC_SERCOM_PINMUX_PAD3 ne sont plus utilisés autre part ? Sinon ça remet PA24 et PA25 dans la boucle !
    Code C : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    /** \name Embedded debugger CDC Gateway USART interface definitions */
    [...]
    #define EDBG_CDC_SERCOM_PINMUX_PAD2  PINMUX_PA24C_SERCOM3_PAD2
    #define EDBG_CDC_SERCOM_PINMUX_PAD3  PINMUX_PA25C_SERCOM3_PAD3
    [...]
    /** @} */

    Et donc là les sources sont différents ? Je ne comprends pas bien cette histoire de faire une fonction configure_usart ? Les sources du bootloader sont différentes entre IAR et Atmel Studio ?
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  17. #57
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Mais es tu sur que EDBG_CDC_SERCOM_PINMUX_PAD2 ainsi que EDBG_CDC_SERCOM_PINMUX_PAD3 ne sont plus utilisés autre part ? Sinon ça remet PA24 et PA25 dans la boucle !
    Dans tous les cas ces pins ne sont pas sortis sur notre carte, donc c'est sûr qu'ils ne sont pas utilisés

    Et donc là les sources sont différents ? Je ne comprends pas bien cette histoire de faire une fonction configure_usart ? Les sources du bootloader sont différentes entre IAR et Atmel Studio ?
    Honnêtement ... moi non plus, en plus ces fonctions ne sont surement pas totalement fonctionnelles. Sam-Ba ne faisais pas totalement la connexion.
    Le support Microchip m'a envoyé un .hex fais pour mon cas et cela marche enfin normalement avec Sam-BA !
    Je lui ai demander les fichiers sources que je puisse le modifier et voir ça de plus près !

    Je posterai le code que tu puisses avoir le fin mot de l'histoire

  18. #58
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Citation Envoyé par cracked Voir le message
    Je posterai le code que tu puisses avoir le fin mot de l'histoire
    Ah oui ça je veux bien car je me demande encore ce qui n'allait pas ou ce qu'on a oublié lorsqu'on a épluché la datasheet pour configurer les registres du SERCOM4. Pour moi on a rien oublié sauf évidemment si il y avait d'autres fichiers qui mettaient le bazar derrière.
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

  19. #59
    Membre à l'essai
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Octobre 2017
    Messages
    46
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 28
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Octobre 2017
    Messages : 46
    Points : 11
    Points
    11
    Par défaut
    Bon, il y a des soucis de compréhension avec Microchip j'ai l'impression.
    J'ai reçu les fichiers sources et c'est bien la fonction usar_open() qui est utilisé. Cependant il ne faut pas utiliser Atmel Studio, mais IAR.
    Je pense qu'une partie du problème venais de là.

    L'autre partie du problème venais d'un détail ! On avait bon mais, c'est marrant pour de l'informatique, un 0 devais en fait être un 1. Un autre point, le bootloader va jusqu'en 0x900 et non 0x800. Pourquoi ? Je ne sais pas encore !

    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
    void usart_open()
    {
            /* Enable & configure alternate function C for pins PB10 & PB11 */
            PORT->Group[1].PINCFG[10].bit.PMUXEN = 1;
            PORT->Group[1].PINCFG[11].bit.PMUXEN = 1;
            PORT->Group[1].PMUX[5].reg = 0x33;
            /* Enable APB clock for SERCOM4 */
            PM->APBCMASK.reg |= (1u << 6);
            /* Configure GCLK generator 0 as clock source for SERCOM4 */
            GCLK->CLKCTRL.reg = 0x4011;
            /* Configure SERCOM3 USART with baud 115200 8-N-1 settings */
            BOOT_USART_MODULE->USART.CTRLA.reg = SERCOM_USART_CTRLA_RXPO(3) | SERCOM_USART_CTRLA_TXPO | SERCOM_USART_CTRLA_MODE(1) | SERCOM_USART_CTRLA_DORD;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLB.reg = SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_CHSIZE(0);
    	BOOT_USART_MODULE->USART.BAUD.reg = 50436;
    	while(BOOT_USART_MODULE->USART.STATUS.bit.SYNCBUSY);
    	BOOT_USART_MODULE->USART.CTRLA.bit.ENABLE = 1;
            
    	//Initialize flag
    	b_sharp_received = false;
    	idx_rx_read = 0;
    	idx_rx_write = 0;
    	idx_tx_read = 0;
    	idx_tx_write = 0;
    
    	error_timeout = 0;
    }
    Tandis que nous avions fait :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    PORT->Group[0].PINCFG[10].bit.PMUXEN = 1;
    Je n'ai pas regardé l'intégralité des fichiers, si tu es curieux je peux t'envoyer le projet.

    Maintenant que Sam-Ba se lance correctement et qu'il communique, un autre problème survient.
    Le support m'a également passer un programme de test (LED_TOGGLE6.bin) qui est censé allumer la LED. Dans le doute qu'il ait choisi une LED qui n'existe pas sur ma board j'ai créé mon petit programme également.
    Une fois que celui-ci est écrit sur la board (et bien écrit, la verification entre le fichier et la mémoire de la puce est validée), je quitte Sam-ba, je débranche le câble USB/USART et je relâche PIN_PA15. Une fois la board redémarré la LED devrais s’allumer (PA_15 n'est pas LOW et il y a un programme) mais il ne se passe rien ...

    Une piste aura été qu'il oublie de redéfinir dans le bootloader
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    #define APP_START_ADDRESS          0x00000800
    en
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    #define APP_START_ADDRESS          0x00000900
    mais non, c'est bien défini ...

    Ce que je fais (en anglais, je suppose que ça ne te dérange pas) :

    1 : I erase the memory of the chip with Atmel
    2 : I program the bootloader of the chip with Atmel
    3 : I unconnect the Atmel-Ice and i pull low the PIN PA_15
    4 : I reboot the board and i connect the USAR/USB cable
    5 : I launch sam-ba and i configure it with our parameters (0x900)
    6 : I send our program (LED_TOGGLE6.bin or my_led_test.bin) on the board
    7 : I check the good writting of the program (compare betwin the file and the memory of the chip)
    8 : I quit Sam-Ba, i disconnect the USART/USB cable, and i unpull the PIN PA_15
    9 : I reboot the board

    Une idée ? Je fais quelque chose dans le mauvais ordre ?

  20. #60
    Modérateur

    Avatar de Vincent PETIT
    Homme Profil pro
    Consultant en Systèmes Embarqués
    Inscrit en
    Avril 2002
    Messages
    3 191
    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 191
    Points : 11 580
    Points
    11 580
    Par défaut
    Citation Envoyé par cracked Voir le message
    [...]nous avions fait :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    PORT->Group[0].PINCFG[10].bit.PMUXEN = 1;
    Ok, pourtant nous avions regardé ce qu'était Group[0] et rien ne nous avait interpellé !? Nous aurions du regarder dans d'autres fichiers car je vois pas la correspondance entre la datasheet et Group[0].


    Citation Envoyé par cracked Voir le message
    Ce que je fais (en anglais, je suppose que ça ne te dérange pas) :

    1 : I erase the memory of the chip with Atmel
    2 : I program the bootloader of the chip with Atmel
    3 : I unconnect the Atmel-Ice and i pull low the PIN PA_15
    4 : I reboot the board and i connect the USAR/USB cable
    5 : I launch sam-ba and i configure it with our parameters (0x900)
    6 : I send our program (LED_TOGGLE6.bin or my_led_test.bin) on the board
    7 : I check the good writting of the program (compare betwin the file and the memory of the chip)
    8 : I quit Sam-Ba, i disconnect the USART/USB cable, and i unpull the PIN PA_15
    9 : I reboot the board

    Une idée ? Je fais quelque chose dans le mauvais ordre ?
    LED_TOGGLE6.bin ou my_led_test.bin on bien était compilé avec un décalage en mémoire de 0x900 ?
    La science ne nous apprend rien : c'est l'expérience qui nous apprend quelque chose.
    Richard Feynman

+ Répondre à la discussion
Cette discussion est résolue.
Page 3 sur 4 PremièrePremière 1234 DernièreDernière

Discussions similaires

  1. Requête update à partir d'une autre table
    Par amiral thrawn dans le forum Langage SQL
    Réponses: 5
    Dernier message: 15/02/2024, 11h40
  2. Réponses: 0
    Dernier message: 06/09/2007, 10h14
  3. [dBase]il y a mieux que la commande sql UPDATE ?
    Par sana72 dans le forum Autres SGBD
    Réponses: 4
    Dernier message: 12/12/2002, 11h59
  4. Réponses: 3
    Dernier message: 10/11/2002, 11h03
  5. update et virgule
    Par Delph dans le forum Bases de données
    Réponses: 8
    Dernier message: 27/08/2002, 14h40

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