『转』dnw linux version

    1. Use xterm as a serial terminal. In Fedora 9
      1. use "yum install screen " to install screen package.
      2. Plug the USB-UART cable, see if there is a ttyUSB0 in /dev
      3. Enter "screen /dev/ttyUSB0 115200,cs8,-ixon,-ixon,istrip " to connect to USB-UART.
      4. Screen as Serial Terminal
    2. Download the driver and dnw application from dwn_linux.rar
    3. Unzip the rar, you will get 2 folder.
      1. dnw - dnw application for download image to device
      2. secbulk - Sumsung SMDK driver.
    4. Build dnw application.
      #cd dnw
      #gcc -o dnw dnw.c
    5. Build driver.
      #cd secbulk
      #make -C /lib/modules/`uname -r`/build M=`pwd` modules
      dnw in linux
    6. Fix for your product 
      1. Our product ID is different with origin release, change the product ID in secbulk.c
        // { USB_DEVICE(0x5345, 0x1234)},
        { USB_DEVICE(0x4E8 , 0x1234)},
      2. Change the RAM address from 0x32000000 to 0xC0000000 in dnw.c
        // *((unsigned long*)file_buffer) = 0x32000000; //load address
        *((unsigned long*)file_buffer) = 0xC0000000 ; //load address
      3. Add checksum after for loop in dwn.c
        *((unsigned short*)(file_buffer + file_stat.st_size + 8)) = sum;
      4. Change the block size to 512, because the block size is define to 512 in secbulk.c. If you don't change the size, small image download is ok, but large image like kernel, file system will not success.
        // size_t block_size = remain_size / 100;
        size_t block_size = 512 ;
    7. Start to download
      1. Insert the USB-UART cable, and see if you get the ttyUSB0
        #cd /dev
        #ls
      2. Set the xterm to serial console,
        #screen /dev/ttyUSB0 115200,cs8,-ixon,-ixon,istrip
      3. Power on the MB
      4. Load the driver,
        #cd secbullk
        #insmod secbulk.ko
        Use dmesg to see if our driver can find the MB
        #dmesg

        You need to see the "endpoint found!", if you can't see this , change your product id and do it again.
        #secbulk:bulk out endpoint found!
      5. Hit key to enter the uboot mode, and enter dnw to wait image transfer
        #dnw
      6. Enter the dnw folder, and use dnw application to transfer image
        #cd dnw
        #./dnw your_image_path
  • Reference
    1. S3C2440A
    2. Detecting Hardware Insertion and/or Removal
    3. Device Information
    4. HIDAche - An Exercise in Hardware/Software Integration
    5. Linux USB
    6. bulk usb demo
    7. dnw in linux
    8. dnw in linux - source code download
    本文出处:http://chengchungchun.spaces.live.com/blog/cns!EEDBBE1B9C2FFA9D!1484.entry
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值