2020-02-10 06:51 PM
@Amel NASRI, @ranran, @Piranha, @Harrold, @Pavel A.
V2 of my fixes and improvements to H7_FW V1.5.0/V1.6.0 Ethernet...
Changes include
Find full details and source in the attached zip. V1 was posted to another developer's question. Please post any questions about V2 here.
Solved! Go to Solution.
2020-03-08 02:37 PM
netmask's type is ip4_addr_t?
2020-03-08 04:40 PM
Porting guide for Cube users. Supplements section 9 of my document...
2020-03-23 06:50 PM
Thanks @alister for sharing your solution, although I'm really disappointed you had to do it in the first place. I ran into the 'overwriting buffer' issue 5 seconds into my first test.
Just letting you know I'm using the socket interface (maintaining legacy code) and it's working well with your modifications. I haven't done a lot of testing, but so far it appears robust.
Hi @Amel NASRI , do these defects need to be logged as issues in the GitHub repository, or have they been captured here?
Cheers David
2020-04-02 05:58 AM
Thanks @alister for your work. I would like to ask You about another aspect of H7 ethernet controller. H7 ETH controller support TCP hardwere segmentation. Do you know, how to modified LWIP to use this functionality. Maybe You heard about this implementation? In my project I require high data transfer over ethernet between STMH7 and NationalInstrument SbRIO controler. To achive maksimum bandwith I've used direct transfering UDP datagrams omiting LWIP (tx data throwoutput on the level of 98%). I've discovered that this solution leads to hi cpu consumption on SbRIO side (50% usage of cpu only for receiving datagrams). So to deal with this issue I've made code that supported datagram segmentation in IP level (one UDP datagram can transfer around 65kB of data in this configuration). This partially solve problem on SbRIO (Ethernet driver joins ethernet frames in Kernel layer what is much faster). I know that ARM SbRIO procesor was equipded in ethernet controller supporting tcp segmentation so the next logic step in development would be moving with comunication between devices to TCP and hardwer supported segmentation but the question is how to do it on H7 side?
2020-04-02 02:00 PM
I can't help much.
The H7 ETH driver described here does
You might check these:
2020-04-02 04:20 PM
I have also used this code successfully. After a detailed review of the modified driver code, I was impressed with some of the subtle bugs and mistakes that alister found in the ST code.
It will be interesting to see if ST ever take on board the suggestion of a zero copy driver that abstracts buffers away from Ethernet DMA descriptors. The complexity of all the buffer callbacks would seem inconsistent with their typical 'dumb' drivers, but hopefully they do as it is essential for a high performance Ethernet solution.
Initially I tried to use the modified driver alongside the the other driver code so I could still cleanly regenerate STM32CubeMx code but because of changes in stm32h7xx_hal_eth.h, which is included in the auto generated files it was not practical. Replacement of the stm32h7xx_hal_eth files is necessary, then manual intervention each time STM32CubeMX code is generated after that. A small price to pay given that it actually works.
This application uses a hardware abstraction layer and OS abstraction (as it runs on embedded hardware or a PC) so took a bit of tweaking. All the code that is required is supplied in the zip folder. On custom hardware, STM32H753 @ 480MHz, using Windows iperf 2 and lwiperf server, I was able to obtain a repeatable 50MBps. I did zero investigation into what was limiting the rate to 50 as that is already 50 times more than this application needs!
I really wanted to find a bug or improvement in this code so I could submit some feedback but was unable to!
Thanks alister
2020-04-02 04:38 PM
Thanks for the kind thanks. If you put your modified stm32h7xx_hal_conf.h, stm32h7xx_hal_eth.h and stm32h7xx_hal_eth.c files in different directories and configure the compiler to search your includes directory before the HAL driver includes directory, and you exclude stm32h7xx_hal_eth.c in the HAL drivers source directory, you should be able to regenerate Cube without its trashing your changes. That's what I'd tried to explain in the earlier porting-guide post, or am I missing something?
2020-04-02 04:38 PM
I've been following the development and progress that you and others have been making on the H7 ethernet drivers since last November -- only now have I finally had the time to sit down and incorporate all your recommendations. Just wanted to comment to say I'm incredibly thankful for the hard work that you've done here and for generously sharing that with the community. Working with the template code provided was quick and painless to get working, but that was made easier from knowing where to look after spending a lot of time on previous attempts at fixing the ethernet stack last year.
Now we just have to sit and wait, I'm hopeful that ST will incorporate your changes to their code and make life easier for others.
2020-04-02 05:02 PM
Actually, since writing that post last night (and forgetting to click submit until this morning), I have managed to do as you said and have it build without modifying the STM32CubeMX generated files. The trick was to realising that STM32CubeMX will delete files that it thinks shouldn't be there, but not folders. Oh, and as you mentioned, making sure the include path to the modified files comes first!
I never actually saw your post describing how to do it and wrote my own notes (attached) for future reference.
2020-04-02 05:11 PM
I wouldn't rename these files. Other files already including stm32h7xx_hal_eth.h are best unchanged, and renaming a .c file won't change its symbol names. Only excluding the unwanted .c files ensure the correct file's are used and avoids duplicate symbols during linking.