Bonsoir, je dispose de mon pico2 , de la documentation du rp2530 à cette adresse:

https://datasheets.raspberrypi.com/p...-datasheet.pdf


mon but est d' arriver à "juste" changer le registre qui me permet de mettre un état bas ou haut de
l'un des port gpio du pico2 en assambleur ?
Après plusieurs test avec visual studio pour programmer facilement avec la "tool chain" je souhaite activé une sortie en assembleur et pas en C ou python.

j'ai donc récupérer le code assembleur et editer le fichier en .S
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
.global main      # Provide program starting address to linker
main:   jal   stdio_init_all
        mv    s0, x0
loop:   la    a0, helloworld # load address of helloworld
        addi  s0, s0, 1
        mv    a1, s0        # counter        
        jal   printf
        j     loop
.data
helloworld:      .asciz "Hello RISC-V World %d\n"
et j'ai pu compiler et uploader dans le pico et cela fonctionne.

je me dis que j'ai peut être un bon début mais insuffisant pour arriver à ecrire dans un registre de sortie.
pour l'exemple c'est du risc V mais je vais le faire avec la puce rp2350.
je recherche donc les éléments qui me permettront d'arriver à charger les registres et instructions.

en page 17 de la doc rp2350 j'ai un tableau comme ceci:


comment faut t'il lire ?
le GPIO c'est le numéro du registre ? les F0 à F11 sont la correspondance du poids du registe (soit 12 bits)?

Nom : tableau.png
Affichages : 169
Taille : 33,9 Ko

à la page 593 c'est ceci comme bout de code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
179 typedef struct {
180
io_bank0_status_ctrl_hw_t io[48];
181
182
uint32_t _pad0[32];
183
184
// (Description copied from array index 0 register IO_BANK0_IRQSUMMARY_PROC0_SECURE0
applies similarly to other array indexes)
185_REG_(IO_BANK0_IRQSUMMARY_PROC0_SECURE0_OFFSET) // IO_BANK0_IRQSUMMARY_PROC0_SECURE0
186// 0x80000000 [31]
GPIO31
(0)
187// 0x40000000 [30]
GPIO30
(0)
188// 0x20000000 [29]
GPIO29
(0)
189// 0x10000000 [28]
GPIO28
(0)
190// 0x08000000 [27]
GPIO27
(0)
191// 0x04000000 [26]
GPIO26
(0)
192// 0x02000000 [25]
GPIO25
(0)
193// 0x01000000 [24]
GPIO24
(0)
194// 0x00800000 [23]
GPIO23
(0)
195// 0x00400000 [22]
GPIO22
(0)
196// 0x00200000 [21]
GPIO21
(0)
197// 0x00100000 [20]
GPIO20
(0)
198// 0x00080000 [19]
GPIO19
(0)
199// 0x00040000 [18]
GPIO18
(0)
200// 0x00020000 [17]
GPIO17
(0)
201// 0x00010000 [16]
GPIO16
(0)
202// 0x00008000 [15]
GPIO15
(0)
203// 0x00004000 [14]
GPIO14
(0)
204// 0x00002000 [13]
GPIO13
(0)
205// 0x00001000 [12]
GPIO12
(0)
206// 0x00000800 [11]
GPIO11
(0)
207// 0x00000400 [10]
GPIO10
(0)
208// 0x00000200 [9]
GPIO9
(0)
209// 0x00000100 [8]
GPIO8
(0)
210// 0x00000080 [7]
GPIO7
(0)
211// 0x00000040 [6]
GPIO6
(0)
212// 0x00000020 [5]
GPIO5
(0)
213// 0x00000010 [4]
GPIO4
(0)
214// 0x00000008 [3]
GPIO3
(0)
215// 0x00000004 [2]
GPIO2
(0)
216// 0x00000002 [1]
GPIO1
(0)
217// 0x00000001 [0]
GPIO0
(0)
218io_ro_32 irqsummary_proc0_secure[2];
pour manipuler le GPIO09 par exemple je vais avoir besoin de l'adresse:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
// 0x00000200 [9]
GPIO9
(0)

pour les instructions j'ai vu dans la doc ce tableau(à la page 887:

Nom : instruction.png
Affichages : 171
Taille : 47,8 Ko
donc ici j'ai tout les instructions pour y insérer mon code ?
après qu'est ce que je dois chercher ?

sinon j'ai vu ce bout de code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
int main() {
    stdio_init_all();

    // We'll use WATCHDOG_SCRATCH0 as a convenient 32 bit read/write register
    // that we can assign arbitrary values to
    io_rw_32 *scratch32 = &watchdog_hw->scratch[0];
    // Alias the scratch register as two halfwords at offsets +0x0 and +0x2
    volatile uint16_t *scratch16 = (volatile uint16_t *) scratch32;
    // Alias the scratch register as four bytes at offsets +0x0, +0x1, +0x2, +0x3:
    volatile uint8_t *scratch8 = (volatile uint8_t *) scratch32;

    // Show that we can read/write the scratch register as normal:
    printf("Writing 32 bit value\n");
    *scratch32 = 0xdeadbeef;
    printf("Should be 0xdeadbeef: 0x%08x\n", *scratch32);

    // We can do narrow reads just fine -- IO registers treat this as a 32 bit
    // read, and the processor/DMA will pick out the correct byte lanes based
    // on transfer size and address LSBs
    printf("\nReading back 1 byte at a time\n");
    // Little-endian!
    printf("Should be ef be ad de: %02x ", scratch8[0]);
    printf("%02x ", scratch8[1]);
    printf("%02x ", scratch8[2]);
    printf("%02x\n", scratch8[3]);

    // Byte writes are replicated four times across the 32-bit bus, and IO
    // registers usually sample the entire write bus.
    printf("\nWriting 8 bit value 0xa5 at offset 0\n");
    scratch8[0] = 0xa5;
    // Read back the whole scratch register in one go
    printf("Should be 0xa5a5a5a5: 0x%08x\n", *scratch32);

    // The IO register ignores the address LSBs [1:0] as well as the transfer
    // size, so it doesn't matter what byte offset we use
    printf("\nWriting 8 bit value at offset 1\n");
    scratch8[1] = 0x3c;
    printf("Should be 0x3c3c3c3c: 0x%08x\n", *scratch32);

    // Halfword writes are also replicated across the write data bus
    printf("\nWriting 16 bit value at offset 0\n");
    scratch16[0] = 0xf00d;
    printf("Should be 0xf00df00d: 0x%08x\n", *scratch32);
}
il est ecrit en C mais en m'inspirant je pourrais par exemple déjà d'écrire une valeur 32 bit en scratch0 valeur au pif en espérant que cela ne perturbe pas le pico2? et ensuite le lire puis l'afficher à l'aide de