前言

基本过程为:uboot 启动后,通过命令将U盘的的文件读取到内存中,再通过uboot 的flash 写入命令将读取到内存中的升级文件写入到flash的固定位置。

(一)usb常用命令

uboot一般支持对usb的操作命令有:start,reset,stop,tree,info,storage,dev,part,read,write等。

Usage:
usb start - start (scan) USB controller
usb reset - reset (rescan) USB controller
usb stop [f] - stop USB [f]=force stop
usb tree - show USB device tree
usb info [dev] - show available USB devices
usb storage - show details of USB storage devices
usb dev [dev] - show or set current USB storage device
usb part [dev] - print partition table of one or all USB storage devices
usb read addr blk# cnt - read `cnt' blocks starting at block `blk#' to memory address `addr'
usb write addr blk# cnt - write `cnt' blocks starting at block `blk#' from memory address `addr'

1.usb start

Wisdom # usb start
(Re)start USB...
USB: scanning bus for devices...
2 USB Device(s) found
scanning bus for storage devices... iVendor 0 iProduct 0
iVendor 5E3 iProduct 727
ss->subclass : 0x6
usb_stor_get_info->1496,blksz:512
1 Storage Device(s) found
Wisdom #

2.usb tree

Wisdom # usb tree

Device Tree:
1 Hub (12 Mb/s, 0mA)
| OHCI Root Hub
|
+-2 Mass Storage (12 Mb/s, 500mA)
Generic USB Storage 000000000250

3.usb infor

Wisdom #
Wisdom # usb info
1: Hub, USB Revision 1.10
- OHCI Root Hub
- Class: Hub
- PacketSize: 8 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 0.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Setting 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms 2: Mass Storage, USB Revision 2.0
- Generic USB Storage 000000000250
- Class: (from Interface) Mass Storage
- PacketSize: 64 Configurations: 1
- Vendor: 0x05e3 Product 0x0727 Version 2.80
Configuration: 1
- Interfaces: 1 Bus Powered 500mA
Interface: 0
- Alternate Setting 0, Endpoints: 2
- Class Mass Storage, Transp. SCSI, Bulk only
- Endpoint 1 In Bulk MaxPacket 64
- Endpoint 2 Out Bulk MaxPacket 64

4.usb part

Wisdom # usb part
index: 0 Partition Map for USB device 0 -- Partition Type: DOS Partition Start Sector Num Sectors Type
1 8192 7618560 b
index: 1
Wisdom #
5.usb storage
Wisdom # usb storage
Device 0: Vendor: Generic Rev: 0250 Prod: STORAGE DEVICE
Type: Removable Hard Disk
Capacity: 3724.0 MB = 3.6 GB (7626752 x 512)
Wisdom #

(二)U盘升级操作

(1)usb start  开始usb 操作

Wisdom # usb start
(Re)start USB...
USB: scanning bus for devices...
2 USB Device(s) found
scanning bus for storage devices... iVendor 0 iProduct 0
iVendor 5E3 iProduct 727
ss->subclass : 0x6
usb_stor_get_info->1496,blksz:512
1 Storage Device(s) found

(2)fatls usb 0  查看usb 中的文件

Wisdom # fatls usb 0
index: 0
.trash-1000/
4.8.7/
5.9.0/
20190323/
dejavu/
fb/
install/
mouse/
qt_4.8_install/
rules.d/
935839 gui_test
727 profile
3671576 uidemo18
3190568 uimage 4 file(s), 10 dir(s) Wisdom #

(3)擦除内存中的一块空间用来放置升级文件:

将0x82000000开始的 4M空间填上0xFF

mw.b 82000000 ff 400000

(4)加载usb的升级文件到内存

fatload usb 0 0x82000000 uimage

(5)擦除flash中原来的数据

nand erase 100000 400000

(6)将内存中的升级文件写入到flash中去

nand write 82000000 100000 400000

(3)~(6)操作过程

Wisdom # mw.b 82000000 ff 400000
Wisdom # fatload usb 0 0x82000000 uimage
index: 0
########################################################################################################################################################################################## 3190568 bytes read
Wisdom # nand erase 100000 400000 NAND erase: device 0 offset 0x100000, size 0x400000
Erasing at 0x4e0000 -- 100% complete.
OK
Wisdom # nand write 82000000 100000 400000 NAND write: device 0 offset 0x100000, size 0x400000
4194304 bytes written: OK
Wisdom #

全部升级操作命令:

usb start
fatls usb 0
mw.b 82000000 ff 400000
fatload usb 0 0x82000000 uimage
nand erase 100000 400000
nand write 82000000 100000 400000



---------------------------End---------------------------
长按识别二维码
关注 liwen01 公众号

海思Hi35xx 通过uboot 读取U盘文件进行固件升级的更多相关文章

  1. 海思HI35xx平台软件开发快速入门之H264解码实例学习

    ref :https://blog.csdn.net/wytzsjzly/article/details/82500277   前言 H264视频编码技术诞生于2003年,至今已有十余载,技术相当成熟 ...

  2. 海思hi35xx 开发学习(3):视频输入

    视频输入(VI)模块实现的功能:通过 MIPI Rx(含 MIPI 接口.LVDS 接口和 HISPI 接口),SLVS-EC,BT.1120,BT.656,BT.601,DC 等接口接收视频数据.V ...

  3. FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台

    FFmpeg和SDL开发专栏(点击传送门) 上一篇:<FFmpeg开发笔记(九):ffmpeg解码rtsp流并使用SDL同步播放>下一篇:敬请期待   前言   将ffmpeg移植到海思H ...

  4. UWP访问KnownFolders.RemovableDevices时(读取U盘文件)抛出异常UnauthorizedAccessException

    读取U盘的文件时: StorageFile file = await folder.GetFileAsync("myfile.txt"); 抛出异常System.Unauthori ...

  5. 海思HI35XX之----视频处理单元各通道间的关系

    最近在折腾HI3518C的芯片,应用到IPCamera上,最终获取多路不同分辨率的视频流供不同需求的预览切换.此处简单记录一下视频前处理元VPSS(Video Process Sub-System)的 ...

  6. 海思hi35xx 开发学习(2):系统控制

    应用程序启动 MPP 业务前,必须完成 MPP 系统初始化工作.同理,应用程序退出MPP 业务后,也要完成 MPP 系统去初始化工作,释放资源. 视频缓存池 一组大小相同.物理地址连续的缓存块组成一个 ...

  7. 海思hi35xx 开发学习(1):海思媒体处理平台架构

    处理平台架构图: 主要分为: 视频输入(VI):VI 模块捕获视频图像,可对其做剪切.去噪等处理,并输出多路不同分辨率的图像数据. 视频处理(VPSS):VPSS 模块接收 VI 和解码模块发送过来的 ...

  8. OpenCV开发笔记(七十四):OpenCV3.4.1+ffmpeg3.4.8交叉编译移植到海思平台Hi35xx平台

    前言   移植opencv到海思平台,opencv支持对视频进行解码,需要对应的ffmpeg支持.   Ffmpeg的移植   Ffmpeg的移植请参考之前的文章:<FFmpeg开发笔记(十): ...

  9. 用vs2013+velt-0.1.4进行嵌入式开发 进行海思平台 UBOOT 开发

    1.1    什么是VELT VELT的全称是Visual EmbedLinuxTools,它是一个与visual gdb类似的visual studio插件,用以辅助完成Linux开发.利用这个插件 ...

  10. 海思uboot启动流程详细分析(二)

    1. 第二个start.S 从start_armboot开始,在startup.c中有包含#include <config.h> 在config.h中: /* Automatically ...

随机推荐

  1. TypeChat、JSONSchemaChat实战 - 让ChatGPT更听你的话

    TypeChat 用一句话概括,就是用了它你可以让大语言模型(比如 ChatGPT)将自然语言转换成特定类型的 JSON 数据. 我们在使用 ChatGPT 的时候,大致流程如下: 假如我们需要 Ch ...

  2. STM32CubeMX教程12 DMA 直接内存读取

    使用STM32CubeMX软件配置STM32F407开发板上串口USART1进行DMA传输数据,然后实现与实验"STM32CubeMX教程9 USART/UART 异步通信"相同的 ...

  3. 文心一言 VS 讯飞星火 VS chatgpt (23)-- 算法导论4.2 5题

    五.V.Pan 发现一种方法,可以用 132 464 次乘法操作完成 68 x 68 的矩阵相乘,发现另一种方法,可以用 143 640 次乘法操作完成 70 x 70 的矩阵相乘,还发现一种方法,可 ...

  4. PyTorch项目源码学习(2)——Tensor代码结构初步学习

    PyTorch版本:1.10.0 Tensor Tensor是Pytorch项目较为重要的一部分,其中的主要功能如存储,运算由C++和CUDA实现,本文主要从前端开始探索学习Tensor的代码结构. ...

  5. windows环境下如何优雅搭建ftp服务?

    目录 0. 前言 1.ftp简介 2.下载Apache FTPServer 3.下载并解压压缩包 4.修改配置文件 4.1 修改users.properties配置文件 4.2 修改ftpd-typi ...

  6. 揭秘华为云GaussDB(for Influx):最佳实践之数据建模

    摘要:本期将从GaussDB(for Influx)数据模型谈起,分享GaussDB(for Influx)数据建模的最佳方法,避免一些使用过程中的常见问题. 本文分享自华为云社区<华为云Gau ...

  7. 实践GoF的设计模式:单例模式

    摘要:单例模式虽然简单易用,但也是最容易被滥用的设计模式.它并不是"银弹",在实际使用时,还需根据具体的业务场景谨慎使用. 本文分享自华为云社区<[Go实现]实践GoF的23 ...

  8. 传统数据库改造难?华为云GaussDB“五心”解决

    摘要:快来看看华为云GaussDB奉上的"五心"诚意吧~ 本文分享自华为云社区<传统数据库改造难?华为云GaussDB"五心"解决>,作者: Gau ...

  9. 活动预告| 字节跳动基于DataLeap的DataOps最佳实践

    DataOps概念从2014年首次被提出,不断演化和发展,在2018 年Gartner 的数据管理成熟度曲线中确定了 DataOps,标志着 DataOps 被业界接纳和认可.随着数字化转型的推进以及 ...

  10. html jquery from 表单提交 application/x-www-form-urlencoded 改成 json

    html jquery from 表单提交 $(form).ajaxSubmit  application/x-www-form-urlencoded  改成 json 要使用 jQuery 根据 n ...