查看F1C的源代码
←
F1C
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== F1C100s Overview == * ARM926-EJS, up to 900MHz * 32KB I-Cache, 16KB D-Cache, 5-stage pipeline * 32MB SiP DDR1 (F1C200s is 64MB SiP DDR1) * RGB LCD interface * USB 2.0 OTG * SDIO * SPI x2 * TWI x3 * UART x3 * TV out x 1, TV in x 2 * PWM x2 * LRADC x1 * Speaker x2 + Mic x1 [[文件:F1C100s-blockdiagram.jpg | 700px]] <br><br> == Roadmap == [[文件:F1C-roadmap.png]] <br><br> == Pinmap == [[文件:F1C100s-pinmap.jpg | 650px]] <br> == Typical App == [[文件:F1C100s-typical-app.jpg]] <br> == Quick Start == === 荔枝派 Pin Map === [[文件:Lichee-nano-pin-map.png]] * SPI1 ** PA0 - SPI1_CS ** PA1 - SPI1_MOSI ** PA2 - SPI1_SCK ** PA3 - SPI1_MISO * USB ** 右上角,PCLK 右边为 USB_DM (D-) ** 右上角,PCLK 左边为 USB_DP (D+) https://fdvad021asfd8q.oss-cn-hangzhou.aliyuncs.com/migrate/Lichee_nano.pdf <br> === Toolchain === <source lang=bash> $ wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabi/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz $ tar -vxJf gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz $ git clone -b f1c100s-spiflash https://github.com/Icenowy/sunxi-tools.git $ cd sunxi-tools $ make && sudo make install </source> 如果出现:fel_lib.c:26:20: fatal error: libusb.h: No such file or directory,那需要安装libusb: sudo apt-get install libusb-1.0-0-dev sunxi-tools: 新到的一片 Nano ,基本上是上电无反应的,LCD亮但无内容,此时 Nano 自动进入fel下载模式,可以通过命令 sudo sunxi-fel ver 来确认有无成功进入fel模式。 此时有两种方式进行程序下载: <source lan=bash> # 1.以 uboot file-with-spl形式进行(单次运行,测试时个人推荐) $ sunxi-fel uboot /your/path/to/u-boot-sunxi-with-spl.bin # 请自行修改到本机地址 # 2.烧进 spi-flash (开机自启) $ sunxi-fel -p spiflash-write 0 /your/path/to/u-boot-sunxi-with-spl.bin # note: 重新烧录或重进fel模式时,请在上电时拉低SPI flash 的 CS引脚 # 查看芯片信息 $ sudo sunxi-fel ver AWUSBFEX soc=00001663(F1C100s) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000 # 列出所有芯片的信息 $ sudo sunxi-fel -l # 加载并执行 uboot 的 spl $ sudo sunxi-fel spl [文件名] # 把文件内容写入内存指定地址(-p 是显示写入进度) $ sudo sunxi-fel -p write [地址] [文件名] # 调用指定地址的函数 $ sudo sunxi-fel exec [地址] # 显示spiflash的信息 $ sudo sunxi-fel spiflash-info # 读取spiflash指定地址的数据并写入到文件 $ sudo sunxi-fel spiflash-read [地址] [长度] [存放数据的文件路径] # 写入指定文件的指定长度的内容到spiflash的指定地址 $ sudo sunxi-fel spiflash-write [地址] [长度] [存放数据的文件路径] </source> <br> ===U-Boot=== <source lang=bash> $ git clone https://github.com/Lichee-Pi/u-boot.git $ cd u-boot # 切换到 Nano 分支 $ git checkout nano-v2018.01 # 此处告知make采用arm-linux-gnueabi下的所有交叉编译工具,目标架构为Arm,设定各项默认配置为 nano 的spiflash支持版 # 若不带spi-flash的板子,请换成 licheepi_nano_defconfig $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- licheepi_nano_spiflash_defconfig </source> sudo apt-get install python-setuptools ===Linux Kernel=== <source lang=bash> $ git clone https://github.com/Icenowy/linux.git $ sudo vim /etc/hosts # 添加下面两行 192.30.253.112 github.com 151.101.73.194 github.global.ssl.fastly.net # 可自行通过dns检测网站检测github.global.ssl.fastly.net,更换为更快的ip地址 # 完整拉取linux极大,建议只拉取单层分支,减少等待时间: $ git clone --depth=1 -b f1c100s-480272lcd-test https://github.com/Icenowy/linux.git </source> .config: http://dl.sipeed.com/LICHEE/Nano/SDK/config http://nano.lichee.pro/_static/step_by_step/lichee_nano_linux.config <source lang=bash> $ make ARCH=arm menuconfig $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8 #请自行修改编译线程数 </source> <br> == Boot == After power-up, the F1C100s starts to fetch instructions from address 0xFFFF_0000 which is where the BROM is located at. It's an internal integrated 32 KB ROM Chip (Boot ROM or BROM). The BROM split up into two parts: The first part (at 0xFFFF_0000) is the FEL mode and the second is the eGON.BRM (located at 0xFFFF_4000). The reset vector is located at the very begining of FEL mode: at address 0xFFFF_0000. On reset, it jumps to 0xFFFF_0028 where it loads 0xFFFF_4000 (eGON.BRM) into the program counter to be executed next. === eGON Boot === The eGON Boot ROM performs a few tasks: # do some [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L19 co-processor setup] ([http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/Bgbciiaf.html c15], (virtual) System Control Coprocessor). # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L23 disables] the WatchDog Timer # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L28 setups] CPU, AXI, AHB and APB0 clocks # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L34 enables] AHB Gating # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L38 enables] APB0 Gating # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L40 sets] the Stack Pointer to 32K # then it [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L41 jumps] to [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L84 'boot'] which immediately [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L86 jumps to] [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L2551 check_uboot] # [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L2551 check_uboot] setups up some registers, then [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L2560 checks the status pin] (often called FEL pin, BSP pin or '''uboot''') ## if the pin is low (connected to GND) [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L90 executes] [[FEL]] mode at 0xFFFF_0020. ## If the pin is high it continues trying to boot from the following media and on failure continues to the next in order. ### [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L91 SD Card0] also known as [[A10/CCM#CCM_MMC0_CLK|MMC0]] ### [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L98 Internal NAND flash] also known as [[A10/CCM#CCM_NAND_CLK|NAND]] ### [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L104 SD Card2] also known as [[A10/CCM#CCM_MMC2_CLK|MMC2]] ### [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L111 SPI connected NOR flash] also known as [[A10/CCM#CCM_SPI0_CLK|SPI]] ### [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s##L117 If all fails], [[FEL/USBBoot|FEL/USB Boot]] mode is [https://github.com/hno/Allwinner-Info/blob/master/BROM/ffff4000.s#L120 executed] from 0xFFFF_0020 As can be seen, the SoC has several ways to boot and a lot would need to go wrong or 'fail' before entering [[FEL/USBBoot|FEL mode]]. This is especially important if there is a valid header in the NAND flash. Obviously this can be abused, by corrupting the header and thus forcing failure. If no other boot options are available, then FEL mode should be the final result. As a bypass mechanism, the A10 has the so called ''Boot Select Pin (BSP)''. This pin is normally internally pulled up by a 50KΩ resistor. If the pin is pulled low to GND, the A10 will try to boot into [[FEL/USBBoot|FEL mode]]. Otherwise the above boot-order will be tried. <source lang=bash> boot-> check fel key pressed (yes)--> FEL mode (boot from USB OTG) \ (no) \ \-------> 1) try to boot from SMHC0 (SD card) 2) try to boot from SMHC2 (eMMC) 3) try to boot from SPI0 (SPI NOR Flash) 4) FEL mode (boot from USB OTG) </source> === FEL mode === * 短接 flash 的 1、4 两脚,重新上电,上电后松开短接,即可重新进入 fel 模式 * 在启动到内核前,回车进入 uboot,执行 sf probe 0;sf erase 0 0x100000;reset 即可重新进入 fel 模式 <br> === Reference === * http://linux-sunxi.org/FEL * http://linux-sunxi.org/FEL/USBBoot * http://linux-sunxi.org/BROM * http://linux-sunxi.org/Sunxi-tools * http://nano.lichee.pro/get_started/first_eat.html#id6 * [https://whycan.cn/t_717.html F1C100s入坑记录] * [https://whycan.cn/t_3138.html 尝试从零构建F1C100s开发环境] <br> == Reference == * [http://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf F1C100s Datasheet 2015] * [http://dl.linux-sunxi.org/F1C100/Allwinner_F1C100_datasheet_20110331.pdf F1C100 Datasheet 2011] * [https://www.thirtythreeforty.net/media/Allwinner_F1C600_User_Manual_V1.0.pdf F1C600 User Manual] * [https://www.thirtythreeforty.net/posts/2019/12/my-business-card-runs-linux/businesscard.pdf Card Linux SCH] * [http://dl.linux-sunxi.org/H3/Allwinner_H3_Datasheet_V1.0.pdf H3 Datasheet] * [https://debugdump.com/files/20171005/13/Allwinner_V3s_Datasheet_V1.0.pdf V3S datasheet] [http://linux-sunxi.org/images/2/23/Allwinner_V3s_Datasheet_V1.0.pdf V3s datasheet] * http://nano.lichee.pro * http://tang.lichee.pro <br><br> <br><br> <br><br> <br><br>
返回到
F1C
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面