• AVR Freaks

Harmony TCP/IP not getting IP address

Author
SScheiff
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2017/10/14 10:55:10
  • Location: 0
  • Status: offline
2018/07/06 13:23:24 (permalink)
0

Harmony TCP/IP not getting IP address

I am using a PIC32MZ EF Starter kit (DM320007) and Harmony 2.04. I am trying to get the TCP/IP webserver example going and I am having a few issues.
 
I am able to compile and run the code. In app.c in the APP_Tasks() the state machine appears to show that everything is initializing fine and I get to APP_TCPIP_TRANSACT, but it never seems to get an IP address. When I check the router, it isn't present and the Discoverer software can't find it either. The lights at the RJ45 connector come on as well as the switch. I currently don't have the ability to do the UART bridge debug. I don't think it is the hardware as this is happening on two development boards. It is using the LAN8740 chip. Most likely a setting in harmony that I am not seeing or aware of.
 
Any help would be appreciated.
 
Regards,
 
Sebastian
#1
rainad
Moderator
  • Total Posts : 1225
  • Reward points : 0
  • Joined: 2009/05/01 13:39:25
  • Location: 0
  • Status: offline
Re: Harmony TCP/IP not getting IP address 2018/07/06 15:49:23 (permalink)
3 (1)
Without a console or other indication of what's going on, try to set a static IP address that's valid for your network and then see if you can ping the board using that address.
Also you could look with wireshark and see what IP address is used by the board or what router address it's looking for.
I'd recommend you use MHC and regenerate your project to include a (serial/USB) console, you'll get some messages that will help to understand what's going on.
 
#2
BillP
Super Member
  • Total Posts : 337
  • Reward points : 0
  • Joined: 2014/09/28 07:53:35
  • Location: CA
  • Status: offline
Re: Harmony TCP/IP not getting IP address 2018/07/07 13:56:00 (permalink)
0
Which web server example?  The web_net_server_nvm_mpfs demo example?  That one does work out-of-the-box with the MZ EF Starter Kit.  So, a few possibilities:
  • You modified the example code
  • You modified the MHC configuration
  • You are not on the correct network -- the built-in static IP is 192.168.100.115
  • You tried http, but the example uses https
  • You are using Google Chrome (or other browser that does not recognize the demo authentication)
If these do not highlight your problem, send me a private message.
#3
SScheiff
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2017/10/14 10:55:10
  • Location: 0
  • Status: offline
Re: Harmony TCP/IP not getting IP address 2018/07/09 08:12:14 (permalink)
0
Hi Bill,
Thank you very much for taking the time. I tried sending you the following as a PM, but it said I did not have access.
 
I loaded the pic32_eth_web_server example from Harmony 2.04. I selected the Pic32MZ starter kit under the BSP configuration. I did have to configure the clock and enable the Ethernet bits (FETHIO) to get to where I am now. For some reason the switches and USB +3.3V enable bits were on the wrong pins. I am assuming that is because the starter kit uses the 144 pin chip instead of a lower count version. I did have to comment out the LED, switch and USB enable parts of the example. So yes, I did somewhat modify the code. To your questions:
 
  • [
  • [
  • [
  • [
  • [
    • Haven't got that far.
     
    I am pretty sure this is a configuration issue, but don't know what. I am trying to get the UART to USB bridge to work so that I can get some of the debug messages. By default it was trying to connect to the LAN8740 using MIIM. I tried MIIM and RMII with no success. It seems to be able to initialize fine as I am getting to the APP_TCPIP_TRANSACT in the app.c state machine of the demo.
     
    I am new to Harmony so this is a bit frustrating as this should be simple given I am using their own hardware.
     
    Thanks for the help,
     
    Sebastian
  • #4
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 08:20:06 (permalink)
    0
    For some reason it didn't like the cut in past in my previous post. Here it is again:
    • You modified the example code
      • See above
    • You modified the MHC configuration
      • See above
    • You are no on the correct network -- the built-in static IP is 192.168.100.115
      • Tried to do a static IP address and changed it to a valid address on the network with no success. Shouldn't even matter is I am trying DHCP?
    • You tried http, but the example is https
      • Haven't even been able to get an IP address assigned and for it to show up on the network.
    • You are using Google Chrome (or other browser that does not recognize the demo authentication)
      • Haven't got that far.
    #5
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 12:45:06 (permalink)
    0
    I wasn't able to get the USB/UART interface to work but I did some debugging with breakpoints. The interface seems to initialize just fine. Looking at TCPIPStackIsRunState(void), it goes through and sets the MAC process flags and returns a true. For whatever reason though I get an IP address of 0.0.0.0.
    #6
    rainad
    Moderator
    • Total Posts : 1225
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 13:11:44 (permalink)
    3 (1)
    If I remember correctly, the only reason for which to stick to a 0 IP address is because the link is down.
    Otherwise DHCP has a timeout and it will switch to the static IP address.
    Can you please check the value reported by TCPIP_STACK_NetIsLinked()?
    You may need to add it in your code.
    Is the PHY blinking happily as there's traffic in your network, LED's both on?
     
    #7
    BillP
    Super Member
    • Total Posts : 337
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 13:55:42 (permalink)
    3 (1)
    In the TCP INIT, you will go through the TCPIP_STACK_Status(sysObj.tcpip) check until the stack is ready.  Then you will get a 0.0.0.0 address returned until the DHCP times out, then you will see the 192.168.100.115.  I think my timeout is 4 seconds, so I see the static address 4 seconds after startup.  You may be closer than you think. :)
    #8
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 14:01:37 (permalink)
    0
    Just checked and it returns a "true" and the lights are blinking like everything is working.
    #9
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 14:11:50 (permalink)
    0
    Bill,
    I just let it run for a minute and it is still 0.0.0.0, timeout is set for 2 seconds. I put a break point in that function and it keeps returning the result from "return TCPIP_STACK_NetworkIsLinked(pNetIf);".
     
    Thank you all for helping.
     
     
    #10
    rainad
    Moderator
    • Total Posts : 1225
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/09 15:22:41 (permalink)
    5 (1)
    The web_server_nvm_mpfs demo in the Harmony v2.04 comes with the USB console enabled.
    Can you please insert an USB cable in the micro USB connector on the ESK, connect a terminal (TeraTerm, putty, etc.) hit CR and see if you have a console working.
    If so, please execute "netinfo" and "macinfo" commands from the console and post the result.
    If you cannot have the console running, then let the board run for a while and then halt it and take a look in the debugger to the ETH controller registers. Take a snapshot and maybe we can figure something out from that.
     
    #11
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/10 07:53:48 (permalink)
    0
    [image]C:\Users\U310181\Desktop\Registers.jpg[/image]
     
    I attached a screen shot of the registers. The USB debug console is not working for me. My computer is registering and finding the device and I can open a console to the COM port in  TeraTerm, but nothing shows. I am also unable to send any commands. IT just doesn't let me enter anything.
     
    A side issue, the project seems to hit a "Run Time Error" but can't give me a location. This happens after it runs for about a minute. I can press "Run" again and it will run for another minute before having the same error.
     
    In the mean time, I downloaded harmony 2.06 and I will try to compile the project out of that library as it should be untouched. Maybe that will get me somewhere.
     
    Thanks as always,
     
    Sebastian
    #12
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/10 07:55:16 (permalink)
    0
    Well, the photo didn't show. I will attach it as a file.

    Attached Image(s)

    #13
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/10 08:35:25 (permalink)
    4.67 (3)
    Well, I ran the example with the fresh install of Harmony 2.06 and it compiled and is running just fine. I have no idea what I did to corrupt the MHC but somehow I did. I guess I will need to make sure to check it into SVN so that I can always revert back. Thank you both for your time and effort, I really appreciate it.
     
    Sincerely,
     
    Sebastian
    #14
    MVDG66
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2018/07/15 23:44:21
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/16 23:04:42 (permalink)
    0
    Hello Sebastian,
     
    I am facing the same problem with the same board ( DM320007-c).
    Unfortunately, installing the last Harmony frame work as you did, didn't solve the issue.
    I just wonder if you could send me your project or at least your HEX file so I could validate my hardware is working ok.
     
     
    Kind Regards
     
    Marc
    #15
    SScheiff
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2017/10/14 10:55:10
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/17 11:49:29 (permalink)
    5 (1)
    Hi Marc,
    I don't think it was anything that the latest version fixed. I think somehow I managed to corrupt the mhc configuration. It may have happened when I switched between the PIC32MX and MZ. Make sure that you select the PIC32mz_ef_sk configuration under Production->Set Project Configuration from a fresh install.
     
    I can't attach the file to this post. PM me with your email and I will send it to you.
     
    Regards,
     
    Sebastian
    #16
    MVDG66
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2018/07/15 23:44:21
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/18 04:38:01 (permalink)
    3 (1)
    Hi Sebastian,
     
    you are perflectly right, I haven't selected the right configuration.
    It's working now.
     
    Thank you very much for your help and quick answer.
    Your feedback helped me to find out the mistake.
     
     
    Kind Regards
     
    Marc
     
     
     
     
    #17
    nigelwright7557
    Super Member
    • Total Posts : 308
    • Reward points : 0
    • Joined: 2006/11/06 08:15:51
    • Location: 0
    • Status: offline
    Re: Harmony TCP/IP not getting IP address 2018/07/20 19:36:42 (permalink)
    0
    SScheiff
    Hi Marc,
    I don't think it was anything that the latest version fixed. I think somehow I managed to corrupt the mhc configuration. It may have happened when I switched between the PIC32MX and MZ. Make sure that you select the PIC32mz_ef_sk configuration under Production->Set Project Configuration from a fresh install.
     
    I can't attach the file to this post. PM me with your email and I will send it to you.
     
    Regards,
     
    Sebastian


    I found with some of my projects harmony started up with some parts of the clock setup as almost random settings. Most of it was ok except for a couple of settings I had to fix.
     
     
    #18
    Jump to:
    © 2019 APG vNext Commercial Version 4.5