s3c2440中U-boot移植时执行cp.b提示:Flash not Erased



在源码中搜索Flash not Erased,在common/flash.c中flash_perror()函数为错误打印函数

void flash_perror (int err)

{

         switch(err) {

         caseERR_OK:

                   break;

         caseERR_TIMOUT:

                   puts("Timeout writing to Flash\n");

                   break;

         caseERR_NOT_ERASED:

                   puts("Flash not Erased\n");

                   break;

         caseERR_PROTECTED:

                   puts("Can't write to protected Flash sectors\n");

                   break;

         caseERR_INVAL:

                   puts("Outside available Flash\n");

                   break;

         caseERR_ALIGN:

                   puts("Start and/or end address not on sector boundary\n");

                   break;

         caseERR_UNKNOWN_FLASH_VENDOR:

                   puts("Unknown Vendor of Flash\n");

                   break;

         caseERR_UNKNOWN_FLASH_TYPE:

                   puts("Unknown Type of Flash\n");

                   break;

         caseERR_PROG_ERROR:

                   puts("General Flash Programming Error\n");

                   break;

         default:

                   printf("%s[%d] FIXME: rc=%d\n", __FILE__, __LINE__, err);

                   break;

         }

}

在common/cmd_mem.c文件中查找cp命令,锁定do_mem_cp函数


int do_mem_cp ( cmd_tbl_t *cmdtp, int flag,int argc, char * const argv[])

{

         ulong        addr, dest, count;

         int    size;

         if(argc != 4)

                   returnCMD_RET_USAGE;

         /*Check for size specification.

         */

         if((size = cmd_get_data_size(argv[0], 4)) < 0)

                   return1;

         addr= simple_strtoul(argv[1], NULL, 16);

         addr+= base_address;

 

         dest= simple_strtoul(argv[2], NULL, 16);

         dest+= base_address;

 

         count= simple_strtoul(argv[3], NULL, 16);

 

         if(count == 0) {

                   puts("Zero length ???\n");

                   return1;

         }

 

#ifndef CONFIG_SYS_NO_FLASH

         /*check if we are copying to Flash */

         if( (addr2info(dest) != NULL)

#ifdef CONFIG_HAS_DATAFLASH

            && (!addr_dataflash(dest))

#endif

            ) {

                   intrc;

 

                   puts("Copy to Flash... ");

 

                   rc = flash_write ((char *)addr,dest, count*size);

                   if (rc != 0) {

                            flash_perror(rc);

                            return(1);

                   }

                   puts("done\n");

                   return 0;

         }

#endif

 

#ifdef CONFIG_HAS_DATAFLASH

         /*Check if we are copying from RAM or Flash to DataFlash */

         if(addr_dataflash(dest) && !addr_dataflash(addr)){

                   intrc;

 

                   puts("Copy to DataFlash... ");

 

                   rc= write_dataflash (dest, addr, count*size);

 

                   if(rc != 1) {

                            dataflash_perror(rc);

                            return(1);

                   }

                   puts("done\n");

                   return0;

         }

 

         /*Check if we are copying from DataFlash to RAM */

         if(addr_dataflash(addr) && !addr_dataflash(dest)

#ifndef CONFIG_SYS_NO_FLASH

                                      && (addr2info(dest) == NULL)

#endif

            ){

                   intrc;

                   rc= read_dataflash(addr, count * size, (char *) dest);

                   if(rc != 1) {

                            dataflash_perror(rc);

                            return(1);

                   }

                   return0;

         }

 

         if(addr_dataflash(addr) && addr_dataflash(dest)){

                   puts("Unsupported combination of source/destination.\n\r");

                   return1;

         }

#endif

 

#ifdef CONFIG_BLACKFIN

         /*See if we'r

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
esptool.py v4.5.1 Serial port COM1 Connecting...................................... A fatal error occurred: Failed to connect to ESP32: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html * 终端进程“C:\Espressif\python_env\idf5.0_py3.11_env\Scripts\python.exe 'C:\Espressif\frameworks\esp-idf-v5.0.1\components\esptool_py\esptool\esptool.py', '-p', 'COM1', '-b', '460800', '--before', 'default_reset', '--after', 'hard_reset', '--chip', 'esp32', 'write_flash', '--flash_mode', 'dio', '--flash_freq', '40m', '--flash_size', '2MB', '0x1000', 'bootloader/bootloader.bin', '0x10000', 'blink.bin', '0x8000', 'partition_table/partition-table.bin'”已终止,退出代码: 2。 * 正在执行任务: C:/Espressif/python_env/idf5.0_py3.11_env/Scripts/python.exe C:\Espressif\frameworks\esp-idf-v5.0.1\components\esptool_py\esptool\esptool.py -p COM4 -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x1000 bootloader/bootloader.bin 0x10000 blink.bin 0x8000 partition_table/partition-table.bin esptool.py v4.5.1 Serial port COM4 Connecting.... Chip is ESP32-D0WD-V3 (revision v3.1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 08:3a:8d:0d:8f:0c Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Flash will be erased from 0x00001000 to 0x00007fff... Flash will be erased from 0x00010000 to 0x0003dfff... Flash will be erased from 0x00008000 to 0x00008fff... Compressed 26384 bytes to 16453... Wrote 26384 bytes (16453 compressed) at 0x00001000 in 0.7 seconds (effective 306.1 kbit/s)... Hash of data verified. Compressed 185408 bytes to 97027... Wrote 185408 bytes (97027 compressed) at 0x00010000 in 2.7 seconds (effective 541.8 kbit/s)... Hash of data verified. Compressed 3072 bytes to 103... Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 524.5 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin...
05-25

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值