Migrating Amazon FreeRTOS example from curiosity board to starter kit

aroth425 wrote on May 01, 2019:


I’ve successfully deployed both the ethernet and wifi examples from the amazon freertos github to the curiosity board (pic32mz2048efm100). I’m attempting to migrate the examples to the starter kit (pic32mz2048efm144); however, I’m having difficulties in doing so.

For both the bootloader and demo project, I’ve changed port configurations from the 100 pin chip to the 144 pin chip (in system_config.h), from uart1 to uart2 for debugging output (which works fine), and the ethernet from LAN8720 to LAN8740 (though I’ve noticed leaving lan8740 on the curiosity still works despite it using lan8720).

With these changes, the github examples successfully built and loaded to the starter kit, then I receive the same log output from the bootloader log (so I assume this portion to be correct). However, the one output that is different on the demo portion is that the DHCP never successfully operates on the starter kit (it appears to timeout). The remaining output is similar to the original but fails to connect to the mqtt broker because DHCP never returns.

I first thought that maybe it’s an issue with the ethernet port on the starter kit; however, I ran the harmony example “berkeley_tcp_client”, which successfully deployed and returned an http request. So I then looked at the difference in the configurations between the amazon freertos example and the berkeley_tcp_client (particularly in system_config.h and system_init.c), but nothing seemed to be apparently different.

Any idea on why this isn’t working? I assumed this to be an easy migration and have a feeling that it’s one or two configurations that I’m looking over.

Thank you in advance to any assistance.

Edited by: aroth425 on May 1, 2019 8:01 AM

Edited by: aroth425 on May 1, 2019 8:06 AM

DanG-AWS wrote on May 01, 2019:

Hello, to confirm, when you test successfully, it’s using the Curiosity board with our MQTT Hello World demo. In that case, are you using Wi-Fi or Ethernet? From what you describe, it sounds like Ethernet would be the better apples-to-apples comparison.

Also, Ethernet is likely to make it easier for you to take network packet sniffs (e.g. using Wireshark) for debugging. With the Starter Kit, before DHCP fails (it times out?), what packets do you see to and from the board?

aroth425 wrote on May 02, 2019:

Hi, thank you for the quick response.

I am first attempting to migrate the ethernet project to the starter kit. I’m wondering the possibility that maybe the configuration pins for the daughter ethernet board on the curiosity and starter kit are different (particularly the interrupt pin which is why I don’t receive a response). However, I didn’t see where the ethernet pin configurations were explicitly declared as it was for the winc1500 wifi chip over spi.

When I used wire shark (admittedly this is my first time using it) with the starter kit, there was constant DHCP Discover Transaction requests, followed by a few MDNS Standard query, but from what I can see, it never returns an acknowledgement from the DHCP request like it did with the curiosity board.

DanG-AWS wrote on May 06, 2019:

Assuming that your “baseline” Curiosity board test is working, then in Wireshark you should see an outbound broadcast UDP request for DHCP. You should then see the unicast UDP response from your router. After that, if the app is trying to open a connection via DNS name (for example, your AWS IoT endpoint), you’ll see the UDP request and response for DNS. Finally, you’ll see the TCP connect to the AWS IoT gateway, etc.

When you switch to the Starter kit, if you see the outbound DHCP request, but you don’t see any response packet after that, it makes me suspect that the DHCP request packet is malformed. When you view the Curiosity versus Starter kit DHCP request packets in Wireshark, do they look equivalent?

As a sanity check, do you see the two boards using different MAC addresses? Are you sharing a single Ethernet PHY part between the two boards?