nand flash 启动坏块,有了解过的吗?

海思3531a的板子 nand flash启动。
启动日志大致如下:
Check Flash Memory Controller v100 ... Found
Check Nand Flash Controller v610 ... found
Special NAND id table Version 1.38
Nand ID: 0x2C 0xDA 0x90 0x95 0x06 0x00 0x00 0x00
Block:128KB Page:2KB Chip:256MB*1 OOB:64B ECC:4bit/512
Nand total size: 256MB
*** Warning - bad CRC or NAND, using default environment
...
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing unused kernel memory: 172K (c05bf000 - c05ea000)
Welcome to HiLinux.
...
系统启动后,输入dmesg
~ # dmesg
yaffs: checking block 1692 bad
yaffs: checking block 1693 bad
yaffs: checking block 1694 bad
...
yaffs: checking block 1998 bad
yaffs: checking block 1999 bad
yaffs: yaffs_read_super: is_checkpointed 0
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing unused kernel memory: 172K (c05bf000 - c05ea000)

udev[702]: starting version 164
Hisilicon Media Memory Zone Manager
...
有的时候启动只提示以下异常:
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
yaffs: yaffs: Attempting MTD mount of 31.2,"mtdblock2"
yaffs: checking block 0 bad
yaffs: checking block 822 bad
yaffs: yaffs_read_super: is_checkpointed 1
VFS: Mounted root (yaffs2 filesystem) on device 31:2.
Freeing unused kernel memory: 172K (c05bf000 - c05ea000)
udev[702]: starting version 164

进入uboot,输入指令 nand bad

nand bad

Device 0 bad blocks

请问这种情况的坏块,可能是那些因素导致的?
希望了解过的指导下,万分感谢!

1个回答

qq_15623245
转角遇见miss 海思通过nand flash启动是ok的,我纳闷的是uboot检测为无坏块,但进入文件系统后却有坏块的现象.
4 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
nand flash 转变 nor flash
求 nand flash 变成 nor flash 方法
操作系统在NAND FLASH上的分布问题 mtd给上层文件系统提供的接口
1.操作系统在NAND FLASH上的顺序排布: uboot, kernel image, filesystem image;是否存在其它的顺序:如:将nand flash 格式化成一个ext3文件系统,kernel镜像作为一个普通文件放入ext3文件系统中。 2. MTD给上层文件系统提供的接口是什么
用mini2440开发板学习嵌入式,发现开发板下载内核后启动报错,求知道和帮助
![图片说明](https://img-ask.csdn.net/upload/202002/15/1581767164_504923.jpg)![图片说明](https://img-ask.csdn.net/upload/202002/15/1581767177_81059.jpg) 用的mini2440开发板,跟着视频一步一步学习,下载了uboot是正常的。按照教学,该下载Linux内核了,由于开发板网口可能坏了,于是选择从surpervivi中下载linux内核,nor启动,surpervivi下载内核正常后。从nand启动,就报错了,无论是我自己编译的内核还是官方自带的Image,启动后都报错,在网上百度搜索也快一周了,始终没能解决,希望有会的大神或者志同道合的朋友一起交流交流
使用FPGA操作nand flash rb信号一直不拉底,为什么???
之前用的是镁光的NAND FLASH,换上东芝的后就工作不正常了镁光的型号是:29F4G08ABADA 东芝的型号是:TC58TEG5DCJTA00 两者有什么区别在控制器上???? 换上东芝的flash之后 R/B信号一直为高,不拉底。。。 flash没有响应 想知道问题出在哪里?
STM32 NAND U盘 FATFS 存储不能读取
最近再弄一个STM32加128M NAND FLASH加FATFS的存储系统,然后可以通过USB读取NAND,发现存储的数据接近800-800K,电脑就不能再读取,需要格式化,不知道什么问题
am335x 裸机程序加载到nand
我通过两种方式可以将代码在板子上运行: 1、采用SecureCRT调试工具,通过Xmodem发送 :\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\am335x\evmskAM335x\bootloader处的boot.bin文件,然后发送自己修改例程里的TurnLED.bin。成功实现将程序烧写到DDR3当中运行。 2、采用:\ti\AM335X_StarterWare_02_00_00_07\tools\sd_format 中的工具制作SD卡,拷贝\ti\AM335X_StarterWare_02_00_00_07\binary\armv7a\cgt_ccs\am335x\evmskAM335x\bootloader 中的MLO文件和自己编写程序app(将TurnLED.bin修改为app);成功实现程序从SD卡拷贝到RAM中运行。 现在我的问题是想实现:采用SecureCRT调试工具,发送boot.bin文件,将接下来发送的用户程序加载到nand flash中,并从nand flash中读取程序,我用IAR打开官方boot文件,添加工程能够实现编译并生成bin文件,现在想问如何修改boot,实现上述功能。 void ImageCopy(void) { #if defined(SPI) if (SPIBootCopy( ) != true) BootAbort(); #elif defined(MMCSD) MMCSDBootCopy(); #elif defined(UART) UARTPuts("\nI am UART! :\n", -1); if (UARTBootCopy() != true) BootAbort(); #elif defined(NAND) UARTPuts("\nI am NAND! :\n", -1); if (NANDBootCopy() != true) BootAbort(); #else #error Unsupported boot mode !! #endif }请问此处的代码宏定义在哪里?找了半天没找到。麻烦大家帮我看一下,先谢谢了。
友善之臂mini2440 运行uart裸板程序失败
用的板子是友善之臂mini2440,自己学习韦东山的一期视频,在写uart裸板程序时发现怎么都无法实现功能 s3c2440.h ``` /* GPIO寄存器 */ #define GPBCON (*(volatile unsigned int*)0x56000010) #define GPGCON (*(volatile unsigned int*)0x56000060) #define GPHCON (*(volatile unsigned int*)0x56000070) #define GPBDAT (*(volatile unsigned int*)0x56000014) #define GPGDAT (*(volatile unsigned int*)0x56000064) #define GPHUP (*(volatile unsigned int*)0x56000078) /* UART寄存器 */ #define UCON0 (*(volatile unsigned int*)0x50000004) #define UBRDIV0 (*(volatile unsigned int*)0x50000004) #define ULCON0 (*(volatile unsigned int*)0x50000028) #define UTRSTAT0 (*(volatile unsigned int*)0x50000010) #define UTXH0 (*(volatile unsigned char*)0x50000020) #define URXH0 (*(volatile unsigned char*)0x50000024) #define UFCON0 (*(volatile unsigned int*)0x50000008) #define UMCON0 (*(volatile unsigned int*)0x5000000C) #define UCON1 (*(volatile unsigned int*)0x50004004) #define UBRDIV1 (*(volatile unsigned int*)0x50004028) #define ULCON1 (*(volatile unsigned int*)0x50004000) #define UTRSTAT1 (*(volatile unsigned int*)0x50004010) #define UTXH1 (*(volatile unsigned char*)0x50004020) #define URXH1 (*(volatile unsigned char*)0x50004024) #define UFCON1 (*(volatile unsigned int*)0x50004008) #define UMCON1 (*(volatile unsigned int*)0x5000400C) ``` uart.h ``` #ifndef _UART_H #define _UART_H void uart0_init(); int putchar(int c); int getchar(void); int puts(const char *s); #endif ``` uart.c ``` #include "s3c2440.h" /* 设置引脚用于串口 */ void uart0_init() { GPHCON &= ~((3<<8)|(3<<10)); //清空GPH2,GPH3 GPHCON |= ((2<<8)|(2<<10)); //GPH4,GPH5用于TXD1,RXD1 GPHUP &= ~((1<<4)|(1<<5)); //使能内部上拉 UFCON0 = 0x00; //不使用FIFO UMCON0 = 0x00; //不使用流控 ULCON0 = 0x00000003; //设置数据格式8n1:8位数据位,无校验位,1停止位 UCON0 = 0x00000005; //PCLK,中断/查询模式 UBRDIV0 = 26; //设置波特率 115200 } int putchar(int c) { while(!(UTRSTAT0) & (1<<2)) UTXH0 = (unsigned char)c; } int getchar(void) { while(!(UTRSTAT0) & (1<<0)) return URXH0; } int puts(const char *s) { while(*s) { putchar(*s); s++; } } ``` main.c ``` #include "s3c2440.h" #include "uart.h" int main(void) { unsigned char c; uart0_init(); puts("hello,world!\n"); while(1) { c = getchar(); putchar(c); } return 0; } ``` start.S ``` .text .global _start _start: /*设置内存:sp 栈*/ ldr sp,=4096 /*nand启动*/ /* 关闭看门狗 */ ldr r0, =0x53000000 ldr r1, =0 str r1, [r0] /* 设置CPU工作于异步模式 */ mrc p15,0,r0,c1,c0,0 orr r0,r0,#0xc0000000 //R1_nF:OR:R1_iA mcr p15,0,r0,c1,c0,0 /* 设置MPLL,FCLK */ /* CLKDIVN(0x4c000014) = 0x5 */ ldr r0, =0x4c000014 ldr r1, =0x5 /* HCLK = FCLK/4 = 100 MHz , PCLK = HCLK/2 = 50MHz */ str r1, [r0] /* 设置MPLLCON(0x4c000004) = (92<<12)|(1<<4)|(1<<0) FCLK = 400 MHz*/ ldr r0, =0x4c000004 ldr r1, =(92<<12)|(1<<4)|(1<<0) str r1,[r0] /*调用main*/ bl main halt: b halt ``` Makefile ``` all: arm-linux-gcc -c -o uart.o uart.c arm-linux-gcc -c -o main.o main.c arm-linux-gcc -c -o start.o start.S arm-linux-ld -Ttext 0 start.o uart.o main.o -o uart.elf arm-linux-objcopy -O binary -S uart.elf uart.bin arm-linux-objdump -D uart.elf > uart.dis clean: rm *.bin *.o *.elf *.dis ``` 程序写完后扔到虚拟机里编译生成.bin文件,之后用友善之臂自己编写的下载工具进行烧写 ![图片说明](https://img-ask.csdn.net/upload/202001/07/1578379644_335442.png) 之后选择nand启动,连接串口,并没有看到返回字符串hello,world! 特来请教
提高CPU主频,出现bbt错误:bad eraseblock 2 at 0x00020000
请教一下: 本人提高CPU主频,出现nand flash的bbt错误,是什么原因? 例如:CPU工作在379M的时候,分频后EMIF的时钟为189Mhz,nand正常; 可是CPU主频提升到495Mhz,分频后EMIF的时钟为247Mhz,就出现bad eraseblock 的错误,是内核报的。 从现象看,是EMIF的频率太高了? 可是CPU对EMIF的分频系数是固定的,改不了,我想知道nand 控制器有相关配置吗?或者EMIF有相关的配置吗? 或者是nand flash本身对读写频率有限制? 万分感谢~~~
hisi3516DV300 uboot无法烧入emmc
启动后的信息 System startup Uncompress Ok! U-Boot 2016.11 (Jan 10 2019 - 18:22:48 +0800)hi3516dv300 Relocation Offset is: 0f6c3000 Relocating to 8fec3000, new gd at 8fe22ef0, sp at 8fe22ed0 SPI Nor: Boot Media isn't SPI Nor NAND: Check Flash Memory Controller v100 ... Found SPI Nand ID Table Version 2.7 Warning: Wait SPI nand ready timeout, status: 0xff Cannot found a valid SPI Nand Device 0 MiB MMC: In: serial Out: serial Err: serial Net: eth0 Warning: eth0 (eth0) using random MAC address - 1a:10:e6:2c:f0:58 Hit any key to stop autoboot: 0 ## Error: "distro_bootcmd" not defined hisilicon # 保存环境信息也无法保存
uboot如何定位kernel image, kernel如何定位根文件系统的起始位置。
i. 操作系统在NAND FLASH上的顺序排布: uboot, kernel image, filesystem image; uboot如何定位kernel image, kernel如何定位根文件系统的起始位置。
nand操作时page_size = 2048;
您好,我想咨询一下,page_size = 2048; 这个是指的什么啊?页的大小是不是都是512的大小啊?还有就是nandll_read_page函数,copy2ddr函数的含义可以解释一下吗?
2440 sdram 运行程序问题
我按照韦东山的教程,做sdram驱动,然后程序从sram拷贝到sdram里运行时,程序就出现问题了,同样的led流水灯程序,在下载到nand flash后就可以正常运行,在加载到sdram后就不行了。有高手能帮忙解决解决吗??
linux内核编译时出错 求大佬指导
root@yu-virtual-machine:/opt/linux-2.6.32# make scripts/kconfig/conf -s arch/mips/Kconfig CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm -> include/asm-mips CALL scripts/checksyscalls.sh CHK include/linux/compile.h GEN usr/initramfs_data.cpio AS usr/initramfs_data.o LD usr/built-in.o CC drivers/mtd/nand/nand_base.o drivers/mtd/nand/nand_base.c: In function 'nand_scan_tail': drivers/mtd/nand/nand_base.c:2821: error: implicit declaration of function 'pr_warn' scripts/Makefile.build:229: recipe for target 'drivers/mtd/nand/nand_base.o' failed make[3]: *** [drivers/mtd/nand/nand_base.o] Error 1 scripts/Makefile.build:365: recipe for target 'drivers/mtd/nand' failed make[2]: *** [drivers/mtd/nand] Error 2 scripts/Makefile.build:365: recipe for target 'drivers/mtd' failed make[1]: *** [drivers/mtd] Error 2 Makefile:878: recipe for target 'drivers' failed make: *** [drivers] Error 2 求大佬指导
关于s5pv210的uboot启动
.word 0x2000为什么要加这句呢,只有这句在第一句话的时候才会启动成功, .word 0x2000可以 .word 0 .word 0x2000 .word 0 .word 不行 之前我是把.word 0x2000看成是当前的运行地址是0x2000,因为a8启动时,会加载它内部 的代码去判断是sd卡启动还是Nand启动,我之前的想法是,可能那段代码是占0x2000 所以要这样的写法,但是在第三种情况不行的情况下,就觉得不是这个意思。。求大神解答
UBOOT 设置环境变量重启后失效,恢复了默认设置,提示Warning - bad CRC, using default environment
问题如下: ``` System startup Uncompress Ok! U-Boot 2016.11 (Sep 19 2019 - 15:42:22 +0800)hi3518ev300 Relocation Offset is: 03736000 Relocating to 43f36000, new gd at 43e95ef0, sp at 43e95ed0 SPI Nor: hifmc_ip_ver_check(44): Check Flash Memory Controller v100 ...hifmc_ip_ver_check(50): Found hifmc_spi_nor_probe(1615): SPI Nor ID Table Version 1.0 hifmc_spi_nor_probe(1640): SPI Nor(cs 0) ID: 0xc2 0x20 0x18 hifmc_spi_nor_probe(1705): Block:64KB hifmc_spi_nor_probe(1706): Chip:16MB hifmc_spi_nor_probe(1707): Name:"MX25L128XX" hifmc100_spi_nor_probe(147): SPI Nor total size: 16MB NAND: 0 MiB MMC: *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: No ethernet found. Hit any key to stop autoboot: 0 ## Error: "distro_bootcmd" not defined hisilicon # ``` 设置了 bootcmd 后saveenv,提示成功,重启后又这样了,该怎么搞,uboot新手
全志A40I按power键死机
全志A40I使用的是Android7系统,内核Linux3.10.65。使用的WiFi是AP6236 按power键出现死机。log打印如下: a40-boardcon:/ # [ 1422.126312] [DISP] disp_lcd_pwm_enable,line:1079:pwm device hdl is NULL [ 1422.164875] disp_runtime_idle [ 1422.700248] PM: suspend entry 2019-11-29 03:26:13.193275785 UTC [ 1422.706769] [pm]valid [ 1422.709253] PM: Syncing filesystems ... done. [ 1422.715960] PM: Preparing system for mem sleep [ 1422.723091] Freezing user space processes ... [ 1422.728251] last active wakeup source: eventpoll [ 1422.733714] [ 1422.735340] Freezing of tasks aborted after 0.005 seconds [ 1422.741380] Restarting tasks ... done. [ 1422.746143] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746184] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746214] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.746242] sunxi-mmc 1c0f000.sdmmc: smc 1 p0 err, cmd 7, RTO !! [ 1422.747082] sdioh_remove: Enter [ 1422.747088] dhdsdio_disconnect : no mutex held. set lock [ 1422.747095] bcmsdh_oob_intr_unregister: Enter [ 1422.747097] bcmsdh_oob_intr_unregister: irq is not registered [ 1422.747104] dhd_wlfc_deinit():3301, Already disabled! [ 1422.752940] PM: suspend exit 2019-11-29 03:26:13.245966118 UTC [ 1422.910357] dhd_detach(): thread:dhd_watchdog_thread:6a6 terminated OK [ 1422.917576] dhd_detach(): thread:dhd_rxf:6a8 terminated OK [ 1422.923968] dhd_dpc_thread: Unexpected up_cnt 0 [ 1422.929081] dhd_detach(): thread:dhd_dpc:6a7 terminated OK [ 1422.936715] wl_event_handler: was terminated [ 1422.941637] wl_destroy_event_handler(): thread:wl_event_handler:6a4 terminated OK [ 1423.250136] dhd_os_prealloc: failed to alloc memory, section: 7, size: 0bytes [ 1423.258093] dhdsdio_disconnect : the lock is released. [ 1423.264114] Unable to handle kernel paging request at virtual address 6b6b6b6b [ 1423.272328] pgd = c0004000 [ 1423.275320] [6b6b6b6b] *pgd=00000000 [ 1423.279270] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 1423.282261] Modules linked in: sunxi_ir_rx gt9xxnew_ts bcm_btlpm bcmdhd xin_ncm r8152 ttyxin gpio_sunxi mali(O) nand(O) [ 1423.282261] CPU: 2 PID: 23224 Comm: kworker/u8:0 Tainted: G W O 3.10.65 #64 [ 1423.282261] Workqueue: kmmcd mmc_rescan [ 1423.282261] task: cc88dac0 ti: e0110000 task.ti: e0110000 [ 1423.282261] PC is at sdio_claim_host+0x30/0x40 [ 1423.282261] LR is at sdioh_detach+0x6c/0xac [bcmdhd] [ 1423.282261] pc : [<c0491fac>] lr : [<bf10db64>] psr: 20070013 [ 1423.282261] sp : e0111da0 ip : e0111db0 fp : e0111dac [ 1423.282261] r10: e484b414 r9 : 00000000 r8 : e41f89d8 [ 1423.282261] r7 : 00000000 r6 : bf16e400 r5 : e3d78b40 r4 : e431e000 [ 1423.282261] r3 : 6b6b6b6b r2 : e0111d40 r1 : 40070013 r0 : e4321800 [ 1423.282261] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 1423.282261] Control: 10c5387d Table: 638e006a DAC: 00000015 [ 1423.282261] [ 1423.282261] PC: 0xc0491f2c: [ 1423.282261] 1f2c 05932354 13e00015 01821001 05831354 e89da800 e1a0c00d e92dd800 e24cb004 [ 1423.282261] 1f4c e92d4000 e8bd4000 e3500000 1a000000 e7f001f2 e5903000 e3530000 1a000000 [ 1423.282261] 1f6c e7f001f2 e5933000 e59301cc e89da800 e1a0c00d e92dd800 e24cb004 e92d4000 [ 1423.282261] 1f8c e8bd4000 e3500000 1a000000 e7f001f2 e5903000 e3530000 1a000000 e7f001f2 [ 1423.282261] 1fac e5930000 e3a01000 ebffce29 e89da800 e1a0c00d e92dd810 e24cb004 e24dd00c [ 1423.282261] 1fcc e92d4000 e8bd4000 e3500000 e1a0c002 e1a04003 1a000000 e7f001f2 e24230f0 [ 1423.282261] 1fec e353000f 9a000007 e5903000 e593318c e3130001 1a000003 e3540000 13e03015 [ 1423.282261] 200c 15843000 ea000008 e3a02000 e58d1000 e58d2004 e3a01001 e5900000 e1a0300c [ 1423.282261] [ 1423.282261] SP: 0xe0111d20: [ 1423.282261] 1d20 00000000 e4196a28 40070013 c06d2544 e0111d4c e0111d40 c0491fac 20070013 [ 1423.282261] 1d40 ffffffff e0111d8c e0111dac e0111d58 c06d2fd8 c000a168 e4321800 40070013 [ 1423.282261] 1d60 e0111d40 6b6b6b6b e431e000 e3d78b40 bf16e400 00000000 e41f89d8 00000000 [ 1423.282261] 1d80 e484b414 e0111dac e0111db0 e0111da0 bf10db64 c0491fac 20070013 ffffffff [ 1423.282261] 1da0 e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] 1dc0 bf10ff34 bf10db04 e4321608 e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 [ 1423.282261] 1de0 c0490ac4 e4321608 bf16e400 c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 [ 1423.282261] 1e00 e432163c e4321608 e0111e2c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 [ 1423.282261] [ 1423.282261] IP: 0xe0111d30: [ 1423.282261] 1d30 e0111d4c e0111d40 c0491fac 20070013 ffffffff e0111d8c e0111dac e0111d58 [ 1423.282261] 1d50 c06d2fd8 c000a168 e4321800 40070013 e0111d40 6b6b6b6b e431e000 e3d78b40 [ 1423.282261] 1d70 bf16e400 00000000 e41f89d8 00000000 e484b414 e0111dac e0111db0 e0111da0 [ 1423.282261] 1d90 bf10db64 c0491fac 20070013 ffffffff e0111dc4 e0111db0 bf10db64 c0491f88 [ 1423.282261] 1db0 00000000 e431e000 e0111ddc e0111dc8 bf10ff34 bf10db04 e4321608 e4321600 [ 1423.282261] 1dd0 e0111dfc e0111de0 c0490b0c bf10fe04 c0490ac4 e4321608 bf16e400 c0b6c880 [ 1423.282261] 1df0 e0111e14 e0111e00 c0324d90 c0490ad0 e432163c e4321608 e0111e2c e0111e18 [ 1423.282261] 1e10 c0324e04 c0324d10 e4321608 e4991ab0 e0111e4c e0111e30 c03248c4 c0324de4 [ 1423.282261] [ 1423.282261] FP: 0xe0111d2c: [ 1423.282261] 1d2c c06d2544 e0111d4c e0111d40 c0491fac 20070013 ffffffff e0111d8c e0111dac [ 1423.282261] 1d4c e0111d58 c06d2fd8 c000a168 e4321800 40070013 e0111d40 6b6b6b6b e431e000 [ 1423.282261] 1d6c e3d78b40 bf16e400 00000000 e41f89d8 00000000 e484b414 e0111dac e0111db0 [ 1423.282261] 1d8c e0111da0 bf10db64 c0491fac 20070013 ffffffff e0111dc4 e0111db0 bf10db64 [ 1423.282261] 1dac c0491f88 00000000 e431e000 e0111ddc e0111dc8 bf10ff34 bf10db04 e4321608 [ 1423.282261] 1dcc e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 c0490ac4 e4321608 bf16e400 [ 1423.282261] 1dec c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 e432163c e4321608 e0111e2c [ 1423.282261] 1e0c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 e0111e4c e0111e30 c03248c4 [ 1423.282261] [ 1423.282261] R0: 0xe4321780: [ 1423.282261] 1780 00000000 00000002 02d00000 0000a9a6 00000200 00000080 000007d0 00000001 [ 1423.282261] 17a0 00000000 00000000 00000000 e3d788c0 00000000 00000000 00000000 00000000 [ 1423.282261] 17c0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 17e0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 1800 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1820 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1840 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 1860 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] [ 1423.282261] R2: 0xe0111cc0: [ 1423.282261] 1cc0 c0485d44 c0485b6c 00000000 e0111d14 00000000 00000000 00000000 00020002 [ 1423.282261] 1ce0 e0111ce0 e0111ce0 c0485b40 00000000 00000000 e4196800 00000400 e0111d97 [ 1423.282261] 1d00 e0111d6c e0111d10 c0490454 c0485cd4 e0111d34 00000034 00000400 c00507a0 [ 1423.282261] 1d20 00000000 e4196a28 40070013 c06d2544 e0111d4c e0111d40 c0491fac 20070013 [ 1423.282261] 1d40 ffffffff e0111d8c e0111dac e0111d58 c06d2fd8 c000a168 e4321800 40070013 [ 1423.282261] 1d60 e0111d40 6b6b6b6b e431e000 e3d78b40 bf16e400 00000000 e41f89d8 00000000 [ 1423.282261] 1d80 e484b414 e0111dac e0111db0 e0111da0 bf10db64 c0491fac 20070013 ffffffff [ 1423.282261] 1da0 e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] [ 1423.282261] R4: 0xe431df80: [ 1423.282261] df80 00000000 e42e9c80 c003d488 00000000 e431dfac e431dfa0 c003d4b8 c003d328 [ 1423.282261] dfa0 00000000 e431dfb0 c000fa78 c003d494 00000000 00000000 00000000 00000000 [ 1423.282261] dfc0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] dfe0 00000000 00000000 00000000 00000000 00000013 00000000 00001040 00001008 [ 1423.282261] e000 e3d78b40 e3d78ac0 00000000 00000000 00000000 00000000 00000000 00010100 [ 1423.282261] e020 00000000 00000040 00000040 00000080 00000000 00000000 00000000 00000000 [ 1423.282261] e040 00000002 00001070 00001070 00001000 00001038 00000000 00000000 00000000 [ 1423.282261] e060 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] [ 1423.282261] R5: 0xe3d78ac0: [ 1423.282261] 8ac0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 8ae0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b a56b6b6b [ 1423.282261] 8b00 000004e8 00000000 00000000 00000000 00000000 00000001 5a5a5a5a 5a5a5a5a [ 1423.282261] 8b20 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a a55a5a5a [ 1423.282261] 8b40 00000001 00000000 00000000 00000000 00000000 00000000 1234abcd e4321608 [ 1423.282261] 8b60 00000000 00000003 e3d78b00 e3d78ac0 00000000 5a5a5a5a 5a5a5a5a a55a5a5a [ 1423.282261] 8b80 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b [ 1423.282261] 8ba0 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b 6b6b6b6b a56b6b6b [ 1423.282261] [ 1423.282261] R8: 0xe41f8958: [ 1423.282261] 8958 00000000 e41f8944 00000000 e4853f10 e4853f10 00000000 e41f8970 e41f8970 [ 1423.282261] 8978 e41f8978 e41f8978 e433d840 ffffffff 00000000 c0a743bc e49bcb00 00000000 [ 1423.282261] 8998 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 89b8 00000000 00000000 00000000 e484b550 e4196a3c c0488298 e4873900 00000000 [ 1423.282261] 89d8 e41f89d8 e41f89d8 cc88dac0 e484b400 0001b691 00000081 00000000 73756c66 [ 1423.282261] 89f8 3a302d68 00003132 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 8a18 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 8a38 00000000 00000000 f00003fa 0000416d 00000002 00000000 00000000 00000000 [ 1423.282261] [ 1423.282261] R10: 0xe484b394: [ 1423.282261] b394 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3b4 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3d4 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a 5a5a5a5a [ 1423.282261] b3f4 5a5a5a5a 5a5a5a5a a55a5a5a 15be15be ffffffff ffffffff 00000008 00000004 [ 1423.282261] b414 e484b414 e484b414 00000004 00000003 e48f3ec0 cef7c940 e490e85c e490e85c [ 1423.282261] b434 0001c900 e490e001 c003e478 e484b400 ffffffff ffffffff 00000000 00000000 [ 1423.282261] b454 00000000 00000000 00000000 00000000 00200200 000153ac e48ea000 c003e690 [ 1423.282261] b474 e484b400 ffffffff ffffffff 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] Process kworker/u8:0 (pid: 23224, stack limit = 0xe0110240) [ 1423.282261] Stack: (0xe0111da0 to 0xe0112000) [ 1423.282261] 1da0: e0111dc4 e0111db0 bf10db64 c0491f88 00000000 e431e000 e0111ddc e0111dc8 [ 1423.282261] 1dc0: bf10ff34 bf10db04 e4321608 e4321600 e0111dfc e0111de0 c0490b0c bf10fe04 [ 1423.282261] 1de0: c0490ac4 e4321608 bf16e400 c0b6c880 e0111e14 e0111e00 c0324d90 c0490ad0 [ 1423.282261] 1e00: e432163c e4321608 e0111e2c e0111e18 c0324e04 c0324d10 e4321608 e4991ab0 [ 1423.282261] 1e20: e0111e4c e0111e30 c03248c4 c0324de4 00000011 e4321608 e3c24408 000000b9 [ 1423.282261] 1e40: e0111e6c e0111e50 c03222ec c03247f8 00000001 e4321608 e4196800 000000b9 [ 1423.282261] 1e60: e0111e84 e0111e70 c0490f3c c03221e0 00000002 00000001 e0111ea4 e0111e88 [ 1423.282261] 1e80: c048fee8 c0490f1c e4196800 ffffff92 e41969e8 c07640a0 e0111ebc e0111ea8 [ 1423.282261] 1ea0: c0490000 c048fea8 e4196a3c e4196800 e0111ee4 e0111ec0 c0488350 c048ff20 [ 1423.282261] 1ec0: e41f89c0 e484b400 e4873900 e4196a3c e41f89d8 e484b414 e0111f24 e0111ee8 [ 1423.282261] 1ee0: c0040a8c c04882a4 c0b8f2e8 e41f89c0 e484b400 00000000 e0110000 e41f89c0 [ 1423.282261] 1f00: e484b400 c0b8f2e8 e0110000 e41f89d8 e484b400 e484b414 e0111f5c e0111f28 [ 1423.282261] 1f20: c0040ec4 c00407e8 00000000 e41f89c0 c0040c8c e4151e6c 00000000 e41f89c0 [ 1423.282261] 1f40: c0040c8c 00000000 00000000 00000000 e0111fac e0111f60 c00470ec c0040c98 [ 1423.282261] 1f60: c06d259c 00000000 e0111f94 e41f89c0 00000000 00000000 e0111f78 e0111f78 [ 1423.282261] 1f80: 00000000 00000000 e0111f88 e0111f88 e4151e6c c0047030 00000000 00000000 [ 1423.282261] 1fa0: 00000000 e0111fb0 c000fa78 c004703c 00000000 00000000 00000000 00000000 [ 1423.282261] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1423.282261] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ffa38ad1 ffa38ad1 [ 1423.282261] [<c0491fac>] (sdio_claim_host+0x30/0x40) from [<bf10db64>] (sdioh_detach+0x6c/0xac [bcmdhd]) [ 1423.282261] [<bf10db64>] (sdioh_detach+0x6c/0xac [bcmdhd]) from [<bf10ff34>] (bcmsdh_sdmmc_remove+0x13c/0x174 [bcmdhd]) [ 1423.282261] [<bf10ff34>] (bcmsdh_sdmmc_remove+0x13c/0x174 [bcmdhd]) from [<c0490b0c>] (sdio_bus_remove+0x48/0x100) [ 1423.282261] [<c0490b0c>] (sdio_bus_remove+0x48/0x100) from [<c0324d90>] (__device_release_driver+0x8c/0xd4) [ 1423.282261] [<c0324d90>] (__device_release_driver+0x8c/0xd4) from [<c0324e04>] (device_release_driver+0x2c/0x38) [ 1423.282261] [<c0324e04>] (device_release_driver+0x2c/0x38) from [<c03248c4>] (bus_remove_device+0xd8/0xe8) [ 1423.282261] [<c03248c4>] (bus_remove_device+0xd8/0xe8) from [<c03222ec>] (device_del+0x118/0x17c) [ 1423.282261] [<c03222ec>] (device_del+0x118/0x17c) from [<c0490f3c>] (sdio_remove_func+0x2c/0x38) [ 1423.282261] [<c0490f3c>] (sdio_remove_func+0x2c/0x38) from [<c048fee8>] (mmc_sdio_remove+0x4c/0x78) [ 1423.282261] [<c048fee8>] (mmc_sdio_remove+0x4c/0x78) from [<c0490000>] (mmc_sdio_detect+0xec/0x114) [ 1423.282261] [<c0490000>] (mmc_sdio_detect+0xec/0x114) from [<c0488350>] (mmc_rescan+0xb8/0x474) [ 1423.282261] [<c0488350>] (mmc_rescan+0xb8/0x474) from [<c0040a8c>] (process_one_work+0x2b0/0x474) [ 1423.282261] [<c0040a8c>] (process_one_work+0x2b0/0x474) from [<c0040ec4>] (worker_thread+0x238/0x348) [ 1423.282261] [<c0040ec4>] (worker_thread+0x238/0x348) from [<c00470ec>] (kthread+0xbc/0xc8) [ 1423.282261] [<c00470ec>] (kthread+0xbc/0xc8) from [<c000fa78>] (ret_from_fork+0x14/0x20) [ 1423.282261] Code: e5903000 e3530000 1a000000 e7f001f2 (e5930000) [ 1424.510507] ---[ end trace a20d4dd70782290e ]--- [ 1424.515606] Kernel panic - not syncing: Fatal exception [ 1424.521496] CPU0: stopping [ 1424.524463] CPU: 0 PID: 1726 Comm: logd.klogd Tainted: G D W O 3.10.65 #64 [ 1424.530021] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.530021] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.530021] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.530021] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.530021] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3200>] (__irq_usr+0x40/0x60) [ 1424.530021] Exception stack(0xe39c3fb0 to 0xe39c3ff8) [ 1424.530021] 3fa0: b335c620 b38c90a0 b38c6390 5de0fade [ 1424.530021] 3fc0: 5de08fd5 00000006 2e35f14e b38c90c0 b38c90c0 00000050 b30cf310 b38a0000 [ 1424.530021] 3fe0: b3c9af18 b32fe670 b3c8df03 b3c8df16 200e0030 ffffffff [ 1424.531507] CPU3: stopping [ 1424.531507] CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D W O 3.10.65 #64 [ 1424.531507] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.531507] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.531507] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.531507] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.531507] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3040>] (__irq_svc+0x40/0x70) [ 1424.531507] Exception stack(0xe48dff68 to 0xe48dffb0) [ 1424.531507] ff60: 00000003 00000000 000b6574 00000000 e48de000 00000015 [ 1424.531507] ff80: c0b8facc c0b91f44 c06db3a0 410fc075 c0a6848c e48dffbc e48dffc0 e48dffb0 [ 1424.531507] ffa0: c0010ee0 c0010ee4 600e0013 ffffffff [ 1424.531507] [<c06d3040>] (__irq_svc+0x40/0x70) from [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) [ 1424.531507] [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) from [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) [ 1424.531507] [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) from [<c06c62cc>] (secondary_start_kernel+0x118/0x130) [ 1424.531507] [<c06c62cc>] (secondary_start_kernel+0x118/0x130) from [<406c4460>] (0x406c4460) [ 1424.531508] CPU1: stopping [ 1424.531508] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D W O 3.10.65 #64 [ 1424.531508] [<c0017fc4>] (unwind_backtrace+0x0/0xec) from [<c0014238>] (show_stack+0x20/0x24) [ 1424.531508] [<c0014238>] (show_stack+0x20/0x24) from [<c06cc684>] (dump_stack+0x20/0x28) [ 1424.531508] [<c06cc684>] (dump_stack+0x20/0x28) from [<c0015db0>] (handle_IPI+0x15c/0x2d0) [ 1424.531508] [<c0015db0>] (handle_IPI+0x15c/0x2d0) from [<c000a34c>] (gic_handle_irq+0x64/0x6c) [ 1424.531508] [<c000a34c>] (gic_handle_irq+0x64/0x6c) from [<c06d3040>] (__irq_svc+0x40/0x70) [ 1424.531508] Exception stack(0xe48cdf68 to 0xe48cdfb0) [ 1424.531508] df60: 00000001 00000000 000ed2f6 00000000 e48cc000 00000015 [ 1424.531508] df80: c0b8facc c0b91f44 c06db3a0 410fc075 c0a6848c e48cdfbc e48cdfc0 e48cdfb0 [ 1424.531508] dfa0: c0010ee0 c0010ee4 600e0013 ffffffff [ 1424.531508] [<c06d3040>] (__irq_svc+0x40/0x70) from [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) [ 1424.531508] [<c0010ee4>] (arch_cpu_idle+0x34/0x3c) from [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) [ 1424.531508] [<c006ab1c>] (cpu_startup_entry+0x1d8/0x244) from [<c06c62cc>] (secondary_start_kernel+0x118/0x130) [ 1424.531508] [<c06c62cc>] (secondary_start_kernel+0x118/0x130) from [<406c4460>] (0x406c4460) 尝试过在sys_config.fex的[sdc0]中加入non-removable 按power键不会死机 但是WiFi用不了。请各位大神帮看一下
嵌入式系统启动问题,求大神帮忙看看
NAND: nand_init!!!!! W55FA93 NAND driver (20131023) has been initialized successfully! scsi0 : Nuvoton W55FA93 On Board NAND DRIVER! W55FA93 DEVMEM driver has been initialized successfully! [GNAND] GNAND Library Version: V1.02.3 fmiSMCheckBootHeader 1 Nand0: uLibStartBlock=34 [GNAND] NAND flash chip detected, chip ID is 0xad-0xda ! GNAND init failed !!!!!!!! scsi 0:0:1:0: Direct-Access NUVOTON GNAND DRIVER 2.00 PQ: 0 ANSI: 0 sd 0:0:1:0: [sda] Unit Not Ready sd 0:0:1:0: [sda] Sense Key : 0x3 [current] sd 0:0:1:0: [sda] ASC=0x30 ASCQ=0x0 sd 0:0:1:0: [sda] READ CAPACITY failed sd 0:0:1:0: [sda] Result: hostbyte=0x00 driverbyte=0x08 sd 0:0:1:0: [sda] Sense Key : 0x3 [current] sd 0:0:1:0: [sda] ASC=0x30 ASCQ=0x0 sd 0:0:1:0: [sda] Test WP failed, assume Write Enabled sd 0:0:1:0: [sda] Asking for cache data failed sd 0:0:1:0: [sda] Assuming drive cache: write through sd 0:0:1:0: [sda] Unit Not Ready sd 0:0:1:0: [sda] Sense Key : 0x3 [current] sd 0:0:1:0: [sda] ASC=0x30 ASCQ=0x0 sd 0:0:1:0: [sda] READ CAPACITY failed sd 0:0:1:0: [sda] Result: hostbyte=0x00 driverbyte=0x08 sd 0:0:1:0: [sda] Sense Key : 0x3 [current] sd 0:0:1:0: [sda] ASC=0x30 ASCQ=0x0 sd 0:0:1:0: [sda] Test WP failed, assume Write Enabled sd 0:0:1:0: [sda] Asking for cache data failed sd 0:0:1:0: [sda] Assuming drive cache: write through sd 0:0:1:0: [sda] Attached SCSI removable disk 系统启动时,在这里就死了,请问大神们怎么回事呢?
uboot移植的问题。uboot.bin文件无法烧进stm32芯片
通过J-FLASH烧录uboot.bin文件到烧stm32f746/stm32f767开发板失败,提示如图错误 ![图片说明](https://img-ask.csdn.net/upload/201901/21/1548072722_594537.jpeg) 换了一个项目都bin文件,还是同样的问题。 hex文件就能烧进去,请问如何解决? 开发板只有NAND FLASH,是不是bin文件无法直接烧进NAND FLASH呢?求教~
nandwrite 写nandflash后 UnCorrectable RS-ECC Error
mtd表 ``` dev: size erasesize name mtd0: 00080000 00020000 "loader" //512K mtd1: 00100000 00020000 "uboot" //1M mtd2: 00080000 00020000 "envirment" //512K mtd3: 00800000 00020000 "kernel" //8M mtd4: 00100000 00020000 "device-tree" //1M mtd5: 03400000 00020000 "rootfs_uRamdisk" //52M mtd6: 1c000000 00020000 "userfilesystem" //448M ``` 要擦写的分区 /dev/mtd5 信息 ``` root@lig-ppc:/nandflash# mtd_debug info /dev/mtd5 mtd.type = MTD_NANDFLASH mtd.flags = MTD_CAP_NANDFLASH mtd.size = 54525952 (52M) mtd.erasesize = 131072 (128K) mtd.writesize = 2048 (2K) mtd.oobsize = 64 regions = 0 ``` 操作 1.flash_eraseall /dev/mtd5 2.nandwrite -p /dev/mtd5 uRamdisk_upgrade uboot中的启动信息 正常: ``` ## Loading init Ramdisk from Legacy Image at 03000000 ... Image Name: init ramdisk Created: 2017-12-04 8:20:58 UTC Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 12549477 Bytes = 12 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ``` 擦写后 ``` ..... UnCorrectable RS-ECC Error UnCorrectable RS-ECC Error UnCorrectable RS-ECC Error UnCorrectable RS-ECC Error ..... ## Loading init Ramdisk from Legacy Image at 03000000 ... Image Name: init ramdisk Created: 2017-12-04 8:20:58 UTC Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 12549477 Bytes = 12 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... Bad Data CRC Ramdisk image is corrupt or invalid ``` uboot下操作nandwrite时,能正常启动,目前就是在linux下进行nandwrite操作,无法正常启动 文件大小读取的是正确的,但是校验错误了,请教大神,这个校验问题怎么解决?或者这个问题的解决思路应该怎么办? nandwrite 使用的是mtd-utils-1.0.0 代码: ``` /* * nandwrite.c * * Copyright (C) 2000 Steven J. Hill (sjhill@realitydiluted.com) * 2003 Thomas Gleixner (tglx@linutronix.de) * * $Id: nandwrite.c,v 1.32 2005/11/07 11:15:13 gleixner Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Overview: * This utility writes a binary image directly to a NAND flash * chip or NAND chips contained in DoC devices. This is the * "inverse operation" of nanddump. * * tglx: Major rewrite to handle bad blocks, write data with or without ECC * write oob data only on request * * Bug/ToDo: */ #define _GNU_SOURCE #include <ctype.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/types.h> #include <getopt.h> #include <asm/types.h> #include "mtd/mtd-user.h" #define PROGRAM "nandwrite" #define VERSION "$Revision: 1.32 $" #define MAX_PAGE_SIZE 2048 #define MAX_OOB_SIZE 64 /* * Buffer array used for writing data */ unsigned char writebuf[MAX_PAGE_SIZE]; unsigned char oobbuf[MAX_OOB_SIZE]; unsigned char oobreadbuf[MAX_OOB_SIZE]; // oob layouts to pass into the kernel as default struct nand_oobinfo none_oobinfo = { .useecc = MTD_NANDECC_OFF, }; struct nand_oobinfo jffs2_oobinfo = { .useecc = MTD_NANDECC_PLACE, .eccbytes = 6, .eccpos = { 0, 1, 2, 3, 6, 7 } }; struct nand_oobinfo yaffs_oobinfo = { .useecc = MTD_NANDECC_PLACE, .eccbytes = 6, .eccpos = { 8, 9, 10, 13, 14, 15} }; struct nand_oobinfo autoplace_oobinfo = { .useecc = MTD_NANDECC_AUTOPLACE }; void display_help (void) { printf("Usage: nandwrite [OPTION] MTD_DEVICE INPUTFILE\n" "Writes to the specified MTD device.\n" "\n" " -a, --autoplace Use auto oob layout\n" " -j, --jffs2 force jffs2 oob layout (legacy support)\n" " -y, --yaffs force yaffs oob layout (legacy support)\n" " -f, --forcelegacy force legacy support on autoplacement enabled mtd device\n" " -n, --noecc write without ecc\n" " -o, --oob image contains oob data\n" " -s addr, --start=addr set start address (default is 0)\n" " -p, --pad pad to page size\n" " -b, --blockalign=1|2|4 set multiple of eraseblocks to align to\n" " -q, --quiet don't display progress messages\n" " --help display this help and exit\n" " --version output version information and exit\n"); exit(0); } void display_version (void) { printf(PROGRAM " " VERSION "\n" "\n" "Copyright (C) 2003 Thomas Gleixner \n" "\n" PROGRAM " comes with NO WARRANTY\n" "to the extent permitted by law.\n" "\n" "You may redistribute copies of " PROGRAM "\n" "under the terms of the GNU General Public Licence.\n" "See the file `COPYING' for more information.\n"); exit(0); } char *mtd_device, *img; int mtdoffset = 0; int quiet = 0; int writeoob = 0; int autoplace = 0; int forcejffs2 = 0; int forceyaffs = 0; int forcelegacy = 0; int noecc = 0; int pad = 0; int blockalign = 1; /*default to using 16K block size */ void process_options (int argc, char *argv[]) { int error = 0; for (;;) { int option_index = 0; static const char *short_options = "ab:fjnopqs:y"; static const struct option long_options[] = { {"help", no_argument, 0, 0}, {"version", no_argument, 0, 0}, {"autoplace", no_argument, 0, 'a'}, {"blockalign", required_argument, 0, 'b'}, {"forcelegacy", no_argument, 0, 'f'}, {"jffs2", no_argument, 0, 'j'}, {"noecc", no_argument, 0, 'n'}, {"oob", no_argument, 0, 'o'}, {"pad", no_argument, 0, 'p'}, {"quiet", no_argument, 0, 'q'}, {"start", required_argument, 0, 's'}, {"yaffs", no_argument, 0, 'y'}, {0, 0, 0, 0}, }; int c = getopt_long(argc, argv, short_options, long_options, &option_index); if (c == EOF) { break; } switch (c) { case 0: switch (option_index) { case 0: display_help(); break; case 1: display_version(); break; } break; case 'q': quiet = 1; break; case 'a': autoplace = 1; break; case 'j': forcejffs2 = 1; break; case 'y': forceyaffs = 1; break; case 'f': forcelegacy = 1; break; case 'n': noecc = 1; break; case 'o': writeoob = 1; break; case 'p': pad = 1; break; case 's': mtdoffset = atoi (optarg); break; case 'b': blockalign = atoi (optarg); break; case '?': error = 1; break; } } if ((argc - optind) != 2 || error) display_help (); mtd_device = argv[optind++]; img = argv[optind]; } /* * Main program */ int main(int argc, char **argv) { int cnt, fd, ifd, imglen = 0, pagelen, baderaseblock, blockstart = -1; struct mtd_info_user meminfo; struct mtd_oob_buf oob; loff_t offs; int ret, readlen; int oobinfochanged = 0; struct nand_oobinfo old_oobinfo; process_options(argc, argv); memset(oobbuf, 0xff, sizeof(oobbuf)); if (pad && writeoob) { fprintf(stderr, "Can't pad when oob data is present.\n"); exit(1); } /* Open the device */ if ((fd = open(mtd_device, O_RDWR)) == -1) { perror("open flash"); exit(1); } /* Fill in MTD device capability structure */ if (ioctl(fd, MEMGETINFO, &meminfo) != 0) { perror("MEMGETINFO"); close(fd); exit(1); } /* Set erasesize to specified number of blocks - to match jffs2 (virtual) block size */ meminfo.erasesize *= blockalign; /* Make sure device page sizes are valid */ if (!(meminfo.oobsize == 16 && meminfo.oobblock == 512) && !(meminfo.oobsize == 8 && meminfo.oobblock == 256) && !(meminfo.oobsize == 64 && meminfo.oobblock == 2048)) { fprintf(stderr, "Unknown flash (not normal NAND)\n"); close(fd); exit(1); } /* Read the current oob info */ if (ioctl (fd, MEMGETOOBSEL, &old_oobinfo) != 0) { perror ("MEMGETOOBSEL"); close (fd); exit (1); } // write without ecc ? if (noecc) { if (ioctl (fd, MEMSETOOBSEL, &none_oobinfo) != 0) { perror ("MEMSETOOBSEL"); close (fd); exit (1); } oobinfochanged = 1; } // autoplace ECC ? if (autoplace && (old_oobinfo.useecc != MTD_NANDECC_AUTOPLACE)) { if (ioctl (fd, MEMSETOOBSEL, &autoplace_oobinfo) != 0) { perror ("MEMSETOOBSEL"); close (fd); exit (1); } oobinfochanged = 1; } /* * force oob layout for jffs2 or yaffs ? * Legacy support */ if (forcejffs2 || forceyaffs) { struct nand_oobinfo *oobsel = forcejffs2 ? &jffs2_oobinfo : &yaffs_oobinfo; if (autoplace) { fprintf(stderr, "Autoplacement is not possible for legacy -j/-y options\n"); goto restoreoob; } if ((old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE) && !forcelegacy) { fprintf(stderr, "Use -f option to enforce legacy placement on autoplacement enabled mtd device\n"); goto restoreoob; } if (meminfo.oobsize == 8) { if (forceyaffs) { fprintf (stderr, "YAFSS cannot operate on 256 Byte page size"); goto restoreoob; } /* Adjust number of ecc bytes */ jffs2_oobinfo.eccbytes = 3; } if (ioctl (fd, MEMSETOOBSEL, oobsel) != 0) { perror ("MEMSETOOBSEL"); goto restoreoob; } } oob.length = meminfo.oobsize; oob.ptr = noecc ? oobreadbuf : oobbuf; /* Open the input file */ if ((ifd = open(img, O_RDONLY)) == -1) { perror("open input file"); goto restoreoob; } // get image length imglen = lseek(ifd, 0, SEEK_END); lseek (ifd, 0, SEEK_SET); pagelen = meminfo.oobblock + ((writeoob == 1) ? meminfo.oobsize : 0); // Check, if file is pagealigned if ((!pad) && ((imglen % pagelen) != 0)) { fprintf (stderr, "Input file is not page aligned\n"); goto closeall; } // Check, if length fits into device if ( ((imglen / pagelen) * meminfo.oobblock) > (meminfo.size - mtdoffset)) { fprintf (stderr, "Image %d bytes, NAND page %d bytes, OOB area %u bytes, device size %u bytes\n", imglen, pagelen, meminfo.oobblock, meminfo.size); perror ("Input file does not fit into device"); goto closeall; } /* Get data from input and write to the device */ while (imglen && (mtdoffset < meminfo.size)) { // new eraseblock , check for bad block(s) // Stay in the loop to be sure if the mtdoffset changes because // of a bad block, that the next block that will be written to // is also checked. Thus avoiding errors if the block(s) after the // skipped block(s) is also bad (number of blocks depending on // the blockalign while (blockstart != (mtdoffset & (~meminfo.erasesize + 1))) { blockstart = mtdoffset & (~meminfo.erasesize + 1); offs = blockstart; baderaseblock = 0; if (!quiet) fprintf (stdout, "Writing data to block %x\n", blockstart); /* Check all the blocks in an erase block for bad blocks */ do { if ((ret = ioctl(fd, MEMGETBADBLOCK, &offs)) < 0) { perror("ioctl(MEMGETBADBLOCK)"); goto closeall; } if (ret == 1) { baderaseblock = 1; if (!quiet) fprintf (stderr, "Bad block at %x, %u block(s) from %x will be skipped\n", (int) offs, blockalign, blockstart); } if (baderaseblock) { mtdoffset = blockstart + meminfo.erasesize; } offs += meminfo.erasesize / blockalign ; } while ( offs < blockstart + meminfo.erasesize ); } readlen = meminfo.oobblock; if (pad && (imglen < readlen)) { readlen = imglen; memset(writebuf + readlen, 0xff, meminfo.oobblock - readlen); } /* Read Page Data from input file */ if ((cnt = read(ifd, writebuf, readlen)) != readlen) { if (cnt == 0) // EOF break; perror ("File I/O error on input file"); goto closeall; } if (writeoob) { /* Read OOB data from input file, exit on failure */ if ((cnt = read(ifd, oobreadbuf, meminfo.oobsize)) != meminfo.oobsize) { perror ("File I/O error on input file"); goto closeall; } if (!noecc) { int i, start, len; /* * We use autoplacement and have the oobinfo with the autoplacement * information from the kernel available * * Modified to support out of order oobfree segments, * such as the layout used by diskonchip.c */ if (!oobinfochanged && (old_oobinfo.useecc == MTD_NANDECC_AUTOPLACE)) { for (i = 0;old_oobinfo.oobfree[i][1]; i++) { /* Set the reserved bytes to 0xff */ start = old_oobinfo.oobfree[i][0]; len = old_oobinfo.oobfree[i][1]; memcpy(oobbuf + start, oobreadbuf + start, len); } } else { /* Set at least the ecc byte positions to 0xff */ start = old_oobinfo.eccbytes; len = meminfo.oobsize - start; memcpy(oobbuf + start, oobreadbuf + start, len); } } /* Write OOB data first, as ecc will be placed in there*/ oob.start = mtdoffset; if (ioctl(fd, MEMWRITEOOB, &oob) != 0) { perror ("ioctl(MEMWRITEOOB)"); goto closeall; } imglen -= meminfo.oobsize; } /* Write out the Page data */ if (pwrite(fd, writebuf, meminfo.oobblock, mtdoffset) != meminfo.oobblock) { perror ("pwrite"); goto closeall; } imglen -= readlen; mtdoffset += meminfo.oobblock; } closeall: close(ifd); restoreoob: if (oobinfochanged) { if (ioctl (fd, MEMSETOOBSEL, &old_oobinfo) != 0) { perror ("MEMSETOOBSEL"); close (fd); exit (1); } } close(fd); if (imglen > 0) { perror ("Data did not fit into device, due to bad blocks\n"); exit (1); } /* Return happy */ return 0; } ``` --- uboot中nandwrite部分的代码 ``` /* * Driver for NAND support, Rick Bronson * borrowed heavily from: * (c) 1999 Machine Vision Holdings, Inc. * (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org> * * Added 16-bit nand support * (C) 2004 Texas Instruments */ #include <common.h> #ifndef CONFIG_NAND_LEGACY /* * * New NAND support * */ #include <common.h> #include <linux/mtd/mtd.h> #if defined(CONFIG_CMD_NAND) #include <command.h> #include <watchdog.h> #include <malloc.h> #include <asm/byteorder.h> #include <jffs2/jffs2.h> #include <nand.h> #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) /* parition handling routines */ int mtdparts_init(void); int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num); int find_dev_and_part(const char *id, struct mtd_device **dev, u8 *part_num, struct part_info **part); #endif static int nand_dump(nand_info_t *nand, ulong off, int only_oob) { int i; u_char *datbuf, *oobbuf, *p; datbuf = malloc(nand->writesize + nand->oobsize); oobbuf = malloc(nand->oobsize); if (!datbuf || !oobbuf) { puts("No memory for page buffer\n"); return 1; } off &= ~(nand->writesize - 1); loff_t addr = (loff_t) off; struct mtd_oob_ops ops; memset(&ops, 0, sizeof(ops)); ops.datbuf = datbuf; ops.oobbuf = oobbuf; /* must exist, but oob data will be appended to ops.datbuf */ ops.len = nand->writesize; ops.ooblen = nand->oobsize; ops.mode = MTD_OOB_RAW; i = nand->read_oob(nand, addr, &ops); if (i < 0) { printf("Error (%d) reading page %08lx\n", i, off); free(datbuf); free(oobbuf); return 1; } printf("Page %08lx dump:\n", off); i = nand->writesize >> 4; p = datbuf; while (i--) { if (!only_oob) printf("\t%02x %02x %02x %02x %02x %02x %02x %02x" " %02x %02x %02x %02x %02x %02x %02x %02x\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]); p += 16; } puts("OOB:\n"); i = nand->oobsize >> 3; while (i--) { printf("\t%02x %02x %02x %02x %02x %02x %02x %02x\n", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); p += 8; } free(datbuf); free(oobbuf); return 0; } /* ------------------------------------------------------------------------- */ static inline int str2long(char *p, ulong *num) { char *endptr; *num = simple_strtoul(p, &endptr, 16); return (*p != '\0' && *endptr == '\0') ? 1 : 0; } static int arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size) { int idx = nand_curr_device; #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; if (argc >= 1 && !(str2long(argv[0], off))) { if ((mtdparts_init() == 0) && (find_dev_and_part(argv[0], &dev, &pnum, &part) == 0)) { if (dev->id->type != MTD_DEV_TYPE_NAND) { puts("not a NAND device\n"); return -1; } *off = part->offset; if (argc >= 2) { if (!(str2long(argv[1], (ulong *)size))) { printf("'%s' is not a number\n", argv[1]); return -1; } if (*size > part->size) *size = part->size; } else { *size = part->size; } idx = dev->id->num; *nand = nand_info[idx]; goto out; } } #endif if (argc >= 1) { if (!(str2long(argv[0], off))) { printf("'%s' is not a number\n", argv[0]); return -1; } } else { *off = 0; } if (argc >= 2) { if (!(str2long(argv[1], (ulong *)size))) { printf("'%s' is not a number\n", argv[1]); return -1; } } else { *size = nand->size - *off; } #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) out: #endif printf("device %d ", idx); if (*size == nand->size) puts("whole chip\n"); else printf("offset 0x%lx, size 0x%zx\n", *off, *size); return 0; } #ifdef CONFIG_CMD_NAND_LOCK_UNLOCK static void print_status(ulong start, ulong end, ulong erasesize, int status) { printf("%08lx - %08lx: %08lx blocks %s%s%s\n", start, end - 1, (end - start) / erasesize, ((status & NAND_LOCK_STATUS_TIGHT) ? "TIGHT " : ""), ((status & NAND_LOCK_STATUS_LOCK) ? "LOCK " : ""), ((status & NAND_LOCK_STATUS_UNLOCK) ? "UNLOCK " : "")); } static void do_nand_status(nand_info_t *nand) { ulong block_start = 0; ulong off; int last_status = -1; struct nand_chip *nand_chip = nand->priv; /* check the WP bit */ nand_chip->cmdfunc(nand, NAND_CMD_STATUS, -1, -1); printf("device is %swrite protected\n", (nand_chip->read_byte(nand) & 0x80 ? "NOT " : "")); for (off = 0; off < nand->size; off += nand->erasesize) { int s = nand_get_lock_status(nand, off); /* print message only if status has changed */ if (s != last_status && off != 0) { print_status(block_start, off, nand->erasesize, last_status); block_start = off; } last_status = s; } /* Print the last block info */ print_status(block_start, off, nand->erasesize, last_status); } #endif int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { int i, dev, ret = 0; ulong addr, off; size_t size; char *cmd, *s; nand_info_t *nand; #ifdef CONFIG_SYS_NAND_QUIET int quiet = CONFIG_SYS_NAND_QUIET; #else int quiet = 0; #endif const char *quiet_str = getenv("quiet"); /* at least two arguments please */ if (argc < 2) goto usage; if (quiet_str) quiet = simple_strtoul(quiet_str, NULL, 0) != 0; cmd = argv[1]; if (strcmp(cmd, "info") == 0) { putc('\n'); for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; i++) { if (nand_info[i].name) printf("Device %d: %s, sector size %u KiB\n", i, nand_info[i].name, nand_info[i].erasesize >> 10); } return 0; } if (strcmp(cmd, "device") == 0) { if (argc < 3) { if ((nand_curr_device < 0) || (nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE)) puts("\nno devices available\n"); else printf("\nDevice %d: %s\n", nand_curr_device, nand_info[nand_curr_device].name); return 0; } dev = (int)simple_strtoul(argv[2], NULL, 10); if (dev < 0 || dev >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[dev].name) { puts("No such device\n"); return 1; } printf("Device %d: %s", dev, nand_info[dev].name); puts("... is now current device\n"); nand_curr_device = dev; #ifdef CONFIG_SYS_NAND_SELECT_DEVICE /* * Select the chip in the board/cpu specific driver */ board_nand_select_device(nand_info[dev].priv, dev); #endif return 0; } if (strcmp(cmd, "bad") != 0 && strcmp(cmd, "erase") != 0 && strncmp(cmd, "dump", 4) != 0 && strncmp(cmd, "read", 4) != 0 && strncmp(cmd, "write", 5) != 0 && strcmp(cmd, "scrub") != 0 && strcmp(cmd, "markbad") != 0 && strcmp(cmd, "biterr") != 0 && strcmp(cmd, "lock") != 0 && strcmp(cmd, "unlock") != 0 ) goto usage; /* the following commands operate on the current device */ if (nand_curr_device < 0 || nand_curr_device >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[nand_curr_device].name) { puts("\nno devices available\n"); return 1; } nand = &nand_info[nand_curr_device]; if (strcmp(cmd, "bad") == 0) { long long lloff,llsize=nand->size; printf("\nDevice %d bad blocks:\n", nand_curr_device); for (lloff = 0; lloff < llsize; lloff += nand->erasesize) { off += nand->erasesize; if (nand_block_isbad(nand, off)) printf(" %08lx\n", off); } return 0; } /* * Syntax is: * 0 1 2 3 4 * nand erase [clean] [off size] */ if (strcmp(cmd, "erase") == 0 || strcmp(cmd, "scrub") == 0) { nand_erase_options_t opts; /* "clean" at index 2 means request to write cleanmarker */ int clean = argc > 2 && !strcmp("clean", argv[2]); int o = clean ? 3 : 2; int scrub = !strcmp(cmd, "scrub"); printf("\nNAND %s: ", scrub ? "scrub" : "erase"); /* skip first two or three arguments, look for offset and size */ if (arg_off_size(argc - o, argv + o, nand, &off, &size) != 0) return 1; memset(&opts, 0, sizeof(opts)); opts.offset = off; opts.length = size; opts.jffs2 = clean; opts.quiet = quiet; if (scrub) { puts("Warning: " "scrub option will erase all factory set " "bad blocks!\n" " " "There is no reliable way to recover them.\n" " " "Use this command only for testing purposes " "if you\n" " " "are sure of what you are doing!\n" "\nReally scrub this NAND flash? <y/N>\n"); if (getc() == 'y' && getc() == '\r') { opts.scrub = 1; } else { puts("scrub aborted\n"); return -1; } } ret = nand_erase_opts(nand, &opts); printf("%s\n", ret ? "ERROR" : "OK"); return ret == 0 ? 0 : 1; } if (strncmp(cmd, "dump", 4) == 0) { if (argc < 3) goto usage; s = strchr(cmd, '.'); off = (int)simple_strtoul(argv[2], NULL, 16); if (s != NULL && strcmp(s, ".oob") == 0) ret = nand_dump(nand, off, 1); else ret = nand_dump(nand, off, 0); return ret == 0 ? 1 : 0; } if (strncmp(cmd, "read", 4) == 0 || strncmp(cmd, "write", 5) == 0) { int read; if (argc < 4) goto usage; addr = (ulong)simple_strtoul(argv[2], NULL, 16); read = strncmp(cmd, "read", 4) == 0; /* 1 = read, 0 = write */ printf("\nNAND %s: ", read ? "read" : "write"); if (arg_off_size(argc - 3, argv + 3, nand, &off, &size) != 0) return 1; s = strchr(cmd, '.'); if (!s || !strcmp(s, ".jffs2") || !strcmp(s, ".e") || !strcmp(s, ".i")) { if (read) ret = nand_read_skip_bad(nand, off, &size, (u_char *)addr); else ret = nand_write_skip_bad(nand, off, &size, (u_char *)addr); } else if (s != NULL && !strcmp(s, ".oob")) { /* out-of-band data */ mtd_oob_ops_t ops = { .oobbuf = (u8 *)addr, .ooblen = size, .mode = MTD_OOB_RAW }; if (read) ret = nand->read_oob(nand, off, &ops); else ret = nand->write_oob(nand, off, &ops); } else { printf("Unknown nand command suffix '%s'.\n", s); return 1; } printf(" %zu bytes %s: %s\n", size, read ? "read" : "written", ret ? "ERROR" : "OK"); return ret == 0 ? 0 : 1; } if (strcmp(cmd, "markbad") == 0) { addr = (ulong)simple_strtoul(argv[2], NULL, 16); int ret = nand->block_markbad(nand, addr); if (ret == 0) { printf("block 0x%08lx successfully marked as bad\n", (ulong) addr); return 0; } else { printf("block 0x%08lx NOT marked as bad! ERROR %d\n", (ulong) addr, ret); } return 1; } if (strcmp(cmd, "biterr") == 0) { /* todo */ return 1; } #ifdef CONFIG_CMD_NAND_LOCK_UNLOCK if (strcmp(cmd, "lock") == 0) { int tight = 0; int status = 0; if (argc == 3) { if (!strcmp("tight", argv[2])) tight = 1; if (!strcmp("status", argv[2])) status = 1; } if (status) { do_nand_status(nand); } else { if (!nand_lock(nand, tight)) { puts("NAND flash successfully locked\n"); } else { puts("Error locking NAND flash\n"); return 1; } } return 0; } if (strcmp(cmd, "unlock") == 0) { if (arg_off_size(argc - 2, argv + 2, nand, &off, &size) < 0) return 1; if (!nand_unlock(nand, off, size)) { puts("NAND flash successfully unlocked\n"); } else { puts("Error unlocking NAND flash, " "write and erase will probably fail\n"); return 1; } return 0; } #endif usage: cmd_usage(cmdtp); return 1; } //cmd_tbl_s U_BOOT_CMD(nand, 5, 1, do_nand, "NAND sub-system", "info - show available NAND devices\n" "nand device [dev] - show or set current device\n" "nand read - addr off|partition size\n" "nand write - addr off|partition size\n" " read/write 'size' bytes starting at offset 'off'\n" " to/from memory address 'addr', skipping bad blocks.\n" "nand erase [clean] [off size] - erase 'size' bytes from\n" " offset 'off' (entire device if not specified)\n" "nand bad - show bad blocks\n" "nand dump[.oob] off - dump page\n" "nand scrub - really clean NAND erasing bad blocks (UNSAFE)\n" "nand markbad off - mark bad block at offset (UNSAFE)\n" "nand biterr off - make a bit error at offset (UNSAFE)\n" #ifdef CONFIG_CMD_NAND_LOCK_UNLOCK "nand lock [tight] [status]\n" " bring nand to lock state or display locked pages\n" "nand unlock [offset] [size] - unlock section\n" #endif ); static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, ulong offset, ulong addr, char *cmd) { int r; char *ep, *s; size_t cnt; image_header_t *hdr; #if defined(CONFIG_FIT) const void *fit_hdr = NULL; #endif s = strchr(cmd, '.'); if (s != NULL && (strcmp(s, ".jffs2") && strcmp(s, ".e") && strcmp(s, ".i"))) { printf("Unknown nand load suffix '%s'\n", s); show_boot_progress(-53); return 1; } printf("\nLoading from %s, offset 0x%lx\n", nand->name, offset); cnt = nand->writesize; r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr); if (r) { puts("** Read error\n"); show_boot_progress (-56); return 1; } show_boot_progress (56); switch (genimg_get_format ((void *)addr)) { case IMAGE_FORMAT_LEGACY: hdr = (image_header_t *)addr; show_boot_progress (57); image_print_contents (hdr); cnt = image_get_image_size (hdr); break; #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: fit_hdr = (const void *)addr; puts ("Fit image detected...\n"); cnt = fit_get_size (fit_hdr); break; #endif default: show_boot_progress (-57); puts ("** Unknown image type\n"); return 1; } show_boot_progress (57); r = nand_read_skip_bad(nand, offset, &cnt, (u_char *) addr); if (r) { puts("** Read error\n"); show_boot_progress (-58); return 1; } show_boot_progress (58); #if defined(CONFIG_FIT) /* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) { if (!fit_check_format (fit_hdr)) { show_boot_progress (-150); puts ("** Bad FIT image format\n"); return 1; } show_boot_progress (151); fit_print_contents (fit_hdr); } #endif /* Loading ok, update default load address */ load_addr = addr; /* Check if we should attempt an auto-start */ if (((ep = getenv("autostart")) != NULL) && (strcmp(ep, "yes") == 0)) { char *local_args[2]; extern int do_bootm(cmd_tbl_t *, int, int, char *[]); local_args[0] = cmd; local_args[1] = NULL; printf("Automatic boot of image at addr 0x%08lx ...\n", addr); do_bootm(cmdtp, 0, 1, local_args); return 1; } return 0; } int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { char *boot_device = NULL; int idx; ulong addr, offset = 0; #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) struct mtd_device *dev; struct part_info *part; u8 pnum; if (argc >= 2) { char *p = (argc == 2) ? argv[1] : argv[2]; if (!(str2long(p, &addr)) && (mtdparts_init() == 0) && (find_dev_and_part(p, &dev, &pnum, &part) == 0)) { if (dev->id->type != MTD_DEV_TYPE_NAND) { puts("Not a NAND device\n"); return 1; } if (argc > 3) goto usage; if (argc == 3) addr = simple_strtoul(argv[1], NULL, 16); else addr = CONFIG_SYS_LOAD_ADDR; return nand_load_image(cmdtp, &nand_info[dev->id->num], part->offset, addr, argv[0]); } } #endif show_boot_progress(52); switch (argc) { case 1: addr = CONFIG_SYS_LOAD_ADDR; boot_device = getenv("bootdevice"); break; case 2: addr = simple_strtoul(argv[1], NULL, 16); boot_device = getenv("bootdevice"); break; case 3: addr = simple_strtoul(argv[1], NULL, 16); boot_device = argv[2]; break; case 4: addr = simple_strtoul(argv[1], NULL, 16); boot_device = argv[2]; offset = simple_strtoul(argv[3], NULL, 16); break; default: #if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE) usage: #endif cmd_usage(cmdtp); show_boot_progress(-53); return 1; } show_boot_progress(53); if (!boot_device) { puts("\n** No boot device **\n"); show_boot_progress(-54); return 1; } show_boot_progress(54); idx = simple_strtoul(boot_device, NULL, 16); if (idx < 0 || idx >= CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) { printf("\n** Device %d not available\n", idx); show_boot_progress(-55); return 1; } show_boot_progress(55); return nand_load_image(cmdtp, &nand_info[idx], offset, addr, argv[0]); } U_BOOT_CMD(nboot, 4, 1, do_nandboot, "boot from NAND device", "[partition] | [[[loadAddr] dev] offset]\n"); #endif #else /* CONFIG_NAND_LEGACY */ /* * * Legacy NAND support - to be phased out * */ #include <command.h> #include <malloc.h> #include <asm/io.h> #include <watchdog.h> #ifdef CONFIG_show_boot_progress # include <status_led.h> # define show_boot_progress(arg) show_boot_progress(arg) #else # define show_boot_progress(arg) #endif #if defined(CONFIG_CMD_NAND) #include <linux/mtd/nand_legacy.h> #if 0 #include <linux/mtd/nand_ids.h> #include <jffs2/jffs2.h> #endif #ifdef CONFIG_OMAP1510 void archflashwp(void *archdata, int wp); #endif #define ROUND_DOWN(value,boundary) ((value) & (~((boundary)-1))) #undef NAND_DEBUG #undef PSYCHO_DEBUG /* ****************** WARNING ********************* * When ALLOW_ERASE_BAD_DEBUG is non-zero the erase command will * erase (or at least attempt to erase) blocks that are marked * bad. This can be very handy if you are _sure_ that the block * is OK, say because you marked a good block bad to test bad * block handling and you are done testing, or if you have * accidentally marked blocks bad. * * Erasing factory marked bad blocks is a _bad_ idea. If the * erase succeeds there is no reliable way to find them again, * and attempting to program or erase bad blocks can affect * the data in _other_ (good) blocks. */ #define ALLOW_ERASE_BAD_DEBUG 0 #define CONFIG_MTD_NAND_ECC /* enable ECC */ #define CONFIG_MTD_NAND_ECC_JFFS2 /* bits for nand_legacy_rw() `cmd'; or together as needed */ #define NANDRW_READ 0x01 #define NANDRW_WRITE 0x00 #define NANDRW_JFFS2 0x02 #define NANDRW_JFFS2_SKIP 0x04 /* * Imports from nand_legacy.c */ extern struct nand_chip nand_dev_desc[CONFIG_SYS_MAX_NAND_DEVICE]; extern int curr_device; extern int nand_legacy_erase(struct nand_chip *nand, size_t ofs, size_t len, int clean); extern int nand_legacy_rw(struct nand_chip *nand, int cmd, size_t start, size_t len, size_t *retlen, u_char *buf); extern void nand_print(struct nand_chip *nand); extern void nand_print_bad(struct nand_chip *nand); extern int nand_read_oob(struct nand_chip *nand, size_t ofs, size_t len, size_t *retlen, u_char *buf); extern int nand_write_oob(struct nand_chip *nand, size_t ofs, size_t len, size_t *retlen, const u_char *buf); int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]) { int rcode = 0; switch (argc) { case 0: case 1: cmd_usage(cmdtp); return 1; case 2: if (strcmp (argv[1], "info") == 0) { int i; putc ('\n'); for (i = 0; i < CONFIG_SYS_MAX_NAND_DEVICE; ++i) { if (nand_dev_desc[i].ChipID == NAND_ChipID_UNKNOWN) continue; /* list only known devices */ printf ("Device %d: ", i); nand_print (&nand_dev_desc[i]); } return 0; } else if (strcmp (argv[1], "device") == 0) { if ((curr_device < 0) || (curr_device >= CONFIG_SYS_MAX_NAND_DEVICE)) { puts ("\nno devices available\n"); return 1; } printf ("\nDevice %d: ", curr_device); nand_print (&nand_dev_desc[curr_device]); return 0; } else if (strcmp (argv[1], "bad") == 0) { if ((curr_device < 0) || (curr_device >= CONFIG_SYS_MAX_NAND_DEVICE)) { puts ("\nno devices available\n"); return 1; } printf ("\nDevice %d bad blocks:\n", curr_device); nand_print_bad (&nand_dev_desc[curr_device]); return 0; } cmd_usage(cmdtp); return 1; case 3: if (strcmp (argv[1], "device") == 0) { int dev = (int) simple_strtoul (argv[2], NULL, 10); printf ("\nDevice %d: ", dev); if (dev >= CONFIG_SYS_MAX_NAND_DEVICE) { puts ("unknown device\n"); return 1; } nand_print (&nand_dev_desc[dev]); /*nand_print (dev); */ if (nand_dev_desc[dev].ChipID == NAND_ChipID_UNKNOWN) { return 1; } curr_device = dev; puts ("... is now current device\n"); return 0; } else if (strcmp (argv[1], "erase") == 0 && strcmp (argv[2], "clean") == 0) { struct nand_chip *nand = &nand_dev_desc[curr_device]; ulong off = 0; ulong size = nand->totlen; int ret; printf ("\nNAND erase: device %d offset %ld, size %ld ... ", curr_device, off, size); ret = nand_legacy_erase (nand, off, size, 1); printf ("%s\n", ret ? "ERROR" : "OK"); return ret; } cmd_usage(cmdtp); return 1; default: /* at least 4 args */ if (strncmp (argv[1], "read", 4) == 0 || strncmp (argv[1], "write", 5) == 0) { ulong addr = simple_strtoul (argv[2], NULL, 16); off_t off = simple_strtoul (argv[3], NULL, 16); size_t size = simple_strtoul (argv[4], NULL, 16); int cmd = (strncmp (argv[1], "read", 4) == 0) ? NANDRW_READ : NANDRW_WRITE; size_t total; int ret; char *cmdtail = strchr (argv[1], '.'); if (cmdtail && !strncmp (cmdtail, ".oob", 2)) { /* read out-of-band data */ if (cmd & NANDRW_READ) { ret = nand_read_oob (nand_dev_desc + curr_device, off, size, &total, (u_char *) addr); } else { ret = nand_write_oob (nand_dev_desc + curr_device, off, size, &total, (u_char *) addr); } return ret; } else if (cmdtail && !strncmp (cmdtail, ".jffs2s", 7)) { cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */ if (cmd & NANDRW_READ) cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on read too) */ } else if (cmdtail && !strncmp (cmdtail, ".jffs2", 2)) cmd |= NANDRW_JFFS2; /* skip bad blocks */ #ifdef SXNI855T /* need ".e" same as ".j" for compatibility with older units */ else if (cmdtail && !strcmp (cmdtail, ".e")) cmd |= NANDRW_JFFS2; /* skip bad blocks */ #endif #ifdef CONFIG_SYS_NAND_SKIP_BAD_DOT_I /* need ".i" same as ".jffs2s" for compatibility with older units (esd) */ /* ".i" for image -> read skips bad block (no 0xff) */ else if (cmdtail && !strcmp (cmdtail, ".i")) { cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */ if (cmd & NANDRW_READ) cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on read too) */ } #endif /* CONFIG_SYS_NAND_SKIP_BAD_DOT_I */ else if (cmdtail) { cmd_usage(cmdtp); return 1; } printf ("\nNAND %s: device %d offset %ld, size %lu ...\n", (cmd & NANDRW_READ) ? "read" : "write", curr_device, off, (ulong)size); ret = nand_legacy_rw (nand_dev_desc + curr_device, cmd, off, size, &total, (u_char *) addr); printf (" %d bytes %s: %s\n", total, (cmd & NANDRW_READ) ? "read" : "written", ret ? "ERROR" : "OK"); return ret; } else if (strcmp (argv[1], "erase") == 0 && (argc == 4 || strcmp ("clean", argv[2]) == 0)) { int clean = argc == 5; ulong off = simple_strtoul (argv[2 + clean], NULL, 16); ulong size = simple_strtoul (argv[3 + clean], NULL, 16); int ret; printf ("\nNAND erase: device %d offset %ld, size %ld ...\n", curr_device, off, size); ret = nand_legacy_erase (nand_dev_desc + curr_device, off, size, clean); printf ("%s\n", ret ? "ERROR" : "OK"); return ret; } else { cmd_usage(cmdtp); rcode = 1; } return rcode; } } U_BOOT_CMD( nand, 5, 1, do_nand, "legacy NAND sub-system", "info - show available NAND devices\n" "nand device [dev] - show or set current device\n" "nand read[.jffs2[s]] addr off size\n" "nand write[.jffs2] addr off size - read/write `size' bytes starting\n" " at offset `off' to/from memory address `addr'\n" "nand erase [clean] [off size] - erase `size' bytes from\n" " offset `off' (entire device if not specified)\n" "nand bad - show bad blocks\n" "nand read.oob addr off size - read out-of-band data\n" "nand write.oob addr off size - read out-of-band data\n" ); int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { char *boot_device = NULL; char *ep; int dev; ulong cnt; ulong addr; ulong offset = 0; image_header_t *hdr; int rcode = 0; #if defined(CONFIG_FIT) const void *fit_hdr = NULL; #endif show_boot_progress (52); switch (argc) { case 1: addr = CONFIG_SYS_LOAD_ADDR; boot_device = getenv ("bootdevice"); break; case 2: addr = simple_strtoul(argv[1], NULL, 16); boot_device = getenv ("bootdevice"); break; case 3: addr = simple_strtoul(argv[1], NULL, 16); boot_device = argv[2]; break; case 4: addr = simple_strtoul(argv[1], NULL, 16); boot_device = argv[2]; offset = simple_strtoul(argv[3], NULL, 16); break; default: cmd_usage(cmdtp); show_boot_progress (-53); return 1; } show_boot_progress (53); if (!boot_device) { puts ("\n** No boot device **\n"); show_boot_progress (-54); return 1; } show_boot_progress (54); dev = simple_strtoul(boot_device, &ep, 16); if ((dev >= CONFIG_SYS_MAX_NAND_DEVICE) || (nand_dev_desc[dev].ChipID == NAND_ChipID_UNKNOWN)) { printf ("\n** Device %d not available\n", dev); show_boot_progress (-55); return 1; } show_boot_progress (55); printf ("\nLoading from device %d: %s at 0x%lx (offset 0x%lx)\n", dev, nand_dev_desc[dev].name, nand_dev_desc[dev].IO_ADDR, offset); if (nand_legacy_rw (nand_dev_desc + dev, NANDRW_READ, offset, SECTORSIZE, NULL, (u_char *)addr)) { printf ("** Read error on %d\n", dev); show_boot_progress (-56); return 1; } show_boot_progress (56); switch (genimg_get_format ((void *)addr)) { case IMAGE_FORMAT_LEGACY: hdr = (image_header_t *)addr; image_print_contents (hdr); cnt = image_get_image_size (hdr); cnt -= SECTORSIZE; break; #if defined(CONFIG_FIT) case IMAGE_FORMAT_FIT: fit_hdr = (const void *)addr; puts ("Fit image detected...\n"); cnt = fit_get_size (fit_hdr); break; #endif default: show_boot_progress (-57); puts ("** Unknown image type\n"); return 1; } show_boot_progress (57); if (nand_legacy_rw (nand_dev_desc + dev, NANDRW_READ, offset + SECTORSIZE, cnt, NULL, (u_char *)(addr+SECTORSIZE))) { printf ("** Read error on %d\n", dev); show_boot_progress (-58); return 1; } show_boot_progress (58); #if defined(CONFIG_FIT) /* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *)addr) == IMAGE_FORMAT_FIT) { if (!fit_check_format (fit_hdr)) { show_boot_progress (-150); puts ("** Bad FIT image format\n"); return 1; } show_boot_progress (151); fit_print_contents (fit_hdr); } #endif /* Loading ok, update default load address */ load_addr = addr; /* Check if we should attempt an auto-start */ if (((ep = getenv("autostart")) != NULL) && (strcmp(ep,"yes") == 0)) { char *local_args[2]; extern int do_bootm (cmd_tbl_t *, int, int, char *[]); local_args[0] = argv[0]; local_args[1] = NULL; printf ("Automatic boot of image at addr 0x%08lx ...\n", addr); do_bootm (cmdtp, 0, 1, local_args); rcode = 1; } return rcode; } U_BOOT_CMD( nboot, 4, 1, do_nandboot, "boot from NAND device", "loadAddr dev\n" ); #endif #endif /* CONFIG_NAND_LEGACY */ ```
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库——点这里跳转 文章目录Python语言高频重点汇总**GitHub面试宝典仓库——点这里跳转**1. 函数-传参2. 元类3. @staticmethod和@classmethod两个装饰器4. 类属性和实例属性5. Python的自省6. 列表、集合、字典推导式7. Python中单下划线和双下划线8. 格式化字符串中的%和format9.
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
ES6基础-ES6的扩展
进行对字符串扩展,正则扩展,数值扩展,函数扩展,对象扩展,数组扩展。 开发环境准备: 编辑器(VS Code, Atom,Sublime)或者IDE(Webstorm) 浏览器最新的Chrome 字符串的扩展: 模板字符串,部分新的方法,新的unicode表示和遍历方法: 部分新的字符串方法 padStart,padEnd,repeat,startsWith,endsWith,includes 字
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Qt实践录:开篇
本系列文章介绍笔者的Qt实践之路。 背景 笔者首次接触 Qt 大约是十多年前,当时试用了 Qt ,觉得不如 MFC 好用。现在 Qt 的 API、文档等都比较完善,在年初决定重新拾起,正所谓技多不压身,将 Qt 当为一种谋生工具亦未尝不可。利用春节假期的集中时间,快速专攻一下。 本系列名为“Qt实践”,故不是教程,笔者对 Qt 的定位是“使用”,可以帮助快速编写日常的工具,如串口、网络等。所以不
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
一条链接即可让黑客跟踪你的位置! | Seeker工具使用
搬运自:冰崖的部落阁(icecliffsnet) 严正声明:本文仅限于技术讨论,严禁用于其他用途。 请遵守相对应法律规则,禁止用作违法途径,出事后果自负! 上次写的防社工文章里边提到的gps定位信息(如何防止自己被社工或人肉) 除了主动收集他人位置信息以外,我们还可以进行被动收集 (没有技术含量) Seeker作为一款高精度地理位置跟踪工具,同时也是社交工程学(社会工程学)爱好者...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问