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.

AM6422: AM64X-EVM: LWIP Flash not working

Part Number: AM6422
Other Parts Discussed in Thread: CCSTUDIO

Hello, I have run into an issue while testing a program that is built on 'enet_lwip_cpsw' example for A53_0. I have stripped out the example to only have what I need and have tested the functionality throughout the whole process to ensure the application works as intended (pinging from another device works). 

I have been conducting all the testing in TI CCS by "Right Click Project -> Debug Project" which has been working without any issues. Once, I move to testing the application with "Right Click Project -> Flash Project" the application stops working, but when I go back to debug it works. 

Using a logic analyzer, I was able to narrow it down to this portion of the code within "test.c":

test_netif_init(void)
{
  struct netif * netif[ENET_SYSCFG_NETIF_COUNT];
  ip4_addr_t ipaddr, netmask, gw;
  uint32_t i;

  ip4_addr_set_zero(&gw);
  ip4_addr_set_zero(&ipaddr);
  ip4_addr_set_zero(&netmask);

  while(hlwipIfApp==0){
      hlwipIfApp = LwipifEnetApp_getHandle();
      sys_msleep(50);
  }
   //passes up to this point
  
  for (i = 0U; i < ENET_SYSCFG_NETIF_COUNT; i++)
  {
      LWIP_ASSERT("More IP allocated than reserved" , 0 < IP_ADDR_POOL_COUNT);
      ip4_addr_set(&ipaddr, &gStaticIP);
      ip4_addr_set(&gw, &gStaticIPGateway);
      ip4_addr_set(&netmask, &gStaticIPNetmask);
}
    
//gets stuck here
netif[0] = LwipifEnetApp_netifOpen(hlwipIfApp, NETIF_INST_ID0, &ipaddr, &netmask, &gw);

I reverted back to the original example and have encountered the exact same issue that with debug it works but with flash it does not. 

What I have tried and did not work:
1. Hardcoding the ip address directly without any variables.
2. Hardcoding systems wait before & after the ip addr set to give time for system to initialize.
3. Changed memory configuration parameters for DDR (it could be some memory access issue).
4. Increased stack and heap as well as how much memory is allocated within DDR for the application.

From this I have these questions:
1. What is the most likely cause for the occurrence of this error?
2. What other troubleshooting strategies you advise attempting to fix this issue? 

Thank you for your time.

  • Hi Daniil,

    Can you please share with us the details of which version of MCU+ SDK and CCStudio debugger you are using?

    Once we have this information, we will try to reproduce this issue in our test bench, and will let you know the results.

    Thanks and regards,
    Teja.

  • Hi, thank you!:

    TI CCS 20.4.1.00004
    MCU+ SDK AM64x 12-00-00-27

  • Hi Daniil,

    Thank you for the details. I will update the thread once I run the test from ourside.

    Regards,
    Teja.

  • Hello, I was able to find the issue for this. Within the linker the "rdimon.specs" was being linked that was pulling a sub library that was redirecting all the IO to the host device through the debugger. Once, I flashed the application and it attempted to conduct IO tasks through the debugger once more and debugger wasn't present the CPU experienced a fault, thus application was stopping. 

    After changing the parameter, "--specs=rdimon.specs"  to "--specs=nosys.specs" the application started working as intended during flash. Although, I still would like to see you what you find out, as within the program there were IO calls before the below function call, but the program wasn't halting at them. It only got stuck within the:

    netif[0] = LwipifEnetApp_netifOpen(hlwipIfApp, NETIF_INST_ID0, &ipaddr, &netmask, &gw);

  • Hi Daniil,

    The --specs shouldn't effect the behaviour like you described. It is expected that nosys.specs would provide empty stubs for the debugger, and this allows for connecting even without a debugger involved. This could lead to the print functionality not being available in some setups. But experiencing similar behaviour shouldn't happen with rdimon. 

    Thanks for bringing this issue, which will help in finding the root cause easier.

    Thanks and regards,
    Teja.

  • Hi Teja, thank you for clarifying! 

    Has there been any updates on what's at the core of this issue?