你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32MP157D-DK1-编译并运行第一个程序hello world

[复制链接]
LTLT 发布时间:2025-9-2 14:08

配置静态地址Ipv4

查看平台

uname -a 
cat /etc/os-release

查看网络是哪个管理的

 systemctl list-units --type=service | grep

查看网络具体由什么文件配置的

 networkctl status end0
* 2: end0
                   Link File: /usr/lib/systemd/network/99-default.link
                Network File: /usr/lib/systemd/network/80-wired.network
                       State: degraded (configuring)
                Online state: online
                        Type: ether
                        Path: platform-5800a000.ethernet
           Alternative Names: ethernet0
                              ethernet0.ethernet
            Hardware Address: 10:e7:7a:e1:85:cf (STMicrolectronics International NV)
                         MTU: 1500 (min: 46, max: 9000)
                       QDisc: mq
IPv6 Address Generation Mode: eui64
    Number of Queues (Tx/Rx): 8/8
            Auto negotiation: yes
                       Speed: 100Mbps
                      Duplex: full
                        Port: tp
                     Address: fe80::12e7:7aff:fee1:85cf
           Activation Policy: up
         Required For Online: yes
           DHCP6 Client DUID: DUID-EN/Vendor:0000ab112197d8406c94d1e2
                Connected To: n/a on port 00:e0:4c:36:00:15

Jan 08 18:23:03 stm32mp1-e1-85-cf (udev-worker)[432]: end0: Failed to get driver for 'end0': Device or resource busy
Jan 11 12:16:12 stm32mp1-e1-85-cf systemd-networkd[648]: end0: Configuring with /usr/lib/systemd/network/80-wired.network.
Jan 11 12:16:12 stm32mp1-e1-85-cf systemd-networkd[648]: end0: Link UP
Jan 11 12:16:14 stm32mp1-e1-85-cf systemd-networkd[648]: end0: Gained carrier
Jan 11 12:16:16 stm32mp1-e1-85-cf systemd-networkd[648]: end0: Gained IPv6LL

编辑配置文件并重启

 vi /usr/lib/systemd/network/80-wired.network

[Match]
Name=end0

[Network]
Address=172.30.0.10/24
Gateway=172.30.0.1
DNS=8.8.8.8

sudo systemctl restart systemd-networkd

编写代码并编译

#include <stdio.h>

int main() {
    printf("Hello, World!\n");
    return 0;
}

编译

$CC main.c

检查文件属性

file a.out 
a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=*******f, for GNU/Linux 5.15.0, with debug_info, not stripped

ssh连接并传输文件

1.png

总结

我使用ubuntu22.04 环境配置sdk,并编译程序,利用ssh方式传输文件到开发板上,其中将开发板的地址改为静态地址方便下次连接使用,网口使用的是usb 网卡 在windows环境下直接配置固定地址即可

收藏 评论0 发布时间:2025-9-2 14:08

举报

0个回答

所属标签

相似分享

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版