这些小活动你都参加了吗?快来围观一下吧!>>
电子产品世界 » 论坛首页 » 活动中心 » 板卡试用 » 【PocketBeagle2】一,开发环境准备

共2条 1/1 1 跳转至

【PocketBeagle2】一,开发环境准备

菜鸟
2025-09-17 00:31:09     打赏
【PocketBeagle2】一,开发环境准备

本次开发环境的搭建还是摸索了很久的,踩了很多坑,官方的教程中的镜像和最新的镜像有很多差异,比如

  • ssh:最新的镜像通过ssh<username>@192.168.7.2并不能直接连接开发板

  • 官方的教程中的镜像有两个usb设备,最新的只有一个·

  • 官方的教程中的镜像RAM total:0.35GB,最新的为0.41GB

我这里两个版本都试过,官方的教程中的镜像不推荐,缺失很多设备树插件,并且官方维护了。那我们就用最新的吧。

下载镜像

Latest Software Images - BeagleBoard

image-20250916233001367image-20250916233001367.png

选择最新的下载

image-20250916233514636image-20250916233514636.png

上面这句话一定要看,后面有大用(之前就是没有处理这个导致无法连接SSH的)

下载镜像烧录软件

这个有两款,链接如下,我推荐使用bb-imager-rs

bb-imager-rs:Releases · Ayush Singh / bb-imager-rs · GitLab

BalenaEtcher:balenaEtcher - Flash OS images to SD cards & USB drives

image-20250916234222346image-20250916234222346.png

根据自己的电脑版本选择

镜像烧写

image-20250911000640196image-20250911000640196.png

基本步骤如下:选择板卡,选择镜像,选择SD卡,直接WRITE

这里不需要去设置用户名密码之类的东西,因为这个修改根本就不起作用,直接烧录就行。

不需要如下操作

image-20250916235219263image-20250916235219263.png

然后安心的等待烧录失败,报错(这里我试过20多次,没有一次烧录成功,显示教程中烧录成功的内容,但是镜像可以正常跑起来)

如果出现以下报错,不必理会

image-20250914154504250image-20250914154504250.png

修改uboot下sysconf.txt文件,这个一定要烧录完修改,在开发板上修改是不起作用的

# This file will be automatically evaluated and installed at next boot
# time, and regenerated (to avoid leaking passwords and such information).
#
# To force it to be evaluated immediately, you can run (as root):
#
#     /usr/sbin/bbbio-set-sysconf
#
# You can disable the file evaluation by disabling the bbbio-set-sysconf
# service in systemd:
#
#     systemctl disable bbbio-set-sysconf
#
# Comments (all portions of a line following a '#' character) are
# ignored. This file is read line by line. Valid
# configuration lines are of the form 'key=value'. Whitespace around
# 'key' and 'value' is ignored. This file will be _regenerated_ every
# time it is evaluated.
#
# We follow the convention to indent with one space comments, and
# leave no space to indicate the line is an example that could be
# uncommented.

# root_password - Set a password for the root user (not used in ubuntu)
root_password=kone

# root_authorized_key - Set an authorized key for a root ssh login (not used in ubuntu)
#root_authorized_key=

# user_name - Set a user name for the user (1000)
user_name=kone

# user_password - Set a password for user (1000)
user_password=kone

# user_authorized_key - Set an authorized key for a user (1000) ssh login
#user_authorized_key=

# iwd_psk_file - Set a configuration for iwd https://wiki.archlinux.org/title/iwd
#iwd_psk_file=

# wifi_regdom - Country Code (ISO Alpha-2) Requests the country be set for the system.
#wifi_regdom=US

# hostapd_file - Set a configuration for hostapd https://wiki.gentoo.org/wiki/Hostapd
#hostapd_file=SoftAp0.conf

# hostname - Set the system hostname.
hostname=BeagleBone

# keymap - Set the system keymap.
keymap=us

# timezone - Set the system timezone.
timezone=America/Chicago

# usb_enable_dhcp - enable usb gadget to startup in dhcp mode, useful for Win/Mac with ICS enabled
usb_enable_dhcp=yes

# enable_ufw - enable ufw firewall (https://en.wikipedia.org/wiki/Uncomplicated_Firewall)
enable_ufw=yes

# ufw_allow_ssh - allow ssh access over port 22
ufw_allow_ssh=yes

# ufw_allow_http - allow http access over port 80
ufw_allow_http=yes

# ufw_allow_https - allow https access over port 443
ufw_allow_https=yes

# ufw_allow_nodered - allow nodered access over port 1880 (https://nodered.org/)
ufw_allow_nodered=yes

# ufw_allow_vscode - allow vscode access over port 3000 (https://github.com/coder/code-server)
ufw_allow_vscode=yes

# ufw_allow_vnc - allow vnc access over port 5901
ufw_allow_vnc=yes

# ufw_allow_cockpit - allow cockpit access over port 9090 (https://cockpit-project.org/)
ufw_allow_cockpit=yes

将SD插入开发板上电,可以看到已经正常工作起来了。

image-20250917000428864image-20250917000428864.png

这里SSH是不起作用的,串口也不起作用,只有USB可以用(这里应该是一个USB虚拟串口)通过MobaXterm工具进行连接

image-20250917000744480image-20250917000744480.png

image-20250917000804544image-20250917000804544.png

要想使用SSH,需要将开发板和电脑保持在统一网段。这里为了开发板可以连接外网,进行了网络共享。

image-20250917001524966image-20250917001524966.pngimage-20250917001536440.png

image-20250917001536440

查看开发板ip地址

sudo dhclient usb0
ifconfig

image-20250917001938740image-20250917001938740.png

在MobaXterm进行SSH连接,并且尝试连接外网ping baidu.com

image-20250917002109524image-20250917002109524.png

image-20250917002428971image-20250917002428971.png

可以看到ssh和连接外网已经成功。那个VSCode 网页地址同样也变了。



总结

新老镜像之间的差异还是很大的,推荐大家使用新版本。



院士
2025-09-17 15:10:44     打赏
2楼

还是很厉害的。

玩嵌入式就要多动手,Reference也只是参考而已。



共2条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册 ]