Bonjour,
j'ai un pi pico1 avec un rp2040, je lui ai déposer l'uf2 de la sonde prob
https://github.com/raspberrypi/debug...ugprobe-v2.0.1

j'ai un pi pico2 avec un rp2350, je compilé avec vscode ce bout de code pour faire un test:


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
 
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/uart.h"
#include "hardware/gpio.h"
 
// UART defines
// By default the stdout UART is `uart0`, so we will use the second one
#define UART_ID uart1
#define BAUD_RATE 115200
 
// Use pins 4 and 5 for UART1
// Pins can be changed, see the GPIO function select table in the datasheet for information on GPIO assignments
#define UART_TX_PIN 4
#define UART_RX_PIN 5
 
#define FIRST_GPIO 2
#define BUTTON_GPIO (FIRST_GPIO + 7)
 
// This array converts a number 0-9 to a bit pattern to send to the GPIOs
int bits[10] = {
    0x3f, // 0
    0x06, // 1
    0x5b, // 2
    0x4f, // 3
    0x66, // 4
    0x6d, // 5
    0x7d, // 6
    0x07, // 7
    0x7f, // 8
    0x67  // 9
};
 
/// \tag::hello_gpio[]
int main()
{
    stdio_init_all();
    printf("Hello, 7segment - press button to count down!\n");
 
    // We could use gpio_set_dir_out_masked() here
    for (int gpio = FIRST_GPIO; gpio < FIRST_GPIO + 7; gpio++)
    {
        gpio_init(gpio);
        gpio_set_dir(gpio, GPIO_OUT);
        // Our bitmap above has a bit set where we need an LED on, BUT, we are pulling low to light
        // so invert our output
        gpio_set_outover(gpio, GPIO_OVERRIDE_INVERT);
    }
 
    gpio_init(BUTTON_GPIO);
    gpio_set_dir(BUTTON_GPIO, GPIO_IN);
    // We are using the button to pull down to 0v when pressed, so ensure that when
    // unpressed, it uses internal pull ups. Otherwise when unpressed, the input will
    // be floating.
    gpio_pull_up(BUTTON_GPIO);
 
    int val = 0;
    while (true)
    {
        // Count upwards or downwards depending on button input
        // We are pulling down on switch active, so invert the get to make
        // a press count downwards
        if (!gpio_get(BUTTON_GPIO))
        {
            if (val == 9)
            {
                val = 0;
            }
            else
            {
                val++;
            }
        }
        else if (val == 0)
        {
            val = 9;
        }
        else
        {
            val--;
        }
 
        // We are starting with GPIO 2, our bitmap starts at bit 0 so shift to start at 2.
        int32_t mask = bits[val] << FIRST_GPIO;
 
        // Set all our GPIOs in one go!
        // If something else is using GPIO, we might want to use gpio_put_masked()
        gpio_set_mask(mask);
        sleep_ms(250);
        gpio_clr_mask(mask);
 
        uart_init(UART_ID, BAUD_RATE);
        // Set the TX and RX pins by using the function select on the GPIO
        // Set datasheet for more information on function select
        gpio_set_function(UART_TX_PIN, GPIO_FUNC_UART);
        gpio_set_function(UART_RX_PIN, GPIO_FUNC_UART);
 
        // Use some the various UART functions to send out data
        // In a default system, printf will also output via the default UART
 
        // Send out a string, with CR/LF conversions
        uart_puts(UART_ID, "*** UART!\n");
        printf("===Hello, world!\n");
        sleep_ms(2000);
    }
 
    // For more examples of UART use see https://github.com/raspberrypi/pico-examples/tree/master/uart
}
/// \end::hello_gpio[]

j'ai soudé entre les carte ce branchement comme sur l'image:


par contre à gauche c'est un pico1 et à droite le pico2

dans vscode il y a plugin openocd que j'ai installé:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
---- Opened the serial port COM7 ----
14:50:29:078 -> ===Hello, world!
14:50:31:329 -> ===Hello, world!
avec vscode sous windows j'ai regarder le serial monitor en COM7
on voit que toutes les 2 secondes j'ai le message hello, par contre j'ai déplacer le cable 1 et 2 fil jaune et orange en
4 et 5 pour essayer d'obtenir le message dans serial monitor de vscode

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
        // Send out a string, with CR/LF conversions
        uart_puts(UART_ID, "*** UART!\n");
[/CODE]

les pin ayant été configurer en 4 et 5

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
#define UART_TX_PIN 4
#define UART_RX_PIN 5
Par contre est t'il normal que si je débranche la 1 et la 2 du pico2 le message hello ne s'affiche plus ?
les broche débug branché sur le pico1 ne permet pas de récupérer les messages qu'il va envoyé en sortie du pico 2 ?

Sinon une autre question avec vscode seul et les plugins installer openocd est t'il possible de flasher mon programme du pico directement sans passer par la case "débrancher le port usb" et appuyer sur le bouton shell ?

ou pour pouvoir le faire le plugin openocd ne serte pas dans vscode et qu'il faut passer par la case ligne de commande ? ou outil extérieur

merci d'avance de vos réponses.