Staging For Transfer

This commit is contained in:
Ulysse Cura 2026-01-11 20:35:28 +01:00
parent 3dcfee3804
commit a6fd4104b9
98 changed files with 45194 additions and 213 deletions

View File

@ -47166,29 +47166,37 @@
(net 108)
(uuid "15db1f31-4ec3-450e-8a1b-b96a1625c5f4")
)
(segment
(start 243.325 158.825)
(end 243.325 130.65)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "05a381c9-f4fd-46ce-b842-59d763754396")
)
(segment
(start 263 174.5)
(end 259 174.5)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "22113bcf-8473-47e6-967f-02e0e84f2494")
(uuid "3ad65f2f-f4bb-436c-9775-6b147bc56846")
)
(segment
(start 277.34 179.23)
(start 268.66 176.66)
(end 274.77 176.66)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "3c9ad422-bc00-4032-9049-1cc6dfb9f980")
(uuid "6b74ca28-4d8a-46f4-b969-9825bfb3f5ca")
)
(segment
(start 243.325 158.825)
(end 243.325 130.65)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "8060b083-0383-49a1-81e9-7c00104c10d4")
)
(segment
(start 266.5 174.5)
(end 268.66 176.66)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "919f8fe0-f9ff-4d22-8d8a-f548fd80bb2a")
)
(segment
(start 259 174.5)
@ -47196,23 +47204,15 @@
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "6e63d22c-15ca-45e6-bf01-62c1858c72a5")
(uuid "b6e8e91c-da97-4e29-8800-d52f1ab85e1f")
)
(segment
(start 274.77 176.66)
(end 268.66 176.66)
(end 277.34 179.23)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "dcb92c06-7b41-4c90-b3d5-2c8395a54f92")
)
(segment
(start 268.66 176.66)
(end 266.5 174.5)
(width 0.3)
(layer "F.Cu")
(net 109)
(uuid "fa2bd16a-f4eb-4ee8-82d5-24eb19dd1820")
(uuid "f1230b7b-0b7e-49e7-a9f9-a7e4dcc73c4f")
)
(via
(at 263 174.5)
@ -47236,7 +47236,7 @@
(width 0.3)
(layer "B.Cu")
(net 109)
(uuid "aac093f4-195f-436c-8bad-c6105dc1b23e")
(uuid "507d64e8-eaf8-41af-8964-a0a390a995cb")
)
(segment
(start 260.5 170)

View File

@ -5,7 +5,7 @@
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"high_contrast_mode": 1,
"net_color_mode": 1,
"opacity": {
"images": 0.6,

View File

@ -1,24 +1,18 @@
{
"env": {
"myDefaultIncludePath": [
"${workspaceFolder}/src/include/",
"${env:PICO_SDK_PATH}/src/**/include/",
"${env:PICO_SDK_PATH}/lib/**/include/",
"${workspaceFolder}/build/generated/pico_base/"
],
"myCompilerPath": "/usr/bin/arm-none-eabi-gcc"
},
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "linux-gcc-arm",
"includePath": [
"${myDefaultIncludePath}"
"${env:PICO_SDK_PATH}/src/**/include/",
"${env:PICO_SDK_PATH}/lib/**/include/",
"${env:PICO_SDK_PATH}/lib/**/src/",
"${workspaceFolder}/build/generated/pico_base/",
"${workspaceFolder}/src/",
"${workspaceFolder}/src/wifi/headers/"
],
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"browse": {
"path": [
"${workspaceFolder}"

View File

@ -1,23 +1,35 @@
{
"tasks": [
{
"label": "CMake & Make",
"type": "shell",
"command": "cd build; cmake -DPICO_BOARD=pico_w ..; make",
"label": "CMake in build/",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
"group": "build",
"command": "mkdir -p build && cd build && cmake ../ && make",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"type": "shell",
"command": "cd build; cmake -DPICO_BOARD=pico_w ..; make Flash",
"label": "CMake & Make & Flash",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
"type": "shell",
"group": "build",
"command": "mkdir -p build && cd build && cmake ../ && make Flash",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
}
],

View File

@ -6,7 +6,7 @@ project(main_controller C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})
#set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})
# Définir explicitement la carte comme Pico W
set(PICO_BOARD pico_w)
@ -19,18 +19,19 @@ pico_sdk_init()
add_executable(main_controller
src/main.c
src/robot.c
src/motors.c
src/gyro.c
src/i2c/motors.c
src/i2c/gyro.c
src/motion_control.c
src/i2c_master.c
src/wifi_operator.c
src/udp_client.c
src/udp_payload.c
src/i2c/i2c_master.c
src/i2c/mcp23017.c
src/wifi/wifi_operator.c
src/wifi/udp_client.c
src/wifi/udp_payload.c
)
target_include_directories(main_controller PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/src/include
${CMAKE_CURRENT_LIST_DIR}/src/
${CMAKE_CURRENT_LIST_DIR}/src/wifi/headers/
)
target_link_libraries(main_controller

View File

@ -0,0 +1,10 @@
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
// DO NOT EDIT!
// based on PICO_CONFIG_HEADER_FILES:
#include "/home/ulysse-cura/.local/share/pico-sdk/src/boards/include/boards/pico_w.h"
#include "/home/ulysse-cura/.local/share/pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
// based on PICO_RP2040_CONFIG_HEADER_FILES:

View File

@ -0,0 +1,19 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// ---------------------------------------
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
// ---------------------------------------
#ifndef _PICO_VERSION_H
#define _PICO_VERSION_H
#define PICO_SDK_VERSION_MAJOR 2
#define PICO_SDK_VERSION_MINOR 2
#define PICO_SDK_VERSION_REVISION 0
#define PICO_SDK_VERSION_STRING "2.2.0"
#endif

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,117 @@
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
/**
* Copyright (c) 2024 Raspberry Pi Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _DREQ_H
#define _DREQ_H
/**
* \file rp2040/dreq.h
*/
#ifdef __ASSEMBLER__
#define DREQ_PIO0_TX0 0
#define DREQ_PIO0_TX1 1
#define DREQ_PIO0_TX2 2
#define DREQ_PIO0_TX3 3
#define DREQ_PIO0_RX0 4
#define DREQ_PIO0_RX1 5
#define DREQ_PIO0_RX2 6
#define DREQ_PIO0_RX3 7
#define DREQ_PIO1_TX0 8
#define DREQ_PIO1_TX1 9
#define DREQ_PIO1_TX2 10
#define DREQ_PIO1_TX3 11
#define DREQ_PIO1_RX0 12
#define DREQ_PIO1_RX1 13
#define DREQ_PIO1_RX2 14
#define DREQ_PIO1_RX3 15
#define DREQ_SPI0_TX 16
#define DREQ_SPI0_RX 17
#define DREQ_SPI1_TX 18
#define DREQ_SPI1_RX 19
#define DREQ_UART0_TX 20
#define DREQ_UART0_RX 21
#define DREQ_UART1_TX 22
#define DREQ_UART1_RX 23
#define DREQ_PWM_WRAP0 24
#define DREQ_PWM_WRAP1 25
#define DREQ_PWM_WRAP2 26
#define DREQ_PWM_WRAP3 27
#define DREQ_PWM_WRAP4 28
#define DREQ_PWM_WRAP5 29
#define DREQ_PWM_WRAP6 30
#define DREQ_PWM_WRAP7 31
#define DREQ_I2C0_TX 32
#define DREQ_I2C0_RX 33
#define DREQ_I2C1_TX 34
#define DREQ_I2C1_RX 35
#define DREQ_ADC 36
#define DREQ_XIP_STREAM 37
#define DREQ_XIP_SSITX 38
#define DREQ_XIP_SSIRX 39
#define DREQ_DMA_TIMER0 59
#define DREQ_DMA_TIMER1 60
#define DREQ_DMA_TIMER2 61
#define DREQ_DMA_TIMER3 62
#define DREQ_FORCE 63
#else
/**
* \brief DREQ numbers for DMA pacing on RP2040 (used as typedef \ref dreq_num_t)
* \ingroup hardware_dma
*/
typedef enum dreq_num_rp2040 {
DREQ_PIO0_TX0 = 0, ///< Select PIO0's TX FIFO 0 as DREQ
DREQ_PIO0_TX1 = 1, ///< Select PIO0's TX FIFO 1 as DREQ
DREQ_PIO0_TX2 = 2, ///< Select PIO0's TX FIFO 2 as DREQ
DREQ_PIO0_TX3 = 3, ///< Select PIO0's TX FIFO 3 as DREQ
DREQ_PIO0_RX0 = 4, ///< Select PIO0's RX FIFO 0 as DREQ
DREQ_PIO0_RX1 = 5, ///< Select PIO0's RX FIFO 1 as DREQ
DREQ_PIO0_RX2 = 6, ///< Select PIO0's RX FIFO 2 as DREQ
DREQ_PIO0_RX3 = 7, ///< Select PIO0's RX FIFO 3 as DREQ
DREQ_PIO1_TX0 = 8, ///< Select PIO1's TX FIFO 0 as DREQ
DREQ_PIO1_TX1 = 9, ///< Select PIO1's TX FIFO 1 as DREQ
DREQ_PIO1_TX2 = 10, ///< Select PIO1's TX FIFO 2 as DREQ
DREQ_PIO1_TX3 = 11, ///< Select PIO1's TX FIFO 3 as DREQ
DREQ_PIO1_RX0 = 12, ///< Select PIO1's RX FIFO 0 as DREQ
DREQ_PIO1_RX1 = 13, ///< Select PIO1's RX FIFO 1 as DREQ
DREQ_PIO1_RX2 = 14, ///< Select PIO1's RX FIFO 2 as DREQ
DREQ_PIO1_RX3 = 15, ///< Select PIO1's RX FIFO 3 as DREQ
DREQ_SPI0_TX = 16, ///< Select SPI0's TX FIFO as DREQ
DREQ_SPI0_RX = 17, ///< Select SPI0's RX FIFO as DREQ
DREQ_SPI1_TX = 18, ///< Select SPI1's TX FIFO as DREQ
DREQ_SPI1_RX = 19, ///< Select SPI1's RX FIFO as DREQ
DREQ_UART0_TX = 20, ///< Select UART0's TX FIFO as DREQ
DREQ_UART0_RX = 21, ///< Select UART0's RX FIFO as DREQ
DREQ_UART1_TX = 22, ///< Select UART1's TX FIFO as DREQ
DREQ_UART1_RX = 23, ///< Select UART1's RX FIFO as DREQ
DREQ_PWM_WRAP0 = 24, ///< Select PWM Counter 0's Wrap Value as DREQ
DREQ_PWM_WRAP1 = 25, ///< Select PWM Counter 1's Wrap Value as DREQ
DREQ_PWM_WRAP2 = 26, ///< Select PWM Counter 2's Wrap Value as DREQ
DREQ_PWM_WRAP3 = 27, ///< Select PWM Counter 3's Wrap Value as DREQ
DREQ_PWM_WRAP4 = 28, ///< Select PWM Counter 4's Wrap Value as DREQ
DREQ_PWM_WRAP5 = 29, ///< Select PWM Counter 5's Wrap Value as DREQ
DREQ_PWM_WRAP6 = 30, ///< Select PWM Counter 6's Wrap Value as DREQ
DREQ_PWM_WRAP7 = 31, ///< Select PWM Counter 7's Wrap Value as DREQ
DREQ_I2C0_TX = 32, ///< Select I2C0's TX FIFO as DREQ
DREQ_I2C0_RX = 33, ///< Select I2C0's RX FIFO as DREQ
DREQ_I2C1_TX = 34, ///< Select I2C1's TX FIFO as DREQ
DREQ_I2C1_RX = 35, ///< Select I2C1's RX FIFO as DREQ
DREQ_ADC = 36, ///< Select the ADC as DREQ
DREQ_XIP_STREAM = 37, ///< Select the XIP Streaming FIFO as DREQ
DREQ_XIP_SSITX = 38, ///< Select the XIP SSI TX FIFO as DREQ
DREQ_XIP_SSIRX = 39, ///< Select the XIP SSI RX FIFO as DREQ
DREQ_DMA_TIMER0 = 59, ///< Select DMA_TIMER0 as DREQ
DREQ_DMA_TIMER1 = 60, ///< Select DMA_TIMER0 as DREQ
DREQ_DMA_TIMER2 = 61, ///< Select DMA_TIMER1 as DREQ
DREQ_DMA_TIMER3 = 62, ///< Select DMA_TIMER3 as DREQ
DREQ_FORCE = 63, ///< Select FORCE as DREQ
DREQ_COUNT
} dreq_num_t;
#endif
#endif // _DREQ_H

View File

@ -0,0 +1,124 @@
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
/**
* Copyright (c) 2024 Raspberry Pi Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _INTCTRL_H
#define _INTCTRL_H
/**
* \file rp2040/intctrl.h
*/
#ifdef __ASSEMBLER__
#define TIMER_IRQ_0 0
#define TIMER_IRQ_1 1
#define TIMER_IRQ_2 2
#define TIMER_IRQ_3 3
#define PWM_IRQ_WRAP 4
#define USBCTRL_IRQ 5
#define XIP_IRQ 6
#define PIO0_IRQ_0 7
#define PIO0_IRQ_1 8
#define PIO1_IRQ_0 9
#define PIO1_IRQ_1 10
#define DMA_IRQ_0 11
#define DMA_IRQ_1 12
#define IO_IRQ_BANK0 13
#define IO_IRQ_QSPI 14
#define SIO_IRQ_PROC0 15
#define SIO_IRQ_PROC1 16
#define CLOCKS_IRQ 17
#define SPI0_IRQ 18
#define SPI1_IRQ 19
#define UART0_IRQ 20
#define UART1_IRQ 21
#define ADC_IRQ_FIFO 22
#define I2C0_IRQ 23
#define I2C1_IRQ 24
#define RTC_IRQ 25
#define SPARE_IRQ_0 26
#define SPARE_IRQ_1 27
#define SPARE_IRQ_2 28
#define SPARE_IRQ_3 29
#define SPARE_IRQ_4 30
#define SPARE_IRQ_5 31
#else
/**
* \brief Interrupt numbers on RP2040 (used as typedef \ref irq_num_t)
* \ingroup hardware_irq
*/
typedef enum irq_num_rp2040 {
TIMER_IRQ_0 = 0, ///< Select TIMER's IRQ 0 output
TIMER_IRQ_1 = 1, ///< Select TIMER's IRQ 1 output
TIMER_IRQ_2 = 2, ///< Select TIMER's IRQ 2 output
TIMER_IRQ_3 = 3, ///< Select TIMER's IRQ 3 output
PWM_IRQ_WRAP = 4, ///< Select PWM's IRQ_WRAP output
USBCTRL_IRQ = 5, ///< Select USBCTRL's IRQ output
XIP_IRQ = 6, ///< Select XIP's IRQ output
PIO0_IRQ_0 = 7, ///< Select PIO0's IRQ 0 output
PIO0_IRQ_1 = 8, ///< Select PIO0's IRQ 1 output
PIO1_IRQ_0 = 9, ///< Select PIO1's IRQ 0 output
PIO1_IRQ_1 = 10, ///< Select PIO1's IRQ 1 output
DMA_IRQ_0 = 11, ///< Select DMA's IRQ 0 output
DMA_IRQ_1 = 12, ///< Select DMA's IRQ 1 output
IO_IRQ_BANK0 = 13, ///< Select IO_BANK0's IRQ output
IO_IRQ_QSPI = 14, ///< Select IO_QSPI's IRQ output
SIO_IRQ_PROC0 = 15, ///< Select SIO_PROC0's IRQ output
SIO_IRQ_PROC1 = 16, ///< Select SIO_PROC1's IRQ output
CLOCKS_IRQ = 17, ///< Select CLOCKS's IRQ output
SPI0_IRQ = 18, ///< Select SPI0's IRQ output
SPI1_IRQ = 19, ///< Select SPI1's IRQ output
UART0_IRQ = 20, ///< Select UART0's IRQ output
UART1_IRQ = 21, ///< Select UART1's IRQ output
ADC_IRQ_FIFO = 22, ///< Select ADC's IRQ_FIFO output
I2C0_IRQ = 23, ///< Select I2C0's IRQ output
I2C1_IRQ = 24, ///< Select I2C1's IRQ output
RTC_IRQ = 25, ///< Select RTC's IRQ output
SPARE_IRQ_0 = 26, ///< Select SPARE IRQ 0
SPARE_IRQ_1 = 27, ///< Select SPARE IRQ 1
SPARE_IRQ_2 = 28, ///< Select SPARE IRQ 2
SPARE_IRQ_3 = 29, ///< Select SPARE IRQ 3
SPARE_IRQ_4 = 30, ///< Select SPARE IRQ 4
SPARE_IRQ_5 = 31, ///< Select SPARE IRQ 5
IRQ_COUNT
} irq_num_t;
#endif
#define isr_timer_0 isr_irq0
#define isr_timer_1 isr_irq1
#define isr_timer_2 isr_irq2
#define isr_timer_3 isr_irq3
#define isr_pwm_wrap isr_irq4
#define isr_usbctrl isr_irq5
#define isr_xip isr_irq6
#define isr_pio0_0 isr_irq7
#define isr_pio0_1 isr_irq8
#define isr_pio1_0 isr_irq9
#define isr_pio1_1 isr_irq10
#define isr_dma_0 isr_irq11
#define isr_dma_1 isr_irq12
#define isr_io_bank0 isr_irq13
#define isr_io_qspi isr_irq14
#define isr_sio_proc0 isr_irq15
#define isr_sio_proc1 isr_irq16
#define isr_clocks isr_irq17
#define isr_spi0 isr_irq18
#define isr_spi1 isr_irq19
#define isr_uart0 isr_irq20
#define isr_uart1 isr_irq21
#define isr_adc_fifo isr_irq22
#define isr_i2c0 isr_irq23
#define isr_i2c1 isr_irq24
#define isr_rtc isr_irq25
#define isr_spare_0 isr_irq26
#define isr_spare_1 isr_irq27
#define isr_spare_2 isr_irq28
#define isr_spare_3 isr_irq29
#define isr_spare_4 isr_irq30
#define isr_spare_5 isr_irq31
#endif // _INTCTRL_H

View File

@ -0,0 +1,150 @@
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000000f0 20041f00 20041f00 00001f00 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .ARM.attributes 00000022 00000000 00000000 00001ff0 2**0
CONTENTS, READONLY
2 .debug_line 000000ed 00000000 00000000 00002012 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
3 .debug_line_str 0000016b 00000000 00000000 000020ff 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
4 .debug_info 00000025 00000000 00000000 0000226a 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
5 .debug_abbrev 00000014 00000000 00000000 0000228f 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
6 .debug_aranges 00000020 00000000 00000000 000022a8 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
7 .debug_str 000000ea 00000000 00000000 000022c8 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
Disassembly of section .text:
20041f00 <_stage2_boot>:
20041f00: b500 push {lr}
20041f02: 4b32 ldr r3, [pc, #200] @ (20041fcc <literals>)
20041f04: 2021 movs r0, #33 @ 0x21
20041f06: 6058 str r0, [r3, #4]
20041f08: 6898 ldr r0, [r3, #8]
20041f0a: 2102 movs r1, #2
20041f0c: 4388 bics r0, r1
20041f0e: 6098 str r0, [r3, #8]
20041f10: 60d8 str r0, [r3, #12]
20041f12: 6118 str r0, [r3, #16]
20041f14: 6158 str r0, [r3, #20]
20041f16: 4b2e ldr r3, [pc, #184] @ (20041fd0 <literals+0x4>)
20041f18: 2100 movs r1, #0
20041f1a: 6099 str r1, [r3, #8]
20041f1c: 2102 movs r1, #2
20041f1e: 6159 str r1, [r3, #20]
20041f20: 2101 movs r1, #1
20041f22: 22f0 movs r2, #240 @ 0xf0
20041f24: 5099 str r1, [r3, r2]
20041f26 <program_sregs>:
20041f26: 492b ldr r1, [pc, #172] @ (20041fd4 <literals+0x8>)
20041f28: 6019 str r1, [r3, #0]
20041f2a: 2101 movs r1, #1
20041f2c: 6099 str r1, [r3, #8]
20041f2e: 2035 movs r0, #53 @ 0x35
20041f30: f000 f844 bl 20041fbc <read_flash_sreg>
20041f34: 2202 movs r2, #2
20041f36: 4290 cmp r0, r2
20041f38: d014 beq.n 20041f64 <skip_sreg_programming>
20041f3a: 2106 movs r1, #6
20041f3c: 6619 str r1, [r3, #96] @ 0x60
20041f3e: f000 f834 bl 20041faa <wait_ssi_ready>
20041f42: 6e19 ldr r1, [r3, #96] @ 0x60
20041f44: 2101 movs r1, #1
20041f46: 6619 str r1, [r3, #96] @ 0x60
20041f48: 2000 movs r0, #0
20041f4a: 6618 str r0, [r3, #96] @ 0x60
20041f4c: 661a str r2, [r3, #96] @ 0x60
20041f4e: f000 f82c bl 20041faa <wait_ssi_ready>
20041f52: 6e19 ldr r1, [r3, #96] @ 0x60
20041f54: 6e19 ldr r1, [r3, #96] @ 0x60
20041f56: 6e19 ldr r1, [r3, #96] @ 0x60
20041f58: 2005 movs r0, #5
20041f5a: f000 f82f bl 20041fbc <read_flash_sreg>
20041f5e: 2101 movs r1, #1
20041f60: 4208 tst r0, r1
20041f62: d1f9 bne.n 20041f58 <program_sregs+0x32>
20041f64 <skip_sreg_programming>:
20041f64: 2100 movs r1, #0
20041f66: 6099 str r1, [r3, #8]
20041f68 <dummy_read>:
20041f68: 491b ldr r1, [pc, #108] @ (20041fd8 <literals+0xc>)
20041f6a: 6019 str r1, [r3, #0]
20041f6c: 2100 movs r1, #0
20041f6e: 6059 str r1, [r3, #4]
20041f70: 491a ldr r1, [pc, #104] @ (20041fdc <literals+0x10>)
20041f72: 481b ldr r0, [pc, #108] @ (20041fe0 <literals+0x14>)
20041f74: 6001 str r1, [r0, #0]
20041f76: 2101 movs r1, #1
20041f78: 6099 str r1, [r3, #8]
20041f7a: 21eb movs r1, #235 @ 0xeb
20041f7c: 6619 str r1, [r3, #96] @ 0x60
20041f7e: 21a0 movs r1, #160 @ 0xa0
20041f80: 6619 str r1, [r3, #96] @ 0x60
20041f82: f000 f812 bl 20041faa <wait_ssi_ready>
20041f86: 2100 movs r1, #0
20041f88: 6099 str r1, [r3, #8]
20041f8a <configure_ssi>:
20041f8a: 4916 ldr r1, [pc, #88] @ (20041fe4 <literals+0x18>)
20041f8c: 4814 ldr r0, [pc, #80] @ (20041fe0 <literals+0x14>)
20041f8e: 6001 str r1, [r0, #0]
20041f90: 2101 movs r1, #1
20041f92: 6099 str r1, [r3, #8]
20041f94 <check_return>:
20041f94: bc01 pop {r0}
20041f96: 2800 cmp r0, #0
20041f98: d000 beq.n 20041f9c <vector_into_flash>
20041f9a: 4700 bx r0
20041f9c <vector_into_flash>:
20041f9c: 4812 ldr r0, [pc, #72] @ (20041fe8 <literals+0x1c>)
20041f9e: 4913 ldr r1, [pc, #76] @ (20041fec <literals+0x20>)
20041fa0: 6008 str r0, [r1, #0]
20041fa2: c803 ldmia r0, {r0, r1}
20041fa4: f380 8808 msr MSP, r0
20041fa8: 4708 bx r1
20041faa <wait_ssi_ready>:
20041faa: b503 push {r0, r1, lr}
20041fac: 6a99 ldr r1, [r3, #40] @ 0x28
20041fae: 2004 movs r0, #4
20041fb0: 4201 tst r1, r0
20041fb2: d0fb beq.n 20041fac <wait_ssi_ready+0x2>
20041fb4: 2001 movs r0, #1
20041fb6: 4201 tst r1, r0
20041fb8: d1f8 bne.n 20041fac <wait_ssi_ready+0x2>
20041fba: bd03 pop {r0, r1, pc}
20041fbc <read_flash_sreg>:
20041fbc: b502 push {r1, lr}
20041fbe: 6618 str r0, [r3, #96] @ 0x60
20041fc0: 6618 str r0, [r3, #96] @ 0x60
20041fc2: f7ff fff2 bl 20041faa <wait_ssi_ready>
20041fc6: 6e18 ldr r0, [r3, #96] @ 0x60
20041fc8: 6e18 ldr r0, [r3, #96] @ 0x60
20041fca: bd02 pop {r1, pc}
20041fcc <literals>:
20041fcc: 40020000 .word 0x40020000
20041fd0: 18000000 .word 0x18000000
20041fd4: 00070000 .word 0x00070000
20041fd8: 005f0300 .word 0x005f0300
20041fdc: 00002221 .word 0x00002221
20041fe0: 180000f4 .word 0x180000f4
20041fe4: a0002022 .word 0xa0002022
20041fe8: 10000100 .word 0x10000100
20041fec: e000ed08 .word 0xe000ed08

View File

@ -0,0 +1,23 @@
// Padded and checksummed version of: /home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a

View File

@ -0,0 +1,173 @@
// ---------------------------------------------------------------- //
// This file is autogenerated by pioasm version 2.2.0; do not edit! //
// ---------------------------------------------------------------- //
#pragma once
#if !PICO_NO_HARDWARE
#include "hardware/pio.h"
#endif
// ---------------- //
// spi_gap0_sample1 //
// ---------------- //
#define spi_gap0_sample1_wrap_target 0
#define spi_gap0_sample1_wrap 4
#define spi_gap0_sample1_pio_version 0
#define spi_gap0_sample1_offset_lp1_end 2u
#define spi_gap0_sample1_offset_end 5u
static const uint16_t spi_gap0_sample1_program_instructions[] = {
// .wrap_target
0x6001, // 0: out pins, 1 side 0
0x1040, // 1: jmp x--, 0 side 1
0xe080, // 2: set pindirs, 0 side 0
0x5001, // 3: in pins, 1 side 1
0x0083, // 4: jmp y--, 3 side 0
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program spi_gap0_sample1_program = {
.instructions = spi_gap0_sample1_program_instructions,
.length = 5,
.origin = -1,
.pio_version = spi_gap0_sample1_pio_version,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif
};
static inline pio_sm_config spi_gap0_sample1_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + spi_gap0_sample1_wrap_target, offset + spi_gap0_sample1_wrap);
sm_config_set_sideset(&c, 1, false, false);
return c;
}
#endif
// ----------------- //
// spi_gap01_sample0 //
// ----------------- //
#define spi_gap01_sample0_wrap_target 0
#define spi_gap01_sample0_wrap 5
#define spi_gap01_sample0_pio_version 0
#define spi_gap01_sample0_offset_lp1_end 2u
#define spi_gap01_sample0_offset_end 6u
static const uint16_t spi_gap01_sample0_program_instructions[] = {
// .wrap_target
0x6001, // 0: out pins, 1 side 0
0x1040, // 1: jmp x--, 0 side 1
0xe080, // 2: set pindirs, 0 side 0
0xb042, // 3: nop side 1
0x4001, // 4: in pins, 1 side 0
0x1084, // 5: jmp y--, 4 side 1
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program spi_gap01_sample0_program = {
.instructions = spi_gap01_sample0_program_instructions,
.length = 6,
.origin = -1,
.pio_version = spi_gap01_sample0_pio_version,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif
};
static inline pio_sm_config spi_gap01_sample0_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + spi_gap01_sample0_wrap_target, offset + spi_gap01_sample0_wrap);
sm_config_set_sideset(&c, 1, false, false);
return c;
}
#endif
// ------------------ //
// spi_gap010_sample1 //
// ------------------ //
#define spi_gap010_sample1_wrap_target 0
#define spi_gap010_sample1_wrap 6
#define spi_gap010_sample1_pio_version 0
#define spi_gap010_sample1_offset_lp1_end 2u
#define spi_gap010_sample1_offset_end 7u
static const uint16_t spi_gap010_sample1_program_instructions[] = {
// .wrap_target
0x6001, // 0: out pins, 1 side 0
0x1040, // 1: jmp x--, 0 side 1
0xe080, // 2: set pindirs, 0 side 0
0xb042, // 3: nop side 1
0xa042, // 4: nop side 0
0x5001, // 5: in pins, 1 side 1
0x0085, // 6: jmp y--, 5 side 0
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program spi_gap010_sample1_program = {
.instructions = spi_gap010_sample1_program_instructions,
.length = 7,
.origin = -1,
.pio_version = spi_gap010_sample1_pio_version,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif
};
static inline pio_sm_config spi_gap010_sample1_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + spi_gap010_sample1_wrap_target, offset + spi_gap010_sample1_wrap);
sm_config_set_sideset(&c, 1, false, false);
return c;
}
#endif
// ------------------------ //
// spi_gap0_sample1_regular //
// ------------------------ //
#define spi_gap0_sample1_regular_wrap_target 0
#define spi_gap0_sample1_regular_wrap 4
#define spi_gap0_sample1_regular_pio_version 0
#define spi_gap0_sample1_regular_offset_lp1_end 2u
#define spi_gap0_sample1_regular_offset_end 5u
static const uint16_t spi_gap0_sample1_regular_program_instructions[] = {
// .wrap_target
0x6001, // 0: out pins, 1 side 0
0x1040, // 1: jmp x--, 0 side 1
0xe080, // 2: set pindirs, 0 side 0
0x5001, // 3: in pins, 1 side 1
0x0083, // 4: jmp y--, 3 side 0
// .wrap
};
#if !PICO_NO_HARDWARE
static const struct pio_program spi_gap0_sample1_regular_program = {
.instructions = spi_gap0_sample1_regular_program_instructions,
.length = 5,
.origin = -1,
.pio_version = spi_gap0_sample1_regular_pio_version,
#if PICO_PIO_VERSION > 0
.used_gpio_ranges = 0x0
#endif
};
static inline pio_sm_config spi_gap0_sample1_regular_program_get_default_config(uint offset) {
pio_sm_config c = pio_get_default_sm_config();
sm_config_set_wrap(&c, offset + spi_gap0_sample1_regular_wrap_target, offset + spi_gap0_sample1_regular_wrap);
sm_config_set_sideset(&c, 1, false, false);
return c;
}
#endif

View File

@ -0,0 +1,6 @@
# This is a generated file and its contents are an internal implementation detail.
# The update step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
command=
work_dir=

View File

@ -0,0 +1,9 @@
# This is a generated file and its contents are an internal implementation detail.
# The download step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
method=source_dir
command=
source_dir=/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm
work_dir=

View File

@ -0,0 +1,7 @@
# This is a generated file and its contents are an internal implementation detail.
# The patch step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
command (connected)=
command (disconnected)=
work_dir=

View File

@ -0,0 +1,3 @@
set(PIOASM_EXTRA_SOURCE_FILES "" CACHE STRING "Initial cache" FORCE)
set(PIOASM_VERSION_STRING "2.2.0" CACHE STRING "Initial cache" FORCE)

View File

@ -0,0 +1 @@
cmd='/usr/bin/cmake;--no-warn-unused-cli;-DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake;-DPIOASM_FLAT_INSTALL=1;-DCMAKE_INSTALL_PREFIX=/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm-install;-DCMAKE_RULE_MESSAGES=OFF;-DCMAKE_INSTALL_MESSAGE=NEVER;-GUnix Makefiles;-C<TMP_DIR>/pioasmBuild-cache-$<CONFIG>.cmake;-S;<SOURCE_DIR><SOURCE_SUBDIR>;-B;<BINARY_DIR>'

View File

@ -0,0 +1,27 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an
# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it
# would cause a fatal error, even though it would be a no-op.
if(NOT EXISTS "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
file(MAKE_DIRECTORY "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
endif()
file(MAKE_DIRECTORY
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pioasm-install"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
)
set(configSubDirs )
foreach(subDir IN LISTS configSubDirs)
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp/${subDir}")
endforeach()
if(cfgdir)
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/main controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp${cfgdir}") # cfgdir has leading slash
endif()

View File

@ -0,0 +1 @@
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (2 * 1024 * 1024)

View File

@ -0,0 +1,3 @@
if (NOT TARGET pioasm)
include("${CMAKE_CURRENT_LIST_DIR}/pioasmTargets.cmake")
endif()

View File

@ -0,0 +1,72 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
# The tweak version component is ignored.
# The variable CVF_VERSION must be set before calling configure_file().
if (PACKAGE_FIND_VERSION_RANGE)
message(AUTHOR_WARNING
"`find_package()` specify a version range but the version strategy "
"(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
"with this request. Only the lower endpoint of the range will be used.")
endif()
set(PACKAGE_VERSION "2.2.0")
if("2.2.0" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
endif()
if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
endif()
set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
else()
set(CVF_VERSION_NO_TWEAK "2.2.0")
endif()
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
endif()
if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
endif()
if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
endif()
set(REQUESTED_VERSION_NO_TWEAK
"${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
endif()
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()

View File

@ -0,0 +1,18 @@
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "pioasm" for configuration "Release"
set_property(TARGET pioasm APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(pioasm PROPERTIES
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/pioasm/pioasm"
)
list(APPEND _cmake_import_check_targets pioasm )
list(APPEND _cmake_import_check_files_for_pioasm "${_IMPORT_PREFIX}/pioasm/pioasm" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

View File

@ -0,0 +1,100 @@
# Generated by CMake
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
if(CMAKE_VERSION VERSION_LESS "2.8.3")
message(FATAL_ERROR "CMake >= 2.8.3 required")
endif()
cmake_policy(PUSH)
cmake_policy(VERSION 2.8.3...3.29)
#----------------------------------------------------------------
# Generated CMake target import file.
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Protect against multiple inclusion, which would fail when already imported targets are added once more.
set(_cmake_targets_defined "")
set(_cmake_targets_not_defined "")
set(_cmake_expected_targets "")
foreach(_cmake_expected_target IN ITEMS pioasm)
list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
if(TARGET "${_cmake_expected_target}")
list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
else()
list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
endif()
endforeach()
unset(_cmake_expected_target)
if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
unset(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)
return()
endif()
if(NOT _cmake_targets_defined STREQUAL "")
string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
endif()
unset(_cmake_targets_defined)
unset(_cmake_targets_not_defined)
unset(_cmake_expected_targets)
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
# Create imported target pioasm
add_executable(pioasm IMPORTED)
# Load information for each installed configuration.
file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/pioasmTargets-*.cmake")
foreach(_cmake_config_file IN LISTS _cmake_config_files)
include("${_cmake_config_file}")
endforeach()
unset(_cmake_config_file)
unset(_cmake_config_files)
# Cleanup temporary variables.
set(_IMPORT_PREFIX)
# Loop over all imported files and verify that they actually exist
foreach(_cmake_target IN LISTS _cmake_import_check_targets)
if(CMAKE_VERSION VERSION_LESS "3.28"
OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
if(NOT EXISTS "${_cmake_file}")
message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
\"${_cmake_file}\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"${CMAKE_CURRENT_LIST_FILE}\"
but not all the files it references.
")
endif()
endforeach()
endif()
unset(_cmake_file)
unset("_cmake_import_check_files_for_${_cmake_target}")
endforeach()
unset(_cmake_target)
unset(_cmake_import_check_targets)
# This file does not depend on other imported targets which have
# been exported from the same project but in a separate export set.
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
cmake_policy(POP)

Binary file not shown.

View File

@ -0,0 +1,3 @@
if (NOT TARGET pioasm)
include("${CMAKE_CURRENT_LIST_DIR}/pioasmTargets.cmake")
endif()

View File

@ -0,0 +1,72 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is equal to the requested version.
# The tweak version component is ignored.
# The variable CVF_VERSION must be set before calling configure_file().
if (PACKAGE_FIND_VERSION_RANGE)
message(AUTHOR_WARNING
"`find_package()` specify a version range but the version strategy "
"(ExactVersion) of the module `${PACKAGE_FIND_NAME}` is incompatible "
"with this request. Only the lower endpoint of the range will be used.")
endif()
set(PACKAGE_VERSION "2.2.0")
if("2.2.0" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
set(CVF_VERSION_PATCH "${CMAKE_MATCH_3}")
if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
endif()
if(NOT CVF_VERSION_MINOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
endif()
if(NOT CVF_VERSION_PATCH VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" CVF_VERSION_PATCH "${CVF_VERSION_PATCH}")
endif()
set(CVF_VERSION_NO_TWEAK "${CVF_VERSION_MAJOR}.${CVF_VERSION_MINOR}.${CVF_VERSION_PATCH}")
else()
set(CVF_VERSION_NO_TWEAK "2.2.0")
endif()
if(PACKAGE_FIND_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") # strip the tweak version
set(REQUESTED_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(REQUESTED_VERSION_MINOR "${CMAKE_MATCH_2}")
set(REQUESTED_VERSION_PATCH "${CMAKE_MATCH_3}")
if(NOT REQUESTED_VERSION_MAJOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MAJOR "${REQUESTED_VERSION_MAJOR}")
endif()
if(NOT REQUESTED_VERSION_MINOR VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_MINOR "${REQUESTED_VERSION_MINOR}")
endif()
if(NOT REQUESTED_VERSION_PATCH VERSION_EQUAL 0)
string(REGEX REPLACE "^0+" "" REQUESTED_VERSION_PATCH "${REQUESTED_VERSION_PATCH}")
endif()
set(REQUESTED_VERSION_NO_TWEAK
"${REQUESTED_VERSION_MAJOR}.${REQUESTED_VERSION_MINOR}.${REQUESTED_VERSION_PATCH}")
else()
set(REQUESTED_VERSION_NO_TWEAK "${PACKAGE_FIND_VERSION}")
endif()
if(REQUESTED_VERSION_NO_TWEAK STREQUAL CVF_VERSION_NO_TWEAK)
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()

View File

@ -0,0 +1,16 @@
/*
* Copyright (c) 2025 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// ---------------------------------------
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
// ---------------------------------------
#ifndef _PIOASM_VERSION_H
#define _PIOASM_VERSION_H
#define PIOASM_VERSION_STRING "2.2.0"
#endif

View File

@ -2,7 +2,7 @@
#define MOTION_CONTROL_H
#include <stdint.h>
#include "motors.h"
#include "i2c/headers/motors.h"
typedef struct motion_control_data_t {
int16_t angle;

View File

@ -2,10 +2,12 @@
#define ROBOT_H
#include <stdbool.h>
#include "gyro.h"
#include "i2c/headers/mcp23017.h"
#include "i2c/headers/gyro.h"
#include "motion_control.h"
typedef struct robot_t {
mcp23017_data_t mcp23017_data;
gyro_data_t gyro_data;
motion_control_data_t motion_control_data;
@ -16,7 +18,7 @@ typedef struct robot_t {
extern robot_t robot;
// Init all robot's components
int robot_init(void);
void robot_init(void);
// Handle inputs and outputs
void robot_handle_inputs_outputs(void);
// Deinit all robot's components

View File

@ -1,22 +1,22 @@
#include "include/gyro.h"
#include <stdint.h>
#include "include/i2c_master.h"
#include "include/robot.h"
#include <stdio.h>
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Thank you Keuronde ! *
* https://git.poivron-robotique.fr/Keuronde/Holonome_2024/src/branch/Demo_2025_03/gyro_L3GD20H.c *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "headers/gyro.h"
#include <stdint.h>
#include "headers/i2c_master.h"
#include "headers/robot.h"
// #include <stdio.h>
#define SAMPLE_MIN_ELAPSED_TIME 2 // ms
#define DPS_PER_DIGIT 0.00875f
int init_gyro(void)
{
// Verify gyro initialisation
// Verify gyro powering
uint8_t data;
i2c_master_read_reg(I2C_GYRO_ADDRESS, 0x0F, &data, 1);
@ -26,13 +26,12 @@ int init_gyro(void)
const uint8_t CTRL1_REG = 0x20;
const uint8_t CTRL1_CONFIG = 0b11101111; // DR : 11 // BW : 10 // PD : 1 // Zen : 1 // Xen : 1 // Yen : 1 //
const uint8_t CONFIG[] = {CTRL1_REG, CTRL1_CONFIG};
i2c_master_write(I2C_GYRO_ADDRESS, CONFIG, 2);
i2c_master_write_reg(I2C_GYRO_ADDRESS, CTRL1_REG, &CTRL1_CONFIG, 1);
uint8_t config_verification;
i2c_master_read_reg(I2C_GYRO_ADDRESS, CTRL1_REG, &config_verification, 1);
if(config_verification != config[1]) return -1;
if(config_verification != CTRL1_CONFIG) return -1;
robot.gyro_data.x_angle = 0.0f;
robot.gyro_data.y_angle = 0.0f;

View File

@ -3,8 +3,8 @@
#include <hardware/i2c.h>
#define I2C_MASTER_SDA_PIN 4
#define I2C_MASTER_SCL_PIN 5
#define I2C_MASTER_SDA_PIN 16
#define I2C_MASTER_SCL_PIN 17
#define I2C_MASTER_INSTANCE i2c0
#define I2C_MASTER_BAUD_RATE 300 * 1000
@ -14,6 +14,8 @@ void i2c_master_init(void);
void i2c_master_deinit(void);
// Send [src] of [len] to [address] and close communication
void i2c_master_write(uint8_t address, const uint8_t *src, size_t len);
// Send [reg] and [src] of [len] to [address] and close communication
void i2c_master_write_reg(uint8_t address, uint8_t reg, const uint8_t *src, size_t len);
// Receive [dst] of [len] from [address] and close communication
void i2c_master_read(uint8_t address, uint8_t *dst, size_t len);
// Send [reg] and receive data in [dst] and close communition

View File

@ -0,0 +1,29 @@
#ifndef MPU23017_H
#define MPU23017_H
#include <stdbool.h>
#include <stdint.h>
#define I2C_MCP23017_ADDRESS 0x20
#define GPIO_REG 0x12
typedef enum gpio_bank_t {
GPIO_BANK0,
GPIO_BANK1,
GPIO_NB_BANKS
} gpio_bank_t;
typedef struct mcp23017_data_t {
uint8_t gpio_state[GPIO_NB_BANKS];
} mcp23017_data_t;
// Init mpu23017 device with default settings over I2C
int init_mcp23017(void);
// Set GPIO on mpc23017
void mcp23017_gpio_put(unsigned int gpio_num, bool state);
// Uppdate mcp23017 GPIOs
void mcp23017_update(void);
#endif // MPU23017_H

View File

@ -1,4 +1,4 @@
#include "include/i2c_master.h"
#include "headers/i2c_master.h"
#include <pico/stdlib.h>
#include <hardware/i2c.h>
@ -24,6 +24,12 @@ inline void i2c_master_write(uint8_t address, const uint8_t *src, size_t len)
i2c_write_blocking(I2C_MASTER_INSTANCE, address, src, len, false);
}
inline void i2c_master_write_reg(uint8_t address, uint8_t reg, const uint8_t *src, size_t len)
{
i2c_write_blocking(I2C_MASTER_INSTANCE, address, &reg, 1, true);
i2c_write_blocking(I2C_MASTER_INSTANCE, address, src, len, false);
}
inline void i2c_master_read(uint8_t address, uint8_t *dst, size_t len)
{
i2c_read_blocking(I2C_MASTER_INSTANCE, address, dst, len, false);
@ -31,6 +37,6 @@ inline void i2c_master_read(uint8_t address, uint8_t *dst, size_t len)
inline void i2c_master_read_reg(uint8_t address, uint8_t reg, uint8_t *dst, size_t len)
{
i2c_master_write(address, &reg, 1);
i2c_write_blocking(I2C_MASTER_INSTANCE, address, &reg, 1, true);
i2c_master_read(address, dst, len);
}

View File

@ -0,0 +1,60 @@
#include "headers/mcp23017.h"
#include <stdio.h>
#include <assert.h>
#include "headers/i2c_master.h"
#include "headers/robot.h"
int init_mcp23017(void)
{
// IOCON
const uint8_t IOCON_REG = 0x0A;
const uint8_t IOCON_CONFIG = 0x00;
i2c_master_write_reg(I2C_MCP23017_ADDRESS, IOCON_REG, &IOCON_CONFIG, 1);
uint8_t iocon_config_verif;
i2c_master_read_reg(I2C_MCP23017_ADDRESS, IOCON_REG, &(iocon_config_verif), 1);
printf("mcp23017 config: 0x%x\n", iocon_config_verif);
if(IOCON_CONFIG != iocon_config_verif)
return -1;
const uint8_t IODIR_REG = 0x00;
const uint8_t IODIR_CONFIG[GPIO_NB_BANKS] = {0x00, 0x00};
i2c_master_write_reg(I2C_MCP23017_ADDRESS, IODIR_REG, IODIR_CONFIG, GPIO_NB_BANKS);
uint8_t iodir_config_verif[GPIO_NB_BANKS];
i2c_master_read_reg(I2C_MCP23017_ADDRESS, IODIR_REG, iodir_config_verif, GPIO_NB_BANKS);
printf("mcp23017 io dir config: 0x%x, 0x%x\n", iodir_config_verif[0], iodir_config_verif[1]);
if(IODIR_CONFIG[0] != iodir_config_verif[0] || IODIR_CONFIG[1] != iodir_config_verif[1])
return -1;
return 0;
}
void mcp23017_gpio_put(uint gpio_num, bool state)
{
assert(gpio_num < 16);
uint8_t gpio_bank = GPIO_BANK0;
if(gpio_num > 7)
{
gpio_bank++;
gpio_num -= 0x0008;
}
robot.mcp23017_data.gpio_state[gpio_bank] = (robot.mcp23017_data.gpio_state[gpio_bank] & ~(0x1 << gpio_num)) | (state << gpio_num);
}
void mcp23017_update(void)
{
i2c_master_write_reg(I2C_MCP23017_ADDRESS, GPIO_REG, robot.mcp23017_data.gpio_state, GPIO_NB_BANKS);
uint8_t gpio_state[GPIO_NB_BANKS];
i2c_master_read_reg(I2C_MCP23017_ADDRESS, GPIO_REG, gpio_state, GPIO_NB_BANKS);
printf("gpio states: 0x%x, 0x%x\n", gpio_state[0], gpio_state[1]);
}

View File

@ -1,7 +1,7 @@
#include "include/motors.h"
#include "headers/motors.h"
#include <stdlib.h>
#include "include/i2c_master.h"
#include "headers/i2c_master.h"
const motor_def_t MOTORS_DEFS[] = {
{0, 4, 5, 0x00},

View File

@ -8,13 +8,13 @@
* Ce Pico est un maitre pilotant le gyroscope, l'internet et le motion controller.*
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "include/robot.h"
#include "headers/robot.h"
robot_t robot;
int main(void)
{
if(robot_init()) return -1;
robot_init();
while(robot.is_running)
{

View File

@ -1,9 +1,9 @@
#include "include/motion_control.h"
#include "headers/motion_control.h"
#include <stdio.h>
#include <math.h>
#include "include/motors.h"
#include "include/robot.h"
#include "i2c/headers/motors.h"
#include "headers/robot.h"
#define GAIN_KD 10

View File

@ -1,40 +1,51 @@
#include "include/robot.h"
#include "headers/robot.h"
#include <pico/stdlib.h>
#include <pico/cyw43_arch.h>
#include <time.h>
#include <pico/mutex.h>
#include "include/i2c_master.h"
#include "include/udp_client.h"
#include "include/wifi_operator.h"
//#include "include/udp_fake_client.h"
#include "i2c/headers/i2c_master.h"
#include "i2c/headers/mcp23017.h"
#include "wifi/headers/udp_client.h"
#include "wifi/headers/wifi_operator.h"
auto_init_mutex(wifi_mutex);
int robot_init(void)
void robot_init(void)
{
robot.is_running = true;
stdio_init_all();
if(cyw43_arch_init())
{
return -1;
}
robot.is_running = false;
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
wifi_operator_init();
udp_client_init();
//wifi_operator_init();
//udp_client_init();
i2c_master_init();
if(init_gyro()) return -1;
/*
if(init_mcp23017())
robot.is_running = false;
*/
/*
if(init_gyro())
robot.is_running = false;
gyro_calibrate();
*/
//init_motion_control();
init_motion_control();
robot.is_running = true;
return 0;
// Initialisation ended
bool led_state = false;
for(uint i = 0, state = true; i < 5; i++)
{
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, state);
sleep_ms(100);
state = !state;
}
}
static inline void update_time(void)
@ -48,9 +59,9 @@ static inline void update_time(void)
static double elapsed_time = 0.0;
elapsed_time += robot.delta_time_ms;
if(elapsed_time >= 1000)
if(elapsed_time >= 1000.0)
{
elapsed_time = 0;
elapsed_time = 0.0;
mutex_enter_blocking(&wifi_mutex);
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, led_state);
@ -62,23 +73,25 @@ static inline void update_time(void)
void robot_handle_inputs_outputs(void)
{
mutex_enter_blocking(&wifi_mutex);
cyw43_arch_poll();
mutex_exit(&wifi_mutex);
//mutex_enter_blocking(&wifi_mutex);
//cyw43_arch_poll();
//mutex_exit(&wifi_mutex);
update_time();
gyro_update();
//gyro_update();
i2c_update_motion_control();
//i2c_update_motion_control();
i2c_update_servo_motors();
//i2c_update_servo_motors();
mcp23017_update();
tight_loop_contents();
}
void robot_deinit(void)
{
//udp_client_exit();
udp_client_exit();
i2c_master_deinit();
}
}

View File

@ -3,6 +3,8 @@
#define WIFI_OPERATOR_SSID "RiombotiqueAP"
#define WIFI_OPERATOR_PASSWORD "x4ptSLpPuJFcpzbLEhDoZ5J7dz"
//#define WIFI_OPERATOR_SSID "thinkpad"
//#define WIFI_OPERATOR_PASSWORD "CDuKaka2000!"
void wifi_operator_init(void);

View File

@ -1,7 +1,7 @@
#include "include/udp_client.h"
#include "headers/udp_client.h"
#include <stdio.h>
#include "include/udp_payload.h"
#include "headers/udp_payload.h"
udp_client_t udp_client;

View File

@ -1,7 +1,7 @@
#include "include/udp_payload.h"
#include "headers/udp_payload.h"
#include "include/motors.h"
#include "include/robot.h"
#include "i2c/headers/motors.h"
#include "headers/robot.h"
void __not_in_flash_func(udp_client_message_handler)(uint8_t *payload, uint16_t len, const ip_addr_t *addr, u16_t port)
{

View File

@ -1,4 +1,4 @@
#include "include/wifi_operator.h"
#include "headers/wifi_operator.h"
#include <stdio.h>
#include <pico/cyw43_arch.h>
@ -13,9 +13,6 @@ void wifi_operator_init(void)
// Désactiver le mode d'économie d'énergie
cyw43_wifi_pm(&cyw43_state, CYW43_NO_POWERSAVE_MODE);
// Afficher les paramètres de connexion
printf("Tentative de connexion à: SSID='%s'\n", WIFI_OPERATOR_SSID);
// Configuration IP
ip4_addr_t ip, netmask, gateway;
IP4_ADDR(&ip, 192, 168, 128, 2);
@ -28,19 +25,18 @@ void wifi_operator_init(void)
puts("Configuration IP effectuée");
int connection_return = 1;
// Tentativs de connexion
do
for(int error_code; ; !error_code)
{
puts("Tentative de connexion au réseau Wi-Fi...");
connection_return = cyw43_arch_wifi_connect_timeout_ms(WIFI_OPERATOR_SSID, WIFI_OPERATOR_PASSWORD, CYW43_AUTH_WPA2_AES_PSK, 10000);
// Afficher les paramètres de connexion
printf("Tentative de connexion à: SSID='%s'\n", WIFI_OPERATOR_SSID);
int error_code = cyw43_arch_wifi_connect_timeout_ms(WIFI_OPERATOR_SSID, WIFI_OPERATOR_PASSWORD, CYW43_AUTH_WPA2_AES_PSK, 10000);
if(connection_return)
if(error_code)
{
const char *error_description;
switch(connection_return)
switch(error_code)
{
case -1:
error_description = "General error";
@ -58,10 +54,9 @@ void wifi_operator_init(void)
error_description = "Unknow error";
}
printf("Error: WiFi can't be connected - Error code: %d - %s\n", connection_return, error_description);
printf("Error: WiFi can't be connected - Error code: %d - %s\n", error_code, error_description);
}
}
while(connection_return);
// Configuration de l'interface réseau
if(!netif_default)

View File

@ -1,18 +1,13 @@
{
"env": {
"myDefaultIncludePath": [
"${env:PICO_SDK_PATH}/src/**/include/",
"${workspaceFolder}/build/generated/pico_base/"
],
"myCompilerPath": "/usr/bin/arm-none-eabi-gcc"
},
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "linux-gcc-arm",
"includePath": [
"${myDefaultIncludePath}",
"${workspaceFolder}/build/"
"${env:PICO_SDK_PATH}/src/**/include/",
"${workspaceFolder}/build/generated/pico_base/",
"${workspaceFolder}/build/",
"${workspaceFolder}/src/"
],
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
"cStandard": "c11",

View File

@ -1,23 +1,35 @@
{
"tasks": [
{
"label": "CMake & Make",
"type": "shell",
"command": "cd build; cmake ../; make",
"label": "CMake in build/",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
"group": "build",
"command": "mkdir -p build && cd build && cmake ../ && make",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"type": "shell",
"command": "cd build; cmake ../; make Flash",
"label": "CMake & Make & Flash",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
"type": "shell",
"group": "build",
"command": "mkdir -p build && cd build && cmake ../ && make Flash",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
}
],

View File

@ -14,15 +14,19 @@ add_executable(motion_controller
src/main.c
src/robot.c
src/motors.c
src/i2c_slave.c
src/i2c_buffer.c
src/i2c/i2c_buffer.c
src/i2c/i2c_slave.c
)
target_include_directories(motion_controller PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src/
)
target_link_libraries(motion_controller
pico_stdlib
hardware_uart
hardware_i2c
hardware_pwm
hardware_uart
pico_stdlib
)
pico_enable_stdio_usb(motion_controller 1)

View File

@ -0,0 +1,10 @@
// AUTOGENERATED FROM PICO_CONFIG_HEADER_FILES and then PICO_<PLATFORM>_CONFIG_HEADER_FILES
// DO NOT EDIT!
// based on PICO_CONFIG_HEADER_FILES:
#include "/home/ulysse-cura/.local/share/pico-sdk/src/boards/include/boards/pico.h"
#include "/home/ulysse-cura/.local/share/pico-sdk/src/rp2_common/cmsis/include/cmsis/rename_exceptions.h"
// based on PICO_RP2040_CONFIG_HEADER_FILES:

View File

@ -0,0 +1,19 @@
/*
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
// ---------------------------------------
// THIS FILE IS AUTOGENERATED; DO NOT EDIT
// ---------------------------------------
#ifndef _PICO_VERSION_H
#define _PICO_VERSION_H
#define PICO_SDK_VERSION_MAJOR 2
#define PICO_SDK_VERSION_MINOR 2
#define PICO_SDK_VERSION_REVISION 0
#define PICO_SDK_VERSION_STRING "2.2.0"
#endif

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,117 @@
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
/**
* Copyright (c) 2024 Raspberry Pi Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _DREQ_H
#define _DREQ_H
/**
* \file rp2040/dreq.h
*/
#ifdef __ASSEMBLER__
#define DREQ_PIO0_TX0 0
#define DREQ_PIO0_TX1 1
#define DREQ_PIO0_TX2 2
#define DREQ_PIO0_TX3 3
#define DREQ_PIO0_RX0 4
#define DREQ_PIO0_RX1 5
#define DREQ_PIO0_RX2 6
#define DREQ_PIO0_RX3 7
#define DREQ_PIO1_TX0 8
#define DREQ_PIO1_TX1 9
#define DREQ_PIO1_TX2 10
#define DREQ_PIO1_TX3 11
#define DREQ_PIO1_RX0 12
#define DREQ_PIO1_RX1 13
#define DREQ_PIO1_RX2 14
#define DREQ_PIO1_RX3 15
#define DREQ_SPI0_TX 16
#define DREQ_SPI0_RX 17
#define DREQ_SPI1_TX 18
#define DREQ_SPI1_RX 19
#define DREQ_UART0_TX 20
#define DREQ_UART0_RX 21
#define DREQ_UART1_TX 22
#define DREQ_UART1_RX 23
#define DREQ_PWM_WRAP0 24
#define DREQ_PWM_WRAP1 25
#define DREQ_PWM_WRAP2 26
#define DREQ_PWM_WRAP3 27
#define DREQ_PWM_WRAP4 28
#define DREQ_PWM_WRAP5 29
#define DREQ_PWM_WRAP6 30
#define DREQ_PWM_WRAP7 31
#define DREQ_I2C0_TX 32
#define DREQ_I2C0_RX 33
#define DREQ_I2C1_TX 34
#define DREQ_I2C1_RX 35
#define DREQ_ADC 36
#define DREQ_XIP_STREAM 37
#define DREQ_XIP_SSITX 38
#define DREQ_XIP_SSIRX 39
#define DREQ_DMA_TIMER0 59
#define DREQ_DMA_TIMER1 60
#define DREQ_DMA_TIMER2 61
#define DREQ_DMA_TIMER3 62
#define DREQ_FORCE 63
#else
/**
* \brief DREQ numbers for DMA pacing on RP2040 (used as typedef \ref dreq_num_t)
* \ingroup hardware_dma
*/
typedef enum dreq_num_rp2040 {
DREQ_PIO0_TX0 = 0, ///< Select PIO0's TX FIFO 0 as DREQ
DREQ_PIO0_TX1 = 1, ///< Select PIO0's TX FIFO 1 as DREQ
DREQ_PIO0_TX2 = 2, ///< Select PIO0's TX FIFO 2 as DREQ
DREQ_PIO0_TX3 = 3, ///< Select PIO0's TX FIFO 3 as DREQ
DREQ_PIO0_RX0 = 4, ///< Select PIO0's RX FIFO 0 as DREQ
DREQ_PIO0_RX1 = 5, ///< Select PIO0's RX FIFO 1 as DREQ
DREQ_PIO0_RX2 = 6, ///< Select PIO0's RX FIFO 2 as DREQ
DREQ_PIO0_RX3 = 7, ///< Select PIO0's RX FIFO 3 as DREQ
DREQ_PIO1_TX0 = 8, ///< Select PIO1's TX FIFO 0 as DREQ
DREQ_PIO1_TX1 = 9, ///< Select PIO1's TX FIFO 1 as DREQ
DREQ_PIO1_TX2 = 10, ///< Select PIO1's TX FIFO 2 as DREQ
DREQ_PIO1_TX3 = 11, ///< Select PIO1's TX FIFO 3 as DREQ
DREQ_PIO1_RX0 = 12, ///< Select PIO1's RX FIFO 0 as DREQ
DREQ_PIO1_RX1 = 13, ///< Select PIO1's RX FIFO 1 as DREQ
DREQ_PIO1_RX2 = 14, ///< Select PIO1's RX FIFO 2 as DREQ
DREQ_PIO1_RX3 = 15, ///< Select PIO1's RX FIFO 3 as DREQ
DREQ_SPI0_TX = 16, ///< Select SPI0's TX FIFO as DREQ
DREQ_SPI0_RX = 17, ///< Select SPI0's RX FIFO as DREQ
DREQ_SPI1_TX = 18, ///< Select SPI1's TX FIFO as DREQ
DREQ_SPI1_RX = 19, ///< Select SPI1's RX FIFO as DREQ
DREQ_UART0_TX = 20, ///< Select UART0's TX FIFO as DREQ
DREQ_UART0_RX = 21, ///< Select UART0's RX FIFO as DREQ
DREQ_UART1_TX = 22, ///< Select UART1's TX FIFO as DREQ
DREQ_UART1_RX = 23, ///< Select UART1's RX FIFO as DREQ
DREQ_PWM_WRAP0 = 24, ///< Select PWM Counter 0's Wrap Value as DREQ
DREQ_PWM_WRAP1 = 25, ///< Select PWM Counter 1's Wrap Value as DREQ
DREQ_PWM_WRAP2 = 26, ///< Select PWM Counter 2's Wrap Value as DREQ
DREQ_PWM_WRAP3 = 27, ///< Select PWM Counter 3's Wrap Value as DREQ
DREQ_PWM_WRAP4 = 28, ///< Select PWM Counter 4's Wrap Value as DREQ
DREQ_PWM_WRAP5 = 29, ///< Select PWM Counter 5's Wrap Value as DREQ
DREQ_PWM_WRAP6 = 30, ///< Select PWM Counter 6's Wrap Value as DREQ
DREQ_PWM_WRAP7 = 31, ///< Select PWM Counter 7's Wrap Value as DREQ
DREQ_I2C0_TX = 32, ///< Select I2C0's TX FIFO as DREQ
DREQ_I2C0_RX = 33, ///< Select I2C0's RX FIFO as DREQ
DREQ_I2C1_TX = 34, ///< Select I2C1's TX FIFO as DREQ
DREQ_I2C1_RX = 35, ///< Select I2C1's RX FIFO as DREQ
DREQ_ADC = 36, ///< Select the ADC as DREQ
DREQ_XIP_STREAM = 37, ///< Select the XIP Streaming FIFO as DREQ
DREQ_XIP_SSITX = 38, ///< Select the XIP SSI TX FIFO as DREQ
DREQ_XIP_SSIRX = 39, ///< Select the XIP SSI RX FIFO as DREQ
DREQ_DMA_TIMER0 = 59, ///< Select DMA_TIMER0 as DREQ
DREQ_DMA_TIMER1 = 60, ///< Select DMA_TIMER0 as DREQ
DREQ_DMA_TIMER2 = 61, ///< Select DMA_TIMER1 as DREQ
DREQ_DMA_TIMER3 = 62, ///< Select DMA_TIMER3 as DREQ
DREQ_FORCE = 63, ///< Select FORCE as DREQ
DREQ_COUNT
} dreq_num_t;
#endif
#endif // _DREQ_H

View File

@ -0,0 +1,124 @@
// THIS HEADER FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
/**
* Copyright (c) 2024 Raspberry Pi Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _INTCTRL_H
#define _INTCTRL_H
/**
* \file rp2040/intctrl.h
*/
#ifdef __ASSEMBLER__
#define TIMER_IRQ_0 0
#define TIMER_IRQ_1 1
#define TIMER_IRQ_2 2
#define TIMER_IRQ_3 3
#define PWM_IRQ_WRAP 4
#define USBCTRL_IRQ 5
#define XIP_IRQ 6
#define PIO0_IRQ_0 7
#define PIO0_IRQ_1 8
#define PIO1_IRQ_0 9
#define PIO1_IRQ_1 10
#define DMA_IRQ_0 11
#define DMA_IRQ_1 12
#define IO_IRQ_BANK0 13
#define IO_IRQ_QSPI 14
#define SIO_IRQ_PROC0 15
#define SIO_IRQ_PROC1 16
#define CLOCKS_IRQ 17
#define SPI0_IRQ 18
#define SPI1_IRQ 19
#define UART0_IRQ 20
#define UART1_IRQ 21
#define ADC_IRQ_FIFO 22
#define I2C0_IRQ 23
#define I2C1_IRQ 24
#define RTC_IRQ 25
#define SPARE_IRQ_0 26
#define SPARE_IRQ_1 27
#define SPARE_IRQ_2 28
#define SPARE_IRQ_3 29
#define SPARE_IRQ_4 30
#define SPARE_IRQ_5 31
#else
/**
* \brief Interrupt numbers on RP2040 (used as typedef \ref irq_num_t)
* \ingroup hardware_irq
*/
typedef enum irq_num_rp2040 {
TIMER_IRQ_0 = 0, ///< Select TIMER's IRQ 0 output
TIMER_IRQ_1 = 1, ///< Select TIMER's IRQ 1 output
TIMER_IRQ_2 = 2, ///< Select TIMER's IRQ 2 output
TIMER_IRQ_3 = 3, ///< Select TIMER's IRQ 3 output
PWM_IRQ_WRAP = 4, ///< Select PWM's IRQ_WRAP output
USBCTRL_IRQ = 5, ///< Select USBCTRL's IRQ output
XIP_IRQ = 6, ///< Select XIP's IRQ output
PIO0_IRQ_0 = 7, ///< Select PIO0's IRQ 0 output
PIO0_IRQ_1 = 8, ///< Select PIO0's IRQ 1 output
PIO1_IRQ_0 = 9, ///< Select PIO1's IRQ 0 output
PIO1_IRQ_1 = 10, ///< Select PIO1's IRQ 1 output
DMA_IRQ_0 = 11, ///< Select DMA's IRQ 0 output
DMA_IRQ_1 = 12, ///< Select DMA's IRQ 1 output
IO_IRQ_BANK0 = 13, ///< Select IO_BANK0's IRQ output
IO_IRQ_QSPI = 14, ///< Select IO_QSPI's IRQ output
SIO_IRQ_PROC0 = 15, ///< Select SIO_PROC0's IRQ output
SIO_IRQ_PROC1 = 16, ///< Select SIO_PROC1's IRQ output
CLOCKS_IRQ = 17, ///< Select CLOCKS's IRQ output
SPI0_IRQ = 18, ///< Select SPI0's IRQ output
SPI1_IRQ = 19, ///< Select SPI1's IRQ output
UART0_IRQ = 20, ///< Select UART0's IRQ output
UART1_IRQ = 21, ///< Select UART1's IRQ output
ADC_IRQ_FIFO = 22, ///< Select ADC's IRQ_FIFO output
I2C0_IRQ = 23, ///< Select I2C0's IRQ output
I2C1_IRQ = 24, ///< Select I2C1's IRQ output
RTC_IRQ = 25, ///< Select RTC's IRQ output
SPARE_IRQ_0 = 26, ///< Select SPARE IRQ 0
SPARE_IRQ_1 = 27, ///< Select SPARE IRQ 1
SPARE_IRQ_2 = 28, ///< Select SPARE IRQ 2
SPARE_IRQ_3 = 29, ///< Select SPARE IRQ 3
SPARE_IRQ_4 = 30, ///< Select SPARE IRQ 4
SPARE_IRQ_5 = 31, ///< Select SPARE IRQ 5
IRQ_COUNT
} irq_num_t;
#endif
#define isr_timer_0 isr_irq0
#define isr_timer_1 isr_irq1
#define isr_timer_2 isr_irq2
#define isr_timer_3 isr_irq3
#define isr_pwm_wrap isr_irq4
#define isr_usbctrl isr_irq5
#define isr_xip isr_irq6
#define isr_pio0_0 isr_irq7
#define isr_pio0_1 isr_irq8
#define isr_pio1_0 isr_irq9
#define isr_pio1_1 isr_irq10
#define isr_dma_0 isr_irq11
#define isr_dma_1 isr_irq12
#define isr_io_bank0 isr_irq13
#define isr_io_qspi isr_irq14
#define isr_sio_proc0 isr_irq15
#define isr_sio_proc1 isr_irq16
#define isr_clocks isr_irq17
#define isr_spi0 isr_irq18
#define isr_spi1 isr_irq19
#define isr_uart0 isr_irq20
#define isr_uart1 isr_irq21
#define isr_adc_fifo isr_irq22
#define isr_i2c0 isr_irq23
#define isr_i2c1 isr_irq24
#define isr_rtc isr_irq25
#define isr_spare_0 isr_irq26
#define isr_spare_1 isr_irq27
#define isr_spare_2 isr_irq28
#define isr_spare_3 isr_irq29
#define isr_spare_4 isr_irq30
#define isr_spare_5 isr_irq31
#endif // _INTCTRL_H

View File

@ -0,0 +1,150 @@
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 000000f0 20041f00 20041f00 00001f00 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .ARM.attributes 00000022 00000000 00000000 00001ff0 2**0
CONTENTS, READONLY
2 .debug_line 000000ed 00000000 00000000 00002012 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
3 .debug_line_str 0000016d 00000000 00000000 000020ff 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
4 .debug_info 00000025 00000000 00000000 0000226c 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
5 .debug_abbrev 00000014 00000000 00000000 00002291 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
6 .debug_aranges 00000020 00000000 00000000 000022a8 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
7 .debug_str 000000ec 00000000 00000000 000022c8 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.elf: file format elf32-littlearm
Disassembly of section .text:
20041f00 <_stage2_boot>:
20041f00: b500 push {lr}
20041f02: 4b32 ldr r3, [pc, #200] @ (20041fcc <literals>)
20041f04: 2021 movs r0, #33 @ 0x21
20041f06: 6058 str r0, [r3, #4]
20041f08: 6898 ldr r0, [r3, #8]
20041f0a: 2102 movs r1, #2
20041f0c: 4388 bics r0, r1
20041f0e: 6098 str r0, [r3, #8]
20041f10: 60d8 str r0, [r3, #12]
20041f12: 6118 str r0, [r3, #16]
20041f14: 6158 str r0, [r3, #20]
20041f16: 4b2e ldr r3, [pc, #184] @ (20041fd0 <literals+0x4>)
20041f18: 2100 movs r1, #0
20041f1a: 6099 str r1, [r3, #8]
20041f1c: 2102 movs r1, #2
20041f1e: 6159 str r1, [r3, #20]
20041f20: 2101 movs r1, #1
20041f22: 22f0 movs r2, #240 @ 0xf0
20041f24: 5099 str r1, [r3, r2]
20041f26 <program_sregs>:
20041f26: 492b ldr r1, [pc, #172] @ (20041fd4 <literals+0x8>)
20041f28: 6019 str r1, [r3, #0]
20041f2a: 2101 movs r1, #1
20041f2c: 6099 str r1, [r3, #8]
20041f2e: 2035 movs r0, #53 @ 0x35
20041f30: f000 f844 bl 20041fbc <read_flash_sreg>
20041f34: 2202 movs r2, #2
20041f36: 4290 cmp r0, r2
20041f38: d014 beq.n 20041f64 <skip_sreg_programming>
20041f3a: 2106 movs r1, #6
20041f3c: 6619 str r1, [r3, #96] @ 0x60
20041f3e: f000 f834 bl 20041faa <wait_ssi_ready>
20041f42: 6e19 ldr r1, [r3, #96] @ 0x60
20041f44: 2101 movs r1, #1
20041f46: 6619 str r1, [r3, #96] @ 0x60
20041f48: 2000 movs r0, #0
20041f4a: 6618 str r0, [r3, #96] @ 0x60
20041f4c: 661a str r2, [r3, #96] @ 0x60
20041f4e: f000 f82c bl 20041faa <wait_ssi_ready>
20041f52: 6e19 ldr r1, [r3, #96] @ 0x60
20041f54: 6e19 ldr r1, [r3, #96] @ 0x60
20041f56: 6e19 ldr r1, [r3, #96] @ 0x60
20041f58: 2005 movs r0, #5
20041f5a: f000 f82f bl 20041fbc <read_flash_sreg>
20041f5e: 2101 movs r1, #1
20041f60: 4208 tst r0, r1
20041f62: d1f9 bne.n 20041f58 <program_sregs+0x32>
20041f64 <skip_sreg_programming>:
20041f64: 2100 movs r1, #0
20041f66: 6099 str r1, [r3, #8]
20041f68 <dummy_read>:
20041f68: 491b ldr r1, [pc, #108] @ (20041fd8 <literals+0xc>)
20041f6a: 6019 str r1, [r3, #0]
20041f6c: 2100 movs r1, #0
20041f6e: 6059 str r1, [r3, #4]
20041f70: 491a ldr r1, [pc, #104] @ (20041fdc <literals+0x10>)
20041f72: 481b ldr r0, [pc, #108] @ (20041fe0 <literals+0x14>)
20041f74: 6001 str r1, [r0, #0]
20041f76: 2101 movs r1, #1
20041f78: 6099 str r1, [r3, #8]
20041f7a: 21eb movs r1, #235 @ 0xeb
20041f7c: 6619 str r1, [r3, #96] @ 0x60
20041f7e: 21a0 movs r1, #160 @ 0xa0
20041f80: 6619 str r1, [r3, #96] @ 0x60
20041f82: f000 f812 bl 20041faa <wait_ssi_ready>
20041f86: 2100 movs r1, #0
20041f88: 6099 str r1, [r3, #8]
20041f8a <configure_ssi>:
20041f8a: 4916 ldr r1, [pc, #88] @ (20041fe4 <literals+0x18>)
20041f8c: 4814 ldr r0, [pc, #80] @ (20041fe0 <literals+0x14>)
20041f8e: 6001 str r1, [r0, #0]
20041f90: 2101 movs r1, #1
20041f92: 6099 str r1, [r3, #8]
20041f94 <check_return>:
20041f94: bc01 pop {r0}
20041f96: 2800 cmp r0, #0
20041f98: d000 beq.n 20041f9c <vector_into_flash>
20041f9a: 4700 bx r0
20041f9c <vector_into_flash>:
20041f9c: 4812 ldr r0, [pc, #72] @ (20041fe8 <literals+0x1c>)
20041f9e: 4913 ldr r1, [pc, #76] @ (20041fec <literals+0x20>)
20041fa0: 6008 str r0, [r1, #0]
20041fa2: c803 ldmia r0, {r0, r1}
20041fa4: f380 8808 msr MSP, r0
20041fa8: 4708 bx r1
20041faa <wait_ssi_ready>:
20041faa: b503 push {r0, r1, lr}
20041fac: 6a99 ldr r1, [r3, #40] @ 0x28
20041fae: 2004 movs r0, #4
20041fb0: 4201 tst r1, r0
20041fb2: d0fb beq.n 20041fac <wait_ssi_ready+0x2>
20041fb4: 2001 movs r0, #1
20041fb6: 4201 tst r1, r0
20041fb8: d1f8 bne.n 20041fac <wait_ssi_ready+0x2>
20041fba: bd03 pop {r0, r1, pc}
20041fbc <read_flash_sreg>:
20041fbc: b502 push {r1, lr}
20041fbe: 6618 str r0, [r3, #96] @ 0x60
20041fc0: 6618 str r0, [r3, #96] @ 0x60
20041fc2: f7ff fff2 bl 20041faa <wait_ssi_ready>
20041fc6: 6e18 ldr r0, [r3, #96] @ 0x60
20041fc8: 6e18 ldr r0, [r3, #96] @ 0x60
20041fca: bd02 pop {r1, pc}
20041fcc <literals>:
20041fcc: 40020000 .word 0x40020000
20041fd0: 18000000 .word 0x18000000
20041fd4: 00070000 .word 0x00070000
20041fd8: 005f0300 .word 0x005f0300
20041fdc: 00002221 .word 0x00002221
20041fe0: 180000f4 .word 0x180000f4
20041fe4: a0002022 .word 0xa0002022
20041fe8: 10000100 .word 0x10000100
20041fec: e000ed08 .word 0xe000ed08

View File

@ -0,0 +1,23 @@
// Padded and checksummed version of: /home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2040/boot_stage2/bs2_default.bin
.cpu cortex-m0plus
.thumb
.section .boot2, "ax"
.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a

View File

@ -0,0 +1,6 @@
# This is a generated file and its contents are an internal implementation detail.
# The update step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
command=
work_dir=

View File

@ -0,0 +1,9 @@
# This is a generated file and its contents are an internal implementation detail.
# The download step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
method=source_dir
command=
source_dir=/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm
work_dir=

View File

@ -0,0 +1,7 @@
# This is a generated file and its contents are an internal implementation detail.
# The patch step will be re-executed if anything in this file changes.
# No other meaning or use of this file is supported.
command (connected)=
command (disconnected)=
work_dir=

View File

@ -0,0 +1,3 @@
set(PIOASM_EXTRA_SOURCE_FILES "" CACHE STRING "Initial cache" FORCE)
set(PIOASM_VERSION_STRING "2.2.0" CACHE STRING "Initial cache" FORCE)

View File

@ -0,0 +1 @@
cmd='/usr/bin/cmake;--no-warn-unused-cli;-DCMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake;-DPIOASM_FLAT_INSTALL=1;-DCMAKE_INSTALL_PREFIX=/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm-install;-DCMAKE_RULE_MESSAGES=OFF;-DCMAKE_INSTALL_MESSAGE=NEVER;-GUnix Makefiles;-C<TMP_DIR>/pioasmBuild-cache-$<CONFIG>.cmake;-S;<SOURCE_DIR><SOURCE_SUBDIR>;-B;<BINARY_DIR>'

View File

@ -0,0 +1,27 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake
# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an
# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it
# would cause a fatal error, even though it would be a no-op.
if(NOT EXISTS "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
file(MAKE_DIRECTORY "/home/ulysse-cura/.local/share/pico-sdk/tools/pioasm")
endif()
file(MAKE_DIRECTORY
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pioasm-install"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/tmp"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src"
"/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp"
)
set(configSubDirs )
foreach(subDir IN LISTS configSubDirs)
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp/${subDir}")
endforeach()
if(cfgdir)
file(MAKE_DIRECTORY "/home/ulysse-cura/Documents/Robotique/Junior 2025-2026/main_robot_2025-2026/program/motion controller code/build/pico-sdk/src/rp2_common/pico_cyw43_driver/pioasm/src/pioasmBuild-stamp${cfgdir}") # cfgdir has leading slash
endif()

View File

@ -0,0 +1 @@
FLASH(rx) : ORIGIN = 0x10000000, LENGTH = (2 * 1024 * 1024)

View File

@ -54,4 +54,9 @@ void servo_motor_zero(servo_motors_enum_t servo_motor);
// Set servo to its close pos if [close] else open pos
void servo_motor_set(servo_motors_enum_t servo_motor, bool close);
// Update motors from the data in the i2c buffer
void update_motors_from_buffer(void);
// Update servo motors from the data in the i2c buffer
void update_servo_motors_from_buffer(void);
#endif // MOTORS_H

View File

@ -1,7 +1,7 @@
#ifndef ROBOT_H
#define ROBOT_H
#include "i2c_buffer.h"
#include "i2c/headers/i2c_buffer.h"
typedef struct robot_t {
i2c_buffer_t i2c_buffer;

View File

@ -12,9 +12,5 @@ typedef struct i2c_buffer_t {
// I2c slave buffer handler for writing and reading data to the buffer
void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event);
// Update motors from the data in the i2c buffer
void update_motors_from_buffer(void);
// Update servo motors from the data in the i2c buffer
void update_servo_motors_from_buffer(void);
#endif // I2C_BUFFER_H

View File

@ -9,8 +9,8 @@
#include <hardware/i2c.h>
#define I2C_SLAVE_SDA_PIN 21
#define I2C_SLAVE_SCL_PIN 20
#define I2C_SLAVE_SDA_PIN 16
#define I2C_SLAVE_SCL_PIN 17
#define I2C_SLAVE_INSTANCE i2c0
#define I2C_SLAVE_ADDRESS 0x09
@ -20,19 +20,9 @@ typedef enum i2c_slave_event_t {
I2C_SLAVE_FINISH, // < Master has sent a Stop or Restart signal. Slave may prepare for the next transfer.
} i2c_slave_event_t;
static inline uint8_t i2c_slave_read_byte(void)
{
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
assert(hw->status & I2C_IC_STATUS_RFNE_BITS); // Rx FIFO must not be empty
return (uint8_t)hw->data_cmd;
}
uint8_t i2c_slave_read_byte(void);
static inline void i2c_slave_write_byte(uint8_t value)
{
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
assert(hw->status & I2C_IC_STATUS_TFNF_BITS); // Tx FIFO must not be full
hw->data_cmd = value;
}
void i2c_slave_write_byte(uint8_t byte);
// Init I2C with default parameters
void i2c_slave_init(void);

View File

@ -1,7 +1,7 @@
#include "include/i2c_buffer.h"
#include "headers/i2c_buffer.h"
#include "include/robot.h"
#include "include/motors.h"
#include "headers/robot.h"
#include "headers/motors.h"
void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event)
{
@ -36,23 +36,3 @@ void __not_in_flash_func(i2c_slave_buffer_handler)(i2c_slave_event_t event)
break;
}
}
void update_motors_from_buffer(void)
{
for(motors_enum_t actual_motor = MOTOR1; actual_motor < NB_MOTORS; actual_motor++)
{
const motor_def_t *motor_def = &MOTORS_DEFS[actual_motor];
motor_set(actual_motor, robot.i2c_buffer.buffer[motor_def->buffer_reg]);
}
}
void update_servo_motors_from_buffer(void)
{
for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
{
const servo_motor_def_t *servo_motor_def = &SERVO_MOTORS_DEFS[actual_servo_motor];
servo_motor_set(actual_servo_motor, robot.i2c_buffer.buffer[servo_motor_def->buffer_reg]);
}
}

View File

@ -4,14 +4,28 @@
* SPDX-License-Identifier: MIT
*/
#include "include/i2c_slave.h"
#include "headers/i2c_slave.h"
#include <pico/stdlib.h>
//#include <pico/stdlib.h>
#include <hardware/irq.h>
#include "include/i2c_buffer.h"
#include "headers/i2c_buffer.h"
static bool transfer_in_progress;
inline uint8_t i2c_slave_read_byte(void)
{
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
assert(hw->status & I2C_IC_STATUS_RFNE_BITS); // Rx FIFO must not be empty
return (uint8_t)hw->data_cmd;
}
inline void i2c_slave_write_byte(uint8_t byte)
{
i2c_hw_t *hw = i2c_get_hw(I2C_SLAVE_INSTANCE);
assert(hw->status & I2C_IC_STATUS_TFNF_BITS); // Tx FIFO must not be full
hw->data_cmd = byte;
}
static inline void finish_transfer(void)
{
if(transfer_in_progress)
@ -80,16 +94,16 @@ void i2c_slave_init(void)
hw->intr_mask = I2C_IC_INTR_MASK_M_RX_FULL_BITS | I2C_IC_INTR_MASK_M_RD_REQ_BITS | I2C_IC_RAW_INTR_STAT_TX_ABRT_BITS | I2C_IC_INTR_MASK_M_STOP_DET_BITS | I2C_IC_INTR_MASK_M_START_DET_BITS;
// enable interrupt for current core
uint num = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
irq_set_exclusive_handler(num, i2c_slave_irq_handler);
irq_set_enabled(num, true);
const uint IRQ_INDEX = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
irq_set_exclusive_handler(IRQ_INDEX, i2c_slave_irq_handler);
irq_set_enabled(IRQ_INDEX, true);
}
void i2c_slave_deinit(void)
{
uint num = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
irq_set_enabled(num, false);
irq_remove_handler(num, i2c_slave_irq_handler);
const uint IRQ_INDEX = I2C0_IRQ + i2c_get_index(I2C_SLAVE_INSTANCE);
irq_set_enabled(IRQ_INDEX, false);
irq_remove_handler(IRQ_INDEX, i2c_slave_irq_handler);
i2c_set_slave_mode(I2C_SLAVE_INSTANCE, false, 0);

View File

@ -9,7 +9,7 @@
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <stdbool.h>
#include "include/robot.h"
#include "headers/robot.h"
robot_t robot;

View File

@ -1,7 +1,8 @@
#include "include/motors.h"
#include "headers/motors.h"
#include <pico/stdlib.h>
#include <hardware/pwm.h>
#include <headers/robot.h>
const motor_def_t MOTORS_DEFS[] = {
{0, 4, 5, 0x00},
@ -117,3 +118,23 @@ void servo_motor_set(servo_motors_enum_t servo_motor, bool close)
// Set PWM to zero //
pwm_set_gpio_level(servo_motor_def->pwm_pin, close ? servo_motor_def->close_pos : servo_motor_def->open_pos);
}
void update_motors_from_buffer(void)
{
for(motors_enum_t actual_motor = MOTOR1; actual_motor < NB_MOTORS; actual_motor++)
{
const motor_def_t *motor_def = &MOTORS_DEFS[actual_motor];
motor_set(actual_motor, robot.i2c_buffer.buffer[motor_def->buffer_reg]);
}
}
void update_servo_motors_from_buffer(void)
{
for(servo_motors_enum_t actual_servo_motor = SERVO_MOTOR1; actual_servo_motor < NB_SERVO_MOTORS; actual_servo_motor++)
{
const servo_motor_def_t *servo_motor_def = &SERVO_MOTORS_DEFS[actual_servo_motor];
servo_motor_set(actual_servo_motor, robot.i2c_buffer.buffer[servo_motor_def->buffer_reg]);
}
}

View File

@ -1,15 +1,15 @@
#include "include/robot.h"
#include "headers/robot.h"
#include <pico/stdlib.h>
#include "include/motors.h"
#include "include/i2c_slave.h"
#include "headers/motors.h"
#include "i2c/headers/i2c_slave.h"
void robot_init(void)
{
stdio_init_all();
init_motors();
init_servo_motors();
//init_motors();
//init_servo_motors();
i2c_slave_init();
robot.is_running = true;
@ -17,7 +17,7 @@ void robot_init(void)
void robot_handle_inputs_outputs(void)
{
update_motors_from_buffer();
//update_motors_from_buffer();
}
void robot_deinit(void)

View File

@ -0,0 +1,23 @@
#!/usr/bin/env python3
import socket
import struct
def start_udp_server():
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp_socket.bind(('0.0.0.0', 12345))
print("Serveur UDP démarré sur le port 12345")
while True:
data = udp_socket.sendto()
"""
if len(data) == 2:
packet_num, instruction = struct.unpack('BB', data)
print(f"Reçu: packet_number={packet_num}, instruction={instruction}")
"""
if __name__ == '__main__':
start_udp_server()
#ulysse le femboy