none
Copying new nk.bin file to CF card RRS feed

  • Question

  • Hi all,

     

    I have a very strange issue with trying to copy new nk.bin file to my biosloader bootable cf card (FAT32).

    What I am trying to do is copy new nk.bin file (for  testing I am using the same nk.bin file that is already on the cf card) to CF card.

    First I tried copying ne nk.bin on my PC using card reader (2 different ones)...CF card with new nk.bin doesn't load. The windows ce 6.0 splash screen shows up but progress bar doesn't start moving and nothing happens.

     

    Then I created bootable CF card again which works. Put it in my device (advantech pcm 3353) booted it to windows ce 6.0 and copied same nk.bin from USB stick to CF card with explorer. Doing it this way it worked. Cf card with new nk.bin loaded fine.

     

    Then I tried the way I need it to work. From my application (software upgrade). I put a button with this functions:

    1.removing the old nk.bin

    File.Delete(System.IO.Path.Combine(StoragePath, "nk.bin"))

    File.Copy(System.IO.Path.Combine(USBPath, "nk.bin"), System.IO.Path.Combine(StoragePath, "nk.bin"), True)

     

    2.renaming old nk.bin

    File.Move(System.IO.Path.Combine(StoragePath, "nk.bin"), System.IO.Path.Combine(StoragePath, "nk.bin.bak"))

    File.Copy(System.IO.Path.Combine(USBPath, "nk.bin"), System.IO.Path.Combine(StoragePath, "nk.bin"), True)

     

    neither of this two worked. The old nk.bin was removed/deleted and new nk.bin copied to CF card, but it doesn't boot. The same as when I copied it on my PC. Splash screen shows up but nothing happens after that.

     

    Does anyone know the reason this happens?

    What can I do?

     

    Any help appreciated

    Best regards,

    Greg

     

     

     

    Monday, August 22, 2011 8:40 AM

Answers

  • Hi all,

     

    I can now confirm that system.io.File.Copy does something different than CopyFile which I invoke:


        <DllImport("Coredll.dll")> _
      Private Function CopyFile(ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Boolean) As Boolean
        End Function

    and function call:

    CopyFile(System.IO.Path.Combine(USBPath, "nk.bin"), System.IO.Path.Combine(StoragePath, "nk.bin"), False)

     

    If I do it this way in my application everything works fine.

     

    Hope this helps someone else.

    PS: someone more experienced can try and explain why CopyFile works and file.copy doesn't.


    Best regards,

    Grega

    • Marked as answer by GregaR Thursday, August 25, 2011 9:51 AM
    Thursday, August 25, 2011 9:51 AM

All replies

  • Check the serial port output so you can see the messages from the bootloader when it fails to load the new nk.bin
    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Monday, August 22, 2011 9:13 AM
  • hi Luca,

    Thanks for idea. I captured debug info over serial first with image that boots to wince. I then deployed my app, in wich I run the copy function described above and then rebooted. And again captured the text from the bootloader.

    here are few lines from the working try:

    Advantech WinCE BiosLoader Version:  2.2 (Built Dec 23 2009)

    Debug Serial Init

    SysInit: GDTBase=82499000 IDTBase=824a68c0 KData=824a1800
    Windows CE Kernel for i486 Built on Sep 25 2009 at 11:03:29
    INFO:OALLogSetZones: dpCurSettings.ulZoneMask: 0xb
    PCIBIOS:: BIOS Address static map to addr=a00e0000
    GetPicRoutingIrqTable: Start
    search_pci_bios start
    CE Ethernet Bootloader found 32Bit BIOS Entry master_bios32=a00fa3f0 bios32_call_offset=1a860 for CE/PC
    Return from First BIOS EAX=49435000 EBX=f0000,ECX=dfb4 EDX=a890
    32 PCI BIOS offset located.addr=1a890
    32 PCI BIOS Present EDX=20494350,EAX=11 EBX=f0210,ECX=df00
    +GetRoutingOption
    search_pci_routing
    search_pci_routing Entry Checksum Error @a00fdf10search_pci_routing end fails
    GetRoutingOption with buffer Size 512 bytes buffer DS80220040:addr =8249c9ea
    GetRoutingOption return SUCCESS .AH=0
    ScanConfiguredIrq with PCI Exclusive Irq Bit (wExClusive)  =8a00
    ScanConfigureIrq: BufferSize = 128 @ address 8249c9ea
    ScanConfigureIrq: for Bus=0 ,Device=11 SlotNumber=1

     

    and this is all there is in the non working one:

    Advantech WinCE BiosLoader Version:  2.2 (Built Dec 23 2009)

     

    I guess bootloader stops immediately after start.

     

    I also wrote to the advantech support. Hope they can find a problem.

     

    In the mean time I want to try copying in my app in the same way windows CE do it. Does anyone know how I can do that?

    I guess File.copy does it differently than windows ce?

     

     

    Thanks,

    Grega

     

     

    Tuesday, August 23, 2011 7:44 AM
  • Hi all,

     

    I can now confirm that system.io.File.Copy does something different than CopyFile which I invoke:


        <DllImport("Coredll.dll")> _
      Private Function CopyFile(ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Boolean) As Boolean
        End Function

    and function call:

    CopyFile(System.IO.Path.Combine(USBPath, "nk.bin"), System.IO.Path.Combine(StoragePath, "nk.bin"), False)

     

    If I do it this way in my application everything works fine.

     

    Hope this helps someone else.

    PS: someone more experienced can try and explain why CopyFile works and file.copy doesn't.


    Best regards,

    Grega

    • Marked as answer by GregaR Thursday, August 25, 2011 9:51 AM
    Thursday, August 25, 2011 9:51 AM