原厂开机画面

0.png

[野火]i.MX Linux开发实战指南 - [野火]i.MX Linux开发实战指南 文档

1.png

用户

# root
username: root
password: root

# normal
username: debian
password: temppwd

串口

2. 运行开发板与串口终端登录 - [野火]i.MX Linux开发实战指南 文档

SSH

ifconfig | grep 192
# inet 192.168.1.146  netmask 255.255.255.0  broadcast 192.168.1.255
#        inet 192.168.7.2  netmask 255.255.255.252  broadcast 192.168.7.3
#        TX packets 904  bytes 197373 (192.7 KiB)
fire-config # enable ssh
sudo apt install  avahi-daemon # npi hostname

Client

MobaXterm SSH

2.png

# ip address
ssh debian@192.168.0.xxx
# npi hostname
ssh debian@npi

刷新镜像

9. 烧录Debian镜像至SD卡 - [野火]i.MX Linux开发实战指南 文档

选择 “预览版”。

SD 卡启动后有一个 Linux Logo。

S.jpg

usb 口能虚拟个 u盘、串口、网卡出来

3.png

把boot分区做成u盘方便修改,特别是uEnv.txt文件,我们用它加载设备树

macOS U盘:

4.png

Windows 10:

5.png

6.png

网卡禁用数字签名

http://www.win10xiazai.com/win10/8148.html

RNDIS.rar

多出一个 Linux USB Ethernet

7.png

Window + R 打开设备管理器

devmgmt.msc

8.png

熟悉 EBF_6ULL 开发板

LED

#为方便使用echo命令修改系统文件,提升至root权限进行操作
#执行该命令后,再执行exit可退回普通用户
sudo -s

#在root权限下进行下列操作
#LED灯默认可能处于亮的状态,我们先把它们全部关闭再一盏盏点亮
echo 0 > /sys/class/leds/red/brightness      #关闭red灯
echo 0 > /sys/class/leds/blue/brightness     #关闭blue灯
echo 0 > /sys/class/leds/green/brightness    #关闭green灯
echo 255 > /sys/class/leds/red/brightness    #点亮red灯
echo 255 > /sys/class/leds/blue/brightness   #点亮blue灯
echo 255 > /sys/class/leds/green/brightness  #点亮green灯

脚本测试硬件

sudo apt update
sudo apt install peripheral
cd ~/peripheral
./led.sh

gcc & hello world

hello.c

#include <stdio.h>

int main(int argc, char *argv[]) {
	printf("Hello World!\n");
	return 0;
}

make

sudo apt install gcc make -y
gcc -v
# Using built-in specs.
# COLLECT_GCC=gcc
# COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
# Target: arm-linux-gnueabihf
make hello
# cc     hello.c   -o hello
./hello
Hello World!

readelf -h hello


ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x3fd
  Start of program headers:          52 (bytes into file)
  Start of section headers:          6976 (bytes into file)
  Flags:                             0x5000400, Version5 EABI, hard-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         9
  Size of section headers:           40 (bytes)
  Number of section headers:         29
  Section header string table index: 28

Linux 基础

Linux.png