This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28388D: Launching the "DHCP server" service using NDK library

Part Number: TMS320F28388D


Hi,

To launch the DHCP server service on the TMS320F28388D DSP using the NDK library, I changed the "tcpEchoF2838X" example according to the explanation in the "TI Network Developer's Kit (NDK) API (SPRU524)" documentation. This explanation has been shown in the figure below. I added this configuration in the "initIP()" function in the "ndk_tirtos.c" file but whenever I run the code, neither the DHCP server (TMS320F28388D) nor DHCP client (my laptop) does not get IP and I cannot communicate between them. 

I have to mention that I ran the code in the "DHCP client" and "Static IP" modes in this way and they worked successfully. But, I am not sure whether I am doing right in the case of "DHCP server" mode. Could you please guide me on what should I do to execute properly the "DHCP server" service on the F28388D?

Best,

Alex

  • Hi Alex,

    Can you elaborate more on no communication between nodes in DHCP server mode. 

    This configuration should work. Do you see any packet transmission by f28388D (through wireshark or something similar). Or packets being received.

    In the expression window watch the ethernet low level driver debug variables to see if they are incrementing.

    Regards,

    Yashwant

  • Hi Yashwant,

    Thank you for your reply.

    Do you see any packet transmission by f28388D (through wireshark or something similar)

    With regards to packet transmission, there is no transmission. No IPs are being assigned neither to the F28388D chip (DHCP server) nor to the host computer (DHCP client). This is my main issue at this point. Below is a screenshot of “Wireshark”. A DHCP request has been sent from DHCP server to the DHCP client. However, it seems that two DHCP requests are being sent to my laptop, one “DHCP” and one “DHCPv6” which are seemingly in conflict with each other. At least, that is my understanding from this picture.

    Can you elaborate more on no communication between nodes in DHCP server mode. 

    Here is more explanation about my implementation. I have two nodes in this communication. The first one is the DHCP server which is my controlCARD board (TMDCNCD28388D) and the other one is DHCP client which is my laptop. I added the DHCP server configuration in the “initIP” function as you can see in the picture below.

    On the other hand, I set my ethernet IPv4 settings on the “Obtain an IP address automatically” mode on my laptop as the following picture.

    Then, I connect my laptop and the board via an ethernet cable. But, whenever I run the code on the board and watch SysMin module in the “Runtime Object View (ROW)” window, there is no added IP address to the network. The picture below shows this.

    But, whenever I run the code with “DHCP client” or “Static IP” configuration, this window shows a message like this:

    So, I think because the DHCP server does not get IP, the DHCP client cannot get IP too. If helpful, I could also privately share my project with you.

    In the expression window watch the ethernet low level driver debug variables to see if they are incrementing.

    To watch these variables, I included the “ethernet.h” and used several debug variables in my code. But, it shows an error in the “ethernet.h” file. I wonder if you can guide me on what should I do to watch the ethernet debug variables.

  • Hi Yashwant, 

    I just want to update you with something. In the "TI Network Developer's Kit (NDK) User's Guide" documentation (SPRU523K), we see the following explanation about the NETCTRL lib in the NDK. According to this picture and for using the DHCP server properly, I changed the version of the NETCTRL that I'm using from "min" to "full" in the linker settings.

    But, after building the project I confront this error that says there is an unresolved symbol in the "nettool_ipv4" lib. I think, solving this error can solve my issue. But, I don't have access to the source code of "nettool_ipv4" lib. I wonder if you can mention me how can I fix this error.

  • Please refer package.xs at location ndk_f2838x_3_61_01_01\source\ti\ndk\config\package.xs from line 271 and see if that helps.

    Default stack lib included in the project is ti/ndk/stack/lib/stk.aem4. You would have to change this to ti/ndk/stack/lib/stk_nat.aem4

    You can also try enabling serviceReportHook functions to debug the dhcp server service further (could be that stack size is insufficient and required to be increased).

    We cannot be debugging your code. Please feel free to reach out if there is a issue in ethernet low level drivers or examples as it is without modified.

    Thanks,

    Yashwant

  • Please refer package.xs at location ndk_f2838x_3_61_01_01\source\ti\ndk\config\package.xs from line 271 and see if that helps.

    Default stack lib included in the project is ti/ndk/stack/lib/stk.aem4. You would have to change this to ti/ndk/stack/lib/stk_nat.aem4

    Thank you for your information. I am using the full version of netctrl lib right now and I changed the stack lib and the code has been built well.

    You can also try enabling serviceReportHook functions to debug the dhcp server service further (could be that stack size is insufficient and required to be increased).

    I enabled these functions and increased both stack sizes in the code (any stack sizes related to the ndkStackThread, high priority tasks, low priority tasks, norm priority tasks, and NDK boot task) and stack size in the linker settings even up to 4096. I also enabled the DHCP server's macro in the "netsrv.h" file as the following picture and rebuilt both of the code and NDK library.

    But the problem is not solved yet and I am seeing "Service Status: DHCPS: Failed :: 000" message from "serviceReportHook" function in the ROV.

    Are there any other changes that I have to to do to run DHCP server properly? Should I change the DHCP server configuration that I have already mentioned above?

    I wonder if you guide me.

    Thanks,

    Alex

  • Hi Alex,

    Can you tell us why was the DHCP service failing before and how it was solved.

    Regards,

    Yashwant

  • Hi Yashwant,

    Sure, the problem was that we had to add the following line to the DHCP sever configuration. Note that this line was missing in the snippet provided in the NDK documentation (shared in my earlier post), despite mentioning that "The above code is all that is required when using the configuration system to invoke this service".

    netAddr.NetType = CFG_NETTYPE_DHCPS;

    Regards,

    A.