none
Ethernet connection with Platform Builder in Virtual machine to enable KITL debugging RRS feed

  • Question

  • Hi all,

    Is that possible to use 'Ethernet kernel transport' via connecting PB project in Virtual machine with a target device?

    I know the mac address on my target device as well mac address on my host/VM, and I requested static IP for target device and VM and set them under the same subnet and router ip.

    Just like what people did without VM, but I can not get device from Target->Connectivity options. Any configuration I may miss during the setup?

    Another question: I don't use Ethernet to flash the eboot and image, instead, eboot is flashed over serial and image flash over SD Card. I want to connect PB with device to enable KITL, to get more kernel level debug log to debug my BSP. Is this a right approach to debug? 

    Thanks,

    Xuke

    Thursday, October 3, 2019 9:04 PM

All replies

  • If you bridge your Ethernet in your VM there should not be any problem to connect to your device (as long as your PC and the device are on the same subnet of course).

    In VirtualBox this looks like this:

    

    You need to enable KITL in your kernel image and get the KITL connection activated (eg by creating a little program that generates an exception) so you can connect to PB.

    It would of course be better to simply upload your debug kernel image with KITL enabled from PB. Any reason why you can't do that?


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Friday, October 4, 2019 5:11 AM
    Moderator
  • Hello Michel,

    Thanks for your reply. I  still got some problems when connecting target device with PB. I used bridged setting in VM, and verified that VM can ping the host, as well as the target device. 

    On the device side, I set the ip address, mask address, and mac. it shows in the log file:

    pArgs->devLoc.IfcType.... 0
    pArgs->devLoc.LogicalLoc. 0x15000000
    pArgs->devLoc.PhysicalLoc 0x0
    pArgs->devLoc.Pin........ 0
    pArgs->ip4address........ 1
    pArgs->mac............... 0xDCF8 0x287A 0xF2A9
    pDevice->Name............  s
    pDevice->ifcType......... 0
    pDevice->id.............. 0x15000000
    pDevice->resource........ 0
    pDevice->type............ 2
    pDevice->pDriver......... 0x83642000
    g_kitlLock = 0x83689DB0
    User msg: 'OEMKitlInit() gets call'   // user msg
    MAC address not found in EEPROM!!  using the mac address from the settings
    KITL: *** Device Name VAR-OM37-43506 ***
    KITL: using sysintr 0x13
    KITL will run in interrupt mode
    VBridge:: built on [Oct  1 2019] time [17:59:00]
    VBridgeInit()...TX = [16384] bytes -- Rx = [16384] bytes
    Tx buffer [0x83681CA0] to [0x83685CA0].
    Rx buffer [0x83685CC0] to [0x83689CC0.
    VBridge:: NK add MAC: [F8-DC-7A-28-A9-F2]
    User msg: '#ifdef KITL_ETHER, OALKitlEthInit() gets called' // user msg
    Connecting to Desktop


    While in the PB side, I don't see any active target devices in the list. And "Device Status" download shows:

    Waiting for download request from device...

    Could you please advise where may go wrong to get the device connnected? Thanks

    Best Regards,

    Xuke




    • Edited by kyan91 Monday, October 7, 2019 7:25 PM
    Monday, October 7, 2019 6:59 PM
  • ip4address = 1??

    The MAC address is also wrong. You can't set the highest bit because that's multicast.

    Set the MAC address to 00:11:11:11:11:11 for your test and either assign a valid IP address or enable DHCP.

    Which board is this?


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Monday, October 7, 2019 7:46 PM
    Moderator
  • pArgs->ip4address........ 1   // where is this ipaddr = 1?
    
    KITL_RETAILMSG(ZONE_INIT, ( "pArgs->ip4address........ %s\r\n",   OALKitlIPtoString(pArgs->ipAddress)
    
    
    pArgs->kitl.ipAddress    = g_bootCfg.ipAddress;
    // from value of g_bootCfg.ipAddress
    
    
    L'6', L"Set IP address", OALBLMenuSetIpAddress,
            L"Device", &g_bootCfg.ipAddress, NULL
    // g_bootCfg.ipAddress from user input
    

    I manually set ip/ mask and mac for device in the menu and I attached this network settings from device:
    ---------------------------------------------------------------------------- ----
     Main Menu
    ---------------------------------------------------------------------------- ----
     [1] Show Current Settings
     [2] Select Boot Device
     [3] Select KITL (Debug) Device
     [4] Network Settings
     [5] SDCard Settings
     [6] Set Device ID
     [7] Save Settings
     [8] Flash Management
     [9] Enable/Disable Boot Loader Menu LOCK
     [a] Select Display Resolution
     [b] Select Boot Partiton
     [0] Exit and Continue
    
     Selection: 1
    
     Main:
      Boot device:   NK from NAND
      Debug device:  LAN9115 MAC
      Retail Msgs:   disabled
      Device ID:     0
      Display Res:   LCD  480x640 60Hz
      Flashing NK.bin:   disabled
      Flashing Switch:   enabled
      SD Boot Partition  [0x0]
    
     Network:
      KITL state:    enabled
      KITL type:     active
      KITL mode:     interrupt
      DHCP:          disabled
      IP address:    10.140.25.253
      IP mask:       255.255.255.0
      IP router:     0.0.0.0
      Eth MAC Addr:  f8:dc:7a:28:a9:f2 (Boot settings)
      VMINI:         enabled
      Note: USBFN RNDIS MAC Addr cannot be changed.

    The board is VAR-SOM-OM37.


    • Edited by kyan91 Monday, October 7, 2019 8:40 PM
    Monday, October 7, 2019 8:01 PM
  • Change the MAC address as per my instructions.

    Change %s in your IP address print string to "%S" (capital S).


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6

    Monday, October 7, 2019 9:14 PM
    Moderator
  • Thanks Michel,

    1. %S" (capital S) gives us a right ipv4adresss displayed. Thanks.

    2. we changed the mac and get KITL connected, but please be aware that the mac we used is found on board sticker from vendor. We assume after the debugging done, we need to change the it back and make a clean build, right?

    3. After having KITL enabled, our next step is to debug why our system is hung after OEMInit(). The device debugger is in waiting state and we are not able to add any breakpoints nor change CE debug Zones. Do we need to build the system in debug mode? Do you have any debugging suggestions?

    from serial port:

    Launch Windows CE image by jumping to 0x80010820...
    Windows CE Kernel for ARM (Thumb Enabled)
    +OEMInit
    OAL: CPU revision 0x12:VAR-OM37
    OAL: CPU L2 Aux register 0x400042
    ****Profiler Build****
    ---High Performance Frequency is 25999313 hz---
    DeviceId................. VAR-OM37-
    pArgs->flags............. 0x29
    pArgs->devLoc.IfcType.... 0
    pArgs->devLoc.LogicalLoc. 0x15000000
    pArgs->devLoc.PhysicalLoc 0x0
    pArgs->devLoc.Pin........ 0
    pArgs->ip4address........ 10.140.25.253
    pArgs->mac............... 0x1100 0x1111 0x1111     
    pDevice->Name............  s
    pDevice->ifcType......... 0
    pDevice->id.............. 0x15000000
    pDevice->resource........ 0
    pDevice->type............ 2
    pDevice->pDriver......... 0x83642000
    g_kitlLock = 0x83689DB0
    MAC address not found in EEPROM!!  using the mac address from the settings
    KITL: *** Device Name VAR-OM37-4369 ***
    KITL: using sysintr 0x13
    KITL will run in interrupt mode
    VBridge:: built on [Oct  8 2019] time [11:38:12]
    VBridgeInit()...TX = [16384] bytes -- Rx = [16384] bytes
    Tx buffer [0x83681CA0] to [0x83685CA0].
    Rx buffer [0x83685CC0] to [0x83689CC0].
    VBridge:: NK add MAC: [0-11-11-11-11-11]
    Connecting to Desktop
    KITL: Connected host  IP: 10.140.25.252  Port: 63295
    KITL connected with Desktop

    from KITL:

    (Corecon) Download initiated...
    (Corecon) Waiting to begin download...
    (Corecon) Download complete.
    (Corecon) Download complete.
          0 PID:0 TID:2 
          0 PID:0 TID:2 
          0 PID:0 TID:2 
          0 PID:0 TID:2 
          0 PID:0 TID:2 -OEMInit

    Tuesday, October 8, 2019 10:41 PM
  • Yes, you need to build a debug version of your kernel for efficient debugging.

    You can't break using KITL in OEMInit, so you really need JTAG to debug that early in the boot process.

    To stop the code from running at the start of OEMInit, insert a tight loop:

    for (;;);

    Then boot the kernel and connect your JTAGger. Break and you will be in the loop. Set the PC to just after the loop and use JTAG to step-debug and see what is going wrong in OEMInit.

    If you don't have JTAG then you will need to instrument the code in OEMInit to, for instance, toggle a GPIO (so you can count till where you get) or, once you've past the call to KITL init in OEMInit, you can use RETAILMSGs to output info about progress.

    As far as the MAC goes; can you change your print out of the MAC to show the bytes in proper order? Something like:

    PUINT8 pMAC = (PUINT8)&macaddress[0];
    
    RETAILMSG(1, (L"MAC address: %02X-%02X-%02X-%02X-%02X-%02X\r\n", pMAC[0], pMAC[1], pMAC[2], pMAC[3], pMAC[4], pMAC[5]));
    From what I can see now, the MAC looks good and should work. I'm suspecting you are applying the MAC somehow in the wrong order, causing either of the lowest 2 bits of the 1st octet to be set.


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog: https://guruce.com/blog

    GuruCE
    Microsoft Embedded Partner
    NXP Proven Partner
    https://guruce.com
    Consultancy, training and development services.

    Interested in WEC on i.MX6?
    Get the only 100% stable and best performing i.MX6 BSP for WEC7 and WEC2013 here: https://guruce.com/imx6




    Tuesday, October 8, 2019 11:10 PM
    Moderator