Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Adafruit Logo
0

Turning your Raspberry Pi Zero into a USB Gadget

Image for user adafruit2
published December 24, 2015, last edited May 29, 2025
last major update April 22, 2024
Save Link Note Download
171
Beginner
Skill guide

Old Kernel Install

This is the older, no longer required technique - documented in case you need it!

Step 0. Download new Kernel Package

Download the following onto your desktop computer:

and rename itgadgetkernel.tgz

Step 1. Copy New Kernel to SD Card

Copy the new kernel file over to theboot directory of the Jessie Lite card. After you're done burning the SD image, don't eject it just yet. Drag thekernel.tgz file over to the SD card. This way you can ferry the kernel into your Pi without needing network

raspberry_pi_copykernel.png

Step 2. Log into your Pi Zero

Insert the SD into your Pi Zero, connect the console cable, power the Pi & log into via the USB console.

raspberry_pi_1login.png

Step 3. Uncompress new kernel package

Uncompress and install thekernel .tgz file

 run the following commands:

  • cd ~
  • sudo mv /boot/gadgetkernel.tgz .
  • tar -xvzf gadgetkernel.tgz
raspberry_pi_2untar.png

You'll see a long stream of file names ending withtmp/boot/kernel.img

You may see a bunch of complaints about timestamps being in the future, this is totally OK

Step 4. Backup and Install new Kernel

Run

  • sudo mv /boot/kernel.img /boot/kernelbackup.img

to make a backup of the current kernel. Now run

  • sudo mv tmp/boot/kernel.img /boot

You may see complaints about preserving ownership, you can ignore them

raspberry_pi_3install.png

Step 5. Install Overlays & Modules

Run the commands to install the new overlays & modules

  • sudo mv tmp/boot/overlays/* /boot/overlays
  • sudo mv tmp/boot/*dtb /boot
  • sudo cp -R tmp/boot/modules/lib/* /lib
raspberry_pi_4install.png
raspberry_pi_5modules.png

Gadget Serial!

Now we'll tell the Pi we want to use theg_serial module

Run

  • sudo nano /etc/modules

and addg_serial on a single line at the end, then save

raspberry_pi_gserialmod.png

Gadget Ethernet!

Now we'll tell the Pi we want to use theg_ether module

Run

  • sudo nano /etc/modules

and addg_ether on a single line at the end, then save

raspberry_pi_gethermod.png

Page last edited August 21, 2016

Text editor powered bytinymce.

Related Guides
Search

Search

Categories

[8]ページ先頭

©2009-2025 Movatter.jp