2023-03-20 07:02 PM
I have read quite a few threads about ethernet on the H7, along with several internet posts. Part of me wonders if I should even try... But I am.
I've followed this guide:
As well as this guide:
https://github.com/AnielShri/STM32H745_Ethernet/blob/master/Documentation/lwip_nortos.md
They are similar, with some slight differences with the MPU cache settings.
For me, the first post results in a hard fault. But with the second, I am able to boot.
While I would eventually like to get to RTOS, at the moment I'm just trying to implement this using LWIP.
My first test is just basic ICMP - which doesn't work. That is, until I comment out this line:
SCB_EnableDCache();
So, of course, that implies something with the data cache, and memory locations.
So, my settings looks like these:
LWIP settings:
I've added the following to the linker script:
/* Modification start */
.lwip_sec (NOLOAD) : {
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)
. = ABSOLUTE(0x30040060);
*(.TxDecripSection)
. = ABSOLUTE(0x30040200);
*(.RxArraySection)
} >RAM_D2
Sometimes, I get this error upon each ICMP packet that is received:
Assertion "pbuf_free: p->ref > 0" failed at line 753 in ../Middlewares/Third_Party/LwIP/src/core/pbuf.c
Again, it goes away when I disable the dcache. I'm not sure what else to try. I must have something not quite right. Thanks.
2023-03-20 07:39 PM
>That is, until I comment out this line:
>SCB_EnableDCache();
>So, of course, that implies something with the data cache, and memory locations.
Of course it does. But this is a bit complicated. So keep reading the forum posts, especially by @Piranha who made several valuable digests.
Also look at most recent ST examples for H7 here.
Hold your impulse to generate projects with CubeMX/IDE until you have at least one ready example (for some eval board) working more or less.
Also note that recently ST is moving from LwIP and FreeRTOS to Microsoft's offering: AzureRTOS (ThreadX, NetX etc.), if this sounds good to you, research that direction.
2023-03-20 11:47 PM
Not so helpful, but... I never enabled the caches in the first place.
I'm using H723 / H735 (they have different memory layout and restrictions compared to the H74x) with lwIP, works great.
2023-03-21 05:02 AM
Thanks for your response. I do have that page bookmarked. I will explore it further. I have read a lot of @Piranha's posts. I felt like I am so close. I am interested that they are moving to a new stack. One point of concern is that they've been using FreeRTOS/LWIP for years and it's still buggy. Are they starting the clock over with a new stack?
2023-03-21 05:03 AM
In CubeMX, you cannot enable LWIP without the caches. Doesn't mean much, but there it is. If all else fails I will continue down that path. I really wanted to get them working in conjunction.
2023-03-21 05:20 AM
One more reason to use CubeMX only as a starting point... (I did so too, and then threw out almost everything, including the ETH HAL drivers).
2023-03-21 05:22 AM
It does do a decent job for many things. This is more complex and does seem to challenge it. What ETH drivers are you using currently?
2023-03-22 09:17 AM
> It does do a decent job for many things.
The only thing it is actually useful, is setting up a pin layout for a PCB design. Otherwise it is "great" for generating a broken bloatware, fooling the beginners and ticking the boxes for managers. Therefore it is great in wasting a humanity's time on a useless pseido-solution. Such a pseido-solutions greatly hold us back of the realization that a software development is an ENGINEERING and should be treated like that. Instead the current industry and education system treats software development as some bohemian art.
Post edited to adhere community guidelines.
2023-03-25 05:29 AM
@Pavel A. I implemented The AzureRTOs stack and spent less time doing it than I did the FreeRTOS stack. Definitely appreciate the tip. I have a multithreaded TCP server working that communicates using queues.