[mini2440]mini2440 factory

1.Modify uboot

1.Using vscode to view source code in win7.

2. common --> cmd_menu.c

void main_menu_usage(void) add code as below:

    printf("[0] TFTP default setting.\r\n");
    printf("[1] Xmodem Download uboot to nand flash.\r\n");
    printf("[2] Xmodem Download kernel to nand flash.\r\n");
    printf("[3] (Error)Xmodem Download fs to nand flash.\r\n");
    printf("[4] TFTP Download uboot to nand flash.\r\n");
    printf("[5] TFTP Download kernel to nand flash.\r\n");
    printf("[6] TFTP Download fs to nand flash.\r\n");
    printf("[7] (Recommend)USB Download uboot to nand flash.\r\n");
    printf("[8] (Recommend)USB Download kernel to nand flash.\r\n");
    printf("[9] (Recommend)USB Download fs to nand flash.\r\n");

void menu_shell(void) add code as below:

            case '0':
                strcpy(cmd_buf, "setenv serverip 192.168.220.129; setenv ipaddr 192.168.220.2; setenv gatewayip 192.168.220.1; saveenv");
                printf(cmd_buf);
                run_command(cmd_buf, 0);
                break;
            case '1':
            case '2':   
            case '3': 
            case '4':   
            case '5': 
            case '6': 
            case '7':   
            case '8': 
            case '9': 
                {
                    const unsigned long ram_addr = 0x30000000;
                    if (c == '1' || c == '2' || c== '3')sprintf(cmd_buf, "loadx %x", ram_addr);
                    else if (c == '4')sprintf(cmd_buf, "tftp %x vboot.bin", ram_addr);
                    else if (c == '5')sprintf(cmd_buf, "tftp %x zImage", ram_addr);
                    else if (c == '6')sprintf(cmd_buf, "tftp %x rootfs.img", ram_addr);
                    else if (c == '7' || c == '8' || c== '9')sprintf(cmd_buf, "usbslave 1 %x", ram_addr);
                    printf(cmd_buf);
                    run_command(cmd_buf, 0);

                    unsigned long nand_start = 0;
                    unsigned long nand_end = 0;
                    if (c == '1' || c == '4' || c == '7')nand_start = 0,nand_end = 4 * 1024; // 4k to download vboot.
                    else if (c == '2' || c == '5' || c == '8')nand_start = 0x60000,nand_end = 0x560000; // Parameter come form vboot source code.
                    else if (c == '3' || c == '6' || c == '9')nand_start = 0x560000,nand_end = 0x40560000; // Parameter see form kernel run display mesage in consloe.
                    if (c == '3' || c == '6' || c == '9')
                        sprintf(cmd_buf, "nand erase %x %x; nand write.yaffs %x %x $(filesize)", nand_start, nand_end, ram_addr, nand_start);
                    else 
                        sprintf(cmd_buf, "nand erase %x %x; nand write.jffs2 %x %x $(filesize)", nand_start, nand_end, ram_addr, nand_start);
                    printf(cmd_buf);
                    run_command(cmd_buf, 0);
                    break;
                }

2. Using secury software to download

Note: mini2440-20110421 is a DVD download from official site.

Norflash modify form: mini2440-20110421\OpenSourceBootloader\u-boot-1.1.6-FA24x0.tar.gz

nandflash boot:           micro2440-20100609\images\linux\vboot.bin

nandflash kernel:        micro2440-20100609\images\linux\zImage_W35

nandflash fs:               micro2440-20100609\images\linux\root_qtopia-128M.img (Because the newest one mini2440-20110421 is too big)

3.usb download

Refer: https://blog.csdn.net/sinat_24088685/article/details/50992704

1.Download win7-64 DNW driver https://download.csdn.net/download/tanhao199406/8671741

2.解决64位windows的数字签名问题的软件:dseo13b.exe https://download.csdn.net/download/tanhao199406/8671725

a.click "Next"

b.click "ok"

c.click "next"

d.Input driver address.

e. click "ok", then reboot the computer.

f.reopen dseo13b.exe to sign.

g.Install the DNW for win7-64bit driver. Succeful as below.

i.Using "mini2440-20110421\windows平台工具\dnw\dnw.exe" to downlaod file.

4. (not recommend)use serial or tftp

If use serial, note below:

If use TFTP, PC need do open a TFTP server, suggest create in win7,  see appendix.

Appendix 1 TFTP server in win7

1.Download from official site: http://tftpd32.jounin.net/tftpd32_download.html Then install.

(to be continue ...)

Appendix 2 TFTP server in ubuntu.

NOTE: If occur "checksum bad" error, the reason si because virtual machine using 'nat' way to connect internet. So we need to change to "briage".

1.Install TFTP.

sudo apt install tftp-hpa tftpd-hpa

2.Creat directory.

cd 
mkdir tftpboot
cd tftpboot
vim test.txt

3.Config

cd /etc/default/
vim tftpd-hpa

tftp-hpa is:

# /etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="~/tftpboot" # 这里是你的tftpd-hpa的服务目录,这个想建立在哪里都行
TFTP_ADDRESS=":69"
TFTP_OPTIONS="-l -c -s" # 这里是选项,-c是可以上传文件的参数,-s是指定tftpd-hpa服务目录,上面已经指定 

4.reset

sudo service tftpd-hpa

5.test

$ tftp localhost
tftp> get test.txt
tptp> put text1.txt

(end)

猜你喜欢

转载自blog.csdn.net/zhuohui307317684/article/details/85236605