cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H725ZGT6 Does not communicate over Ethernet with lwIP & FreeRTOS enabled

jackmh
Associate II

 

Hello, I'm having an issue with my STM32H725ZGT6, I'm trying to get basic communication with it working through ethernet, lwIP, and FreeRTOS (I'm just going to call this configuration 'eth' going forward). Specifically all of my code compiles and runs just fine (with a blinking status LED for good measure), but no matter what I cannot get a single packet from it.

Before I got started with eth on my actual board, I of course tried to get a proof of concept working on the most similar development board I could find which was the STM32H723 Nucleo board. Although getting all of those pieces of software to work was a hassle (I followed and used these templates), I was able to communicate with the board pretty reliably afterward. My baseline for this is setting the board to a static IP (192.168.050.010) and subnet mask (255.255.255.000), double checking the ICMP module is enabled, setting my PC's ethernet adapter to the same subnet mask and IP to 192.168.050.020, double checking the default task is 256+ words, and adding a blinking LED to the main loop.

Now my actual board with the H725 chip has had a few hardware issues that I've resolved, I'll list them here just to be thorough:
1. Not all of the LDO supply pins were actually routed, fixed just by carefully bridging those pins
2. The boot0 pin was tied high instead of low, just desoldered a resistor
3. The high-speed external oscillator had the wrong pad layout, so I just switched to using the HSI (the internal oscillator)

While I'm still checking everything to make sure, I'm pretty confident that my ethernet transceiver is also wired up correctly since the status LEDs do flash when I hook it up to my PC and I've used the same schematic on an F4 board which worked. The only thing is, to save space on the board I am using a 4-pin JST connector with just the TX+, TX-, RX+, and RX- pins hooked up. I've taken this into account and made an ethernet cable (one side RJ-45, the other a 4-pin JST) with TX pins on one side going to RX pins on the other.

Software-wise, I've tried just about every configuration I can. I started by trying to replicate the steps in the ST-provided examples I linked earlier, but fearing I might've missed something I've now taken the exact code setup I run on the H723 development board and replaced every instance of "H723" with "H725" in the files, then transferred over all of the ones that relate to ethernet, lwIP, linkers, or anything with the "ETH-CODE" tag in it (which are the changed files from the ST provided example). Then I double-checked that the assigned GPIO pins were correct and enabled the "user-defined vector tables" (which I'll talk about in a second), and it still didn't work.

Now, I'm starting to think it might be an issue with the default ST/CubeMX-generated code. In this thread they talk about a lot of CubeMX code for ethernet, lwIP, and FreeRTOS that just doesn't work correctly, which is the point of those ST-provided example templates I talked about and used earlier. Additionally, I've had a bit of bad luck, like I said the HSE for my board had a routing issue I'm working on fixing but in the meantime, I'm using the onboard HSI. In the beginning, I was having a weird issue where the SysTick interrupt was never being triggered and it turned out to be from a weird vector tables issue I never fully understood, the solution for which I found in this thread. At the end of the day, I just had to comment in the line

#define USER_VECT_TAB_ADDRESS

in `system_stm32h7xx.c`. Naturally, I thought this one change between my boards was the issue, but I've tried also commenting-in that line on the Nucleo example code and it continued to work just fine. Instead, I think this might be the result of a larger issue, maybe there's more CubeMX-generated code for my very specific chip that just hasn't been updated/fixed in a long time? I know there are already a ton of issues with the CubeMX generated code for lwIP so maybe the example code just doesn't cover all of it for my chip?

I've been stuck on this issue for over a month now so any ideas would be super helpful. Again, to be thorough, I've attached my entire ST project so you can skim through the code or maybe try flashing it yourself. Thanks.

 

1 REPLY 1
ASEHST
ST Employee

Hello @jackmh,

 

Thank you for your detailed report. You have indicated that the Ethernet IP address of your PC is 192.168.50.20. However, in your StartDefaultTask function, it seems that the remote address is set to 192.168.1.1, which is on a different subnet. This difference could be at the root of the Ethernet communication problem.

 

With Regards,

 

If your question is answered, please close this topic by clicking "Accept as Solution".