dnw linux version

来源:互联网 发布:nginx和apache的区别 编辑:程序博客网 时间:2024/06/07 05:44
  • dnw in linux
    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
  • 原创粉丝点击