Raspberry Pi boot: for MAC

Source: Internet
Author: User

Raspberry Pi launches Laboratory equipment:

Hardware preparation:

实验主板一块(树莓派);5V/1A电源一个(手机电源);microUSB线一根;USB-TTL串口线一根(FT232RL芯片或PL2303芯片)。PC一台(Mac OS);路由器

Software Requirements:

PC上的USB-TTL串口线配套的驱动程序PC上的串口终端软件:minicomPC上的SSH软件(Mac自带)交叉编译软件  
Experimental steps:

Hardware preparation:

连接串口线:串口线黑线接地,白线接GPIO14,绿线接GPIO15,如下:


Power supply supplied by mobile phone power supply

下载一个img文件:[https://www.raspberrypi.org/downloads]插入SD卡到电脑上,将img文件写到SD卡中使用df –h 命令查看所有的挂载设备:

为树莓派准备的SD卡的设备名为disk2s1利用dd 命令安装镜像:`sudo dd bs=4m if=2016-02-26-raspbian-jessie.img of=/dev/disk2s1`

1. Install serial port driver and serial terminal software

安装串口驱动:登陆PL2303官网:[http://www.prolific.com.tw/]下载Mac OS平台的驱动,并安装,安装完成后重新启动。安装串口驱动软件minicom:1、在网上下载对应的版本的MacPorts并安装2、在~/.bash_profile文件中添加环境变量:


Install the minicom in the terminal execution: sudo port installl minicom

At this point, the serial port driver and the serial terminal software is installed successfully.

2. Power up the Pcduina to record the output of the start-up process

1、  在命令行输入`sudo minicom -s`启动程序,选择serial port setup,按照进行配置:

2、回车,修改主菜单里的Modem and dialing选项,把A、B、K三个选项的字符删空,再回车,选择主菜单中的save setup as dfl3、重新进入命令行,输入minicom之后,进入minicom,插上电源,显示开机信息如下(包含解释):Uncompressing Linux... done, booting the kernel.   //解压Linux核心系统                            [    0.000000] Booting Linux on physical CPU 0x0  //加载核心CPU指令集,并初始化CPU                             [    0.000000] Initializing cgroup subsys cpuset                               [    0.000000] Initializing cgroup subsys cpu                                  [    0.000000] Initializing cgroup subsys cpuacct                              [    0.000000] Linux version 4.1.18+ ([email protected]) (gcc version 4.9.3 (c6[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cd[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instrue[    0.000000] Machine model: Raspberry Pi Model B Rev 2 //打印系统信息  .........................Raspbian GNU/Linux 8 raspberrypi ttyAMA0  

3. Get hardware data from Linux

输入用户名和密码,登陆树莓派:树莓派初始用户名和密码。用户名:pi  密码:raspberry


Among them, the clock frequency can be calculated by CPU MIPS.

4, configure the network, and from both sides of the Pcduino and PC to prove that the network is connected well

从终端登陆树莓派,配置网络:利用网线,将树莓派和路由器连接起来:进入192.168.1.1查看已经连接的设备(因为在这里使用的是别人的路由器,而他的路由器和Mac地址绑定,所以在我的电脑上不能打开192.168.1.1 网页),但是可以通过ifconfig命令查看树莓派绑定的 ip 地址:

在树莓派端证明网络已经连接成功,在树莓派端输入:ping www.baidu.com

在PC 端证明网络已经连接,在PC 端输入: ping 192.168.1.105

5, see a number of different ports landing, and run the Linux write to communicate


6. Select and install the cross-compilation environment on the PC

下载ARM GNU Linux编译工具链:[https://github.com/downloads/UnhandledException/ARMx/ARMx-2009q3-67.tar.bz2]------------------------------------------由于Mac系统默认对于大小写不敏感,因此需要新建一个对大小写敏感的磁盘映像。------------------------------------------新建磁盘映像,利用Mac自带的磁盘工具新建磁盘映像

解压工具链到磁盘映像,命令如下:`tar –zx –C / Volumes/disk/ --skip-components 1 –f ARMx-2009q3-67.tar.bz2`编译文件:创建一个文件:hello.c
#include<stdio.h>int main(){    printf("Hello World!");    return0;}
编译文件:`/Volumes/disk/bin/arm-none-linux-gnueabi-gcc hello.c -o hello`查看文件:ls –l

7. Upload with SCP

利用scp上传(这个和上面的是不在一个路由器上做的,做一这里树莓派绑定的IP地址不一样)输入sudo scp hello [email protected]:~/homework2

查看是否上传成功:ls

8, try to remotely access the embedded card graphics desktop from the PC: VNC

安装远程桌面:(通过VNC)安装Mac版本的VNC:(http://www.realvnc.com/products/vnc/documentation/5.0/installing-removing/macosx)通过SSH连接树莓派在树莓派下下载远程桌面服务器(利用tightvncserver)安装:sudo apt-get install tightvncserver开启tightvncserver并找到远程桌面号:1(这里是1)

在vnc server框中输入树莓派的 ip:远程桌面号

选择continue,然后输入密码后就可以登陆了。

Raspberry Pi Boot: for MAC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.