환경에서 PICO_SDK_PATH를 설정하거나 -DPICO_SDK_PATH=/path/to/pico-sdk
사용하여 cmake에 전달해야 합니다. 서명이나 해싱과 같은 기능을 사용하려면 SDK의 mbedtls 하위 모듈이 체크아웃되어 있는지 확인해야 합니다. 이는 SDK 디렉터리에서 실행하여 수행할 수 있습니다.
git 하위 모듈 업데이트 --init lib/mbedtls
libusb-1.0
도 설치해야 합니다.
선호하는 패키지 도구를 사용하여 종속성을 설치하세요. 예를 들어 우분투에서는 다음과 같습니다.
sudo apt install build-essential pkg-config libusb-1.0-0-dev cmake
그런 다음 일반 CMake 프로젝트처럼 빌드하면 됩니다.
mkdir buildcd buildcmake ..make
Linux에서는 sudo 없이 picotool을 실행하기 위해 udev 규칙을 추가할 수 있습니다.
sudo cp udev/99-picotool.rules /etc/udev/rules.d/
여기 https://libusb.info/에서 libUSB를 다운로드하세요.
LIBUSB_ROOT 환경 변수를 설치 디렉터리로 설정합니다.
mkdir buildcd buildcmake -G "NMake Makefiles" ..nmake
여기 https://libusb.info/에서 libUSB를 다운로드하세요.
LIBUSB_ROOT 환경 변수를 설치 디렉터리로 설정합니다.
mkdir buildcd buildcmake ..make
libusb를 별도로 다운로드하거나 LIBUSB_ROOT
설정할 필요가 없습니다.
pacman -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,libusb}mkdir buildcd buildcmake .. -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIXcmake --build .
Raspberry Pi Pico SDK(pico-sdk) 버전 2.0.0 이상에서는 picotool
사용하여 이전에 SDK의 elf2uf2
도구로 처리했던 ELF-UF2 변환을 수행합니다. SDK는 또한 picotool
사용하여 바이너리를 해시하고 서명합니다.
SDK는 프로젝트별로 자체적으로 picotool을 다운로드할 수 있지만, 여러 프로젝트나 빌드 구성이 있는 경우 로컬에 picotool
의 단일 복사본을 설치하는 것이 좋습니다. 이 작업은 make install
또는 cmake --install .
; SDK는 기본적으로 이 설치된 버전을 사용합니다.
또는 다음을 통해 사용자 정의 경로에 설치할 수 있습니다.
cmake -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR -DPICOTOOL_FLAT_INSTALL=1 ..
SDK가 이 사용자 정의 경로에서 picotool
찾으려면 picotool_DIR
환경 변수를 설정하거나 -Dpicotool_DIR=$MY_INSTALL_DIR/picotool
cmake
명령에 전달하거나 추가하여 프로젝트에서 picotool_DIR
변수를 설정해야 합니다. set(picotool_DIR $MY_INSTALL_DIR/picotool)
.
picotool
은 RP2040/RP2350 바이너리로 작업하고 BOOTSEL 모드에 있는 RP2040/RP2350 장치와 상호 작용하기 위한 도구입니다. ( picotool
버전 1.1부터는 BOOTSEL 모드가 아니지만 picotool
의 -f
인수를 사용하여 Raspberry Pi Pico SDK의 USB stdio 지원을 사용하는 장치와 상호 작용할 수도 있습니다.)
추가 문서에 대한 참고 사항은 https://rptl.io/pico-get-started를 참조하세요.
$ picotool help PICOTOOL: Tool for interacting with RP2040/RP2350 device(s) in BOOTSEL mode, or with an RP2040/RP2350 binary SYNOPSIS: picotool info [-b] [-p] [-d] [--debug] [-l] [-a] [device-selection] picotool info [-b] [-p] [-d] [--debug] [-l] [-a] <filename> [-t <type>] picotool config [-s <key> <value>] [-g <group>] [device-selection] picotool config [-s <key> <value>] [-g <group>] <filename> [-t <type>] picotool load [-p] [-n] [-N] [-u] [-v] [-x] <filename> [-t <type>] [-o <offset>] [device-selection] picotool encrypt [--quiet] [--verbose] [--hash] [--sign] <infile> [-t <type>] [-o <offset>] <outfile> [-t <type>] <aes_key> [-t <type>] [<signing_key>] [-t <type>] picotool seal [--quiet] [--verbose] [--hash] [--sign] [--clear] <infile> [-t <type>] [-o <offset>] <outfile> [-t <type>] [<key>] [-t <type>] [<otp>] [-t <type>] [--major <major>] [--minor <minor>] [--rollback <rollback> [<rows>..]] picotool link [--quiet] [--verbose] <outfile> [-t <type>] <infile1> [-t <type>] <infile2> [-t <type>] [<infile3>] [-t <type>] [-p] <pad> picotool save [-p] [device-selection] picotool save -a [device-selection] picotool save -r <from> <to> [device-selection] picotool verify [device-selection] picotool reboot [-a] [-u] [-g <partition>] [-c <cpu>] [device-selection] picotool otp list|get|set|load|dump|permissions|white-label picotool partition info|create picotool uf2 info|convert picotool version [-s] [<version>] picotool coprodis [--quiet] [--verbose] <infile> [-t <type>] <outfile> [-t <type>] picotool help [<cmd>] COMMANDS: info Display information from the target device(s) or file. Without any arguments, this will display basic information for all connected RP2040 devices in BOOTSEL mode config Display or change program configuration settings from the target device(s) or file. load Load the program / memory range stored in a file onto the device. encrypt Encrypt the program. seal Add final metadata to a binary, optionally including a hash and/or signature. link Link multiple binaries into one block loop. save Save the program / memory stored in flash on the device to a file. verify Check that the device contents match those in the file. reboot Reboot the device otp Commands related to the RP2350 OTP (One-Time-Programmable) Memory partition Commands related to RP2350 Partition Tables uf2 Commands related to UF2 creation and status version Display picotool version coprodis Post-process coprocessor instructions in dissassembly files. help Show general help or help for a specific command Use "picotool help <cmd>" for more info
파일에 작동하지 않는 명령을 사용하려면 BOOTSEL 모드의 장치가 연결되어 있어야 합니다.
picotool
찾을 수 있는 압축 정보를 쉽게 저장할 수 있는 SDK의 바이너리 정보 지원입니다(아래 바이너리 정보 섹션 참조). info 명령은 이 정보를 읽기 위한 것입니다.
정보는 BOOTSEL 모드의 하나 이상의 연결된 장치 또는 파일에서 읽을 수 있습니다. 이 파일은 ELF, UF2 또는 BIN 파일일 수 있습니다.
$ picotool help info INFO: Display information from the target device(s) or file. Without any arguments, this will display basic information for all connected RP2040 devices in BOOTSEL mode SYNOPSIS: picotool info [-b] [-p] [-d] [--debug] [-l] [-a] [device-selection] picotool info [-b] [-p] [-d] [--debug] [-l] [-a] <filename> [-t <type>] OPTIONS: Information to display -b, --basic Include basic information. This is the default -p, --pins Include pin information -d, --device Include device information --debug Include device debug information -l, --build Include build attributes -a, --all Include all information TARGET SELECTION: To target one or more connected RP2040 device(s) in BOOTSEL mode (the default) --bus <bus> Filter devices by USB bus number --address <addr> Filter devices by USB device address --vid <vid> Filter by vendor id --pid <pid> Filter by product id --ser <ser> Filter by serial number -f, --force Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the command (unless the command itself is a 'reboot') the device will be rebooted back to application mode -F, --force-no-reboot Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the RPI-RP2 drive mounted To target a file <filename> The file name -t <type> Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
-f 인수는 Windows와 macOS/Unix 플랫폼에 따라 약간 다릅니다.
예를 들어
$ picotool info 프로그램 정보 이름: hello_world 기능: stdout to UART
$ picotool info -a Program Information name: hello_world features: stdout to UART binary start: 0x10000000 binary end: 0x1000606c Fixed Pin Information 20: UART1 TX 21: UART1 RX Build Information build date: Dec 31 2020 build attributes: Debug build Device Information flash size: 2048K ROM version: 2
$ picotool info -bp 프로그램 정보 이름: hello_world 기능: stdout to UART
고정 핀 정보 20: UART1 TX 21: UART1 RX
$ picotool info -a lcd_1602_i2c.uf2 File lcd_1602_i2c.uf2: Program Information name: lcd_1602_i2c web site: https://github.com/raspberrypi/pico-examples/tree/HEAD/i2c/lcd_1602_i2c binary start: 0x10000000 binary end: 0x10003c1c Fixed Pin Information 4: I2C0 SDA 5: I2C0 SCL Build Information build date: Dec 31 2020
Config를 사용하면 구성 가능한 경우 장치의 바이너리 정보를 구성할 수 있습니다. 특히 bi_ptr_int32
및 bi_ptr_string
구성할 수 있습니다.
$ picotool help config
CONFIG:
Display or change program configuration settings from the target device(s) or file.
SYNOPSIS:
picotool config [-s <key> <value>] [-g <group>] [device-selection]
picotool config [-s <key> <value>] [-g <group>] <filename> [-t <type>]
OPTIONS:
<key>
Variable name
<value>
New value
-g <group>
Filter by feature group
TARGET SELECTION:
To target one or more connected RP2040 device(s) in BOOTSEL mode (the default)
--bus <bus>
Filter devices by USB bus number
--address <addr>
Filter devices by USB device address
--vid <vid>
Filter by vendor id
--pid <pid>
Filter by product id
--ser <ser>
Filter by serial number
-f, --force
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be rebooted back to application mode
-F, --force-no-reboot
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the
RPI-RP2 drive mounted
To target a file
<filename>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
$ picotool config
n = 5
name = "Billy"
nonconst_pins:
default_pin = 3
default_name = "My First Pin"
$ picotool config -g nonconst_pins
nonconst_pins:
default_pin = 3
default_name = "My First Pin"
$ picotool config -s name Jane
name = "Billy"
setting name -> "Jane"
$ picotool config
n = 5
name = "Jane"
nonconst_pins:
default_pin = 3
default_name = "My First Pin"
load
하면 파일의 데이터를 장치에 쓸 수 있습니다(플래시 또는 RAM에 쓰기).
$ picotool help load
LOAD:
Load the program / memory range stored in a file onto the device.
SYNOPSIS:
picotool load [--ignore-partitions] [--family <family_id>] [-p <partition>] [-n] [-N] [-u] [-v] [-x] <filename> [-t <type>] [-o
<offset>] [device-selection]
OPTIONS:
Post load actions
--ignore-partitions
When writing flash data, ignore the partition table and write to absolute space
--family
Specify the family ID of the file to load
<family_id>
family id to use for load
-p, --partition
Specify the partition to load into
<partition>
partition to load into
-n, --no-overwrite
When writing flash data, do not overwrite an existing program in flash. If picotool cannot determine the size/presence of the
program in flash, the command fails
-N, --no-overwrite-unsafe
When writing flash data, do not overwrite an existing program in flash. If picotool cannot determine the size/presence of the
program in flash, the load continues anyway
-u, --update
Skip writing flash sectors that already contain identical data
-v, --verify
Verify the data was written correctly
-x, --execute
Attempt to execute the downloaded file as a program after the load
File to load from
<filename>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
BIN file options
-o, --offset
Specify the load address for a BIN file
<offset>
Load offset (memory address; default 0x10000000)
Target device selection
--bus <bus>
Filter devices by USB bus number
--address <addr>
Filter devices by USB device address
--vid <vid>
Filter by vendor id
--pid <pid>
Filter by product id
--ser <ser>
Filter by serial number
-f, --force
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be rebooted back to application mode
-F, --force-no-reboot
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the
RPI-RP2 drive mounted
예를 들어
$ picotool load blink.uf2
Loading into Flash: [==============================] 100%
save
사용하면 RAM 범위, 플래시의 프로그램 또는 장치의 명시적인 플래시 범위를 BIN 파일이나 UF2 파일에 저장할 수 있습니다.
$ picotool help save
SAVE:
Save the program / memory stored in flash on the device to a file.
SYNOPSIS:
picotool save [-p] [device-selection]
picotool save -a [device-selection]
picotool save -r <from> <to> [device-selection]
OPTIONS:
Selection of data to save
-p, --program
Save the installed program only. This is the default
-a, --all
Save all of flash memory
-r, --range
Save a range of memory. Note that UF2s always store complete 256 byte-aligned blocks of 256 bytes, and the range is expanded
accordingly
<from>
The lower address bound in hex
<to>
The upper address bound in hex
Source device selection
--bus <bus>
Filter devices by USB bus number
--address <addr>
Filter devices by USB device address
--vid <vid>
Filter by vendor id
--pid <pid>
Filter by product id
--ser <ser>
Filter by serial number
-f, --force
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be rebooted back to application mode
-F, --force-no-reboot
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the
RPI-RP2 drive mounted
File to save to
<filename>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
예를 들어 먼저 장치에 무엇이 있는지 살펴보십시오.
$ picotool info
Program Information
name: lcd_1602_i2c
web site: https://github.com/raspberrypi/pico-examples/tree/HEAD/i2c/lcd_1602_i2c
... 파일에 저장 중 ...
$ picotool save spoon.uf2
Saving file: [==============================] 100%
Wrote 51200 bytes to spoon.uf2
...파일을 살펴보면 다음과 같습니다.
$ picotool info spoon.uf2
File spoon.uf2:
Program Information
name: lcd_1602_i2c
web site: https://github.com/raspberrypi/pico-examples/tree/HEAD/i2c/lcd_1602_i2c
seal
하면 RP2350에서 실행할 바이너리에 서명 및/또는 해시할 수 있습니다.
기본적으로 바이너리에만 서명하지만 --hash
및 --no-sign
인수를 사용하여 구성할 수 있습니다.
서명 키는 PEM 형식의 secp256k1 곡선용이어야 합니다. 다음을 사용하여 .PEM 파일을 만들 수 있습니다.
openssl ecparam -name secp256k1 -genkey -out private.pem
$ picotool help seal
SEAL:
Add final metadata to a binary, optionally including a hash and/or signature.
SYNOPSIS:
picotool seal [--quiet] [--verbose] [--hash] [--sign] [--clear] <infile> [-t <type>] [-o <offset>] <outfile> [-t <type>] [<key>] [-t
<type>] [<otp>] [-t <type>] [--major <major>] [--minor <minor>] [--rollback <rollback> [<rows>..]]
OPTIONS:
--quiet
Don't print any output
--verbose
Print verbose output
--major <major>
Add Major Version
--minor <minor>
Add Minor Version
--rollback <rollback> [<rows>..]
Add Rollback Version
Configuration
--hash
Hash the file
--sign
Sign the file
--clear
Clear all of SRAM on load
File to load from
<infile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
BIN file options
-o, --offset
Specify the load address for a BIN file
<offset>
Load offset (memory address; default 0x10000000)
File to save to
<outfile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
Key file
<key>
The file name
-t <type>
Specify file type (pem) explicitly, ignoring file extension
File to save OTP to (will edit existing file if it exists)
<otp>
The file name
-t <type>
Specify file type (json) explicitly, ignoring file extension
encrypt
하면 RP2350에서 사용할 바이너리를 암호화하고 서명할 수 있습니다. 기본적으로 암호화된 바이너리에 서명하지만 picotool sign
과 유사하게 구성할 수 있습니다.
암호화된 바이너리는 다음과 같은 구조를 갖습니다:
첫 번째 메타데이터 블록(5단어)
IV (4단어)
암호화된 바이너리
암호화된 길이가 4단어의 배수인지 확인하기 위한 패딩
서명 메타데이터 블록
AES 키는 암호화에 사용할 256비트 AES 키의 .bin 파일로 제공되어야 합니다.
$ picotool help encrypt
ENCRYPT:
Encrypt the program.
SYNOPSIS:
picotool encrypt [--quiet] [--verbose] [--hash] [--sign] <infile> [-t <type>] [-o <offset>] <outfile> [-t <type>] <aes_key> [-t <type>]
[<signing_key>] [-t <type>]
OPTIONS:
--quiet
Don't print any output
--verbose
Print verbose output
Signing Configuration
--hash
Hash the encrypted file
--sign
Sign the encrypted file
File to load from
<infile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
BIN file options
-o, --offset
Specify the load address for a BIN file
<offset>
Load offset (memory address; default 0x10000000)
File to save to
<outfile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
AES Key
<aes_key>
The file name
-t <type>
Specify file type (bin) explicitly, ignoring file extension
Signing Key file
<signing_key>
The file name
-t <type>
Specify file type (pem) explicitly, ignoring file extension
partition
명령을 사용하면 RP2350 장치의 파티션 테이블과 상호 작용하고 생성할 수도 있습니다.
$ picotool help partition info
PARTITION INFO:
Print the device's partition table.
SYNOPSIS:
picotool partition info -m <family_id> [device-selection]
OPTIONS:
-m <family_id> [device-selection]
$ picotool partition info
un-partitioned_space : S(rw) NSBOOT(rw) NS(rw), uf2 { absolute }
partitions:
0(A) 00002000->00201000 S(rw) NSBOOT(rw) NS(rw), id=0000000000000000, "A", uf2 { rp2350-arm-s, rp2350-riscv }, arm_boot 1, riscv_boot 1
1(B w/ 0) 00201000->00400000 S(rw) NSBOOT(rw) NS(rw), id=0000000000000001, "B", uf2 { rp2350-arm-s, rp2350-riscv }, arm_boot 1, riscv_boot 1
$ picotool partition info -m rp2350-arm-s
un-partitioned_space : S(rw) NSBOOT(rw) NS(rw), uf2 { absolute }
partitions:
0(A) 00002000->00201000 S(rw) NSBOOT(rw) NS(rw), id=0000000000000000, "A", uf2 { rp2350-arm-s, rp2350-riscv }, arm_boot 1, riscv_boot 1
1(B w/ 0) 00201000->00400000 S(rw) NSBOOT(rw) NS(rw), id=0000000000000001, "B", uf2 { rp2350-arm-s, rp2350-riscv }, arm_boot 1, riscv_boot 1
Family id 'rp2350-arm-s' can be downloaded in partition 0:
00002000->00201000
이 명령을 사용하면 파티션 테이블을 생성하고 ELF 파일(예: 부트로더용)인 경우 이를 블록 루프에 추가로 포함할 수 있습니다. 기본적으로 모든 파티션 테이블은 해시되며 서명할 수도 있습니다.
$ picotool help partition create
PARTITION CREATE:
Create a partition table from json
SYNOPSIS:
picotool partition create [--quiet] [--verbose] <infile> [-t <type>] <outfile> [-t <type>] [[-o <offset>] [--family <family_id>]]
[<bootloader>] [-t <type>] [[--sign <keyfile>] [-t <type>] [--no-hash] [--singleton]] [[--abs-block] [<abs_block_loc>]]
OPTIONS:
--quiet
Don't print any output
--verbose
Print verbose output
partition table JSON
<infile>
The file name
-t <type>
Specify file type (json) explicitly, ignoring file extension
output file
<outfile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
UF2 output options
-o, --offset
Specify the load address for UF2 file output
<offset>
Load offset (memory address; default 0x10000000)
--family
Specify the family if for UF2 file output
<family_id>
family id for UF2 (default absolute)
embed partition table into bootloader ELF
<bootloader>
The file name
-t <type>
Specify file type (elf) explicitly, ignoring file extension
Partition Table Options
--sign <keyfile>
The file name
-t <type>
Specify file type (pem) explicitly, ignoring file extension
--no-hash
Don't hash the partition table
--singleton
Singleton partition table
Errata RP2350-E9 Fix
--abs-block
Enforce support for an absolute block
<abs_block_loc>
absolute block location (default to 0x10ffff00)
uf2
명령은 UF2 생성을 허용하고, UF2 다운로드가 실패한 경우 cam은 정보를 제공합니다.
이 명령은 이전에 Raspberry Pi Pico SDK에 있던 elf2uf2 기능을 대체합니다. 가족 ID를 자동 감지하려고 시도하지만 실패할 경우 --family
인수를 사용하여 수동으로 지정할 수 있습니다.
picotool help uf2 convert
UF2 CONVERT:
Convert ELF/BIN to UF2.
SYNOPSIS:
picotool uf2 convert [--quiet] [--verbose] <infile> [-t <type>] <outfile> [-t <type>] [-o <offset>] [--family <family_id>]
[[--abs-block] [<abs_block_loc>]]
OPTIONS:
--quiet
Don't print any output
--verbose
Print verbose output
File to load from
<infile>
The file name
-t <type>
Specify file type (uf2 | elf | bin) explicitly, ignoring file extension
File to save UF2 to
<outfile>
The file name
-t <type>
Specify file type (uf2) explicitly, ignoring file extension
Packaging Options
-o, --offset
Specify the load address
<offset>
Load offset (memory address; default 0x10000000 for BIN file)
UF2 Family options
<family_id>
family id for UF2
Errata RP2350-E9 Fix
--abs-block
Add an absolute block
<abs_block_loc>
absolute block location (default to 0x10ffff00)
이 명령은 UF2 다운로드가 실패한 이유에 대한 장치의 정보를 읽습니다. 가장 최근의 다운로드가 실패한 경우에만 정보를 제공합니다.
$ picotool help uf2 info
UF2 INFO:
Print info about UF2 download.
SYNOPSIS:
picotool uf2 info [device-selection]
OPTIONS:
Target device selection
--bus <bus>
Filter devices by USB bus number
--address <addr>
Filter devices by USB device address
--vid <vid>
Filter by vendor id
--pid <pid>
Filter by product id
--ser <ser>
Filter by serial number
-f, --force
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be rebooted back to application mode
-F, --force-no-reboot
Force a device not in BOOTSEL mode but running compatible code to reset so the command can be executed. After executing the
command (unless the command itself is a 'reboot') the device will be left connected and accessible to picotool, but without the
RPI-RP2 drive mounted
otp
명령은 RP2350 OTP 메모리와 상호 작용하기 위한 것입니다. RP2040에는 OTP가 없으므로 RP2040 장치에서는 사용할 수 없습니다.
OTP 메모리는 일회성 프로그래밍이 가능합니다. 즉, 비트가 0에서 1로 변경되면 다시 변경할 수 없습니다. 따라서 이러한 명령을 사용할 때는 RP2350 장치가 손상될 위험이 있으므로 주의해야 합니다. 예를 들어, SECURE_BOOT_ENABLE을 설정했지만 부팅 키를 설정하지 않고 PICOBOOT 인터페이스를 비활성화하면 장치를 사용할 수 없게 됩니다.
list
, set
, get
및 load
명령의 경우 JSON 파일에서 고유한 OTP 레이아웃을 정의하고 -i
인수를 사용하여 전달할 수 있습니다. 이러한 행은 구문 분석 시 기본 행에 추가됩니다.
$ picotool help otp
OTP:
Commands related to the RP2350 OTP (One-Time-Programmable) Memory
SYNOPSIS:
picotool otp list [-p] [-n] [-i <filename>] [<selector>..]
picotool otp get [-c <copies>] [-r] [-e] [-n] [-i <filename>] [device-selection] [-z] [<selector>..]
picotool otp set [-c <copies>] [-r] [-e] [-i <filename>] [-z] <selector> <value> [device-selection]
picotool otp load [-r] [-e] [-s <row>] [-i <filename>] <filename> [-t <type>] [device-selection]
picotool otp dump [-r] [-e] [device-selection]
picotool otp permissions <filename> [-t <type>] [--led <pin>] [--hash] [--sign] [<key>] [-t <type>] [device-selection]
picotool otp white-label -s <row> <filename> [-t <type>] [device-selection]
SUB COMMANDS:
list List matching known registers/fields
get Get the value of one or more OTP registers/fields (RP2350 only)
set Set the value of an OTP row/field (RP2350 only)
load Load the row range stored in a file into OTP and verify. Data is 2 bytes/row for ECC, 4 bytes/row for raw. (RP2350 only)
dump Dump entire OTP (RP2350 only)
permissions Set the OTP access permissions (RP2350 only)
white-label Set the white labelling values in OTP (RP2350 only)
이 명령은 OTP의 특정 행을 설정/가져옵니다. 기본적으로 모든 중복 행을 쓰거나 읽지만 -c
인수로 재정의할 수 있습니다.
이 명령을 사용하면 다양한 OTP 행을 장치에 로드할 수 있습니다. 소스는 바이너리 파일이거나 picotool sign
의 출력과 같은 JSON 파일일 수 있습니다. 예를 들어, 바이너리에 서명하고 보안 부팅을 테스트하려는 경우 다음 명령 세트를 실행할 수 있습니다.
$ picotool sign hello_world.elf hello_world.signed.elf private.pem otp.json
$ picotool load hello_world.signed.elf
$ picotool otp load otp.json
$ picotool reboot
이 명령은 BOOTSEL 모드에서 장치가 사용하는 USB 구성을 설정하는 OTP 화이트 라벨링을 허용합니다. 이는 JSON 파일에서 구성할 수 있으며 그 예는 Sample-wl.json에 있습니다.
<cod