Re: Using LwIP on the STM32H7

2021-02-02 Thread Robin Müller
I might submit the patch today. I have not really found a clean way to introduce the sections required for lwIP on the STM32H7 without editing the linkcmds.base file unfortunately and I'm not a linker command expert. If I add the linkmds.lwip after the linkcmds.base include, I get the unexpected

Re: Using LwIP on the STM32H7

2021-02-01 Thread Joel Sherrill
On Mon, Feb 1, 2021 at 5:16 PM Mr. Andrei Chichak wrote: > Can you point me at Sebastian’s driver? I haven’t been able to find it in > the repo. > Here's the trick. Look in rtemsbsd/include/bsp/nexus-devices.h and search for the header guard from your BSP. It references an stmac driver which

Re: Using LwIP on the STM32H7

2021-02-01 Thread Mr. Andrei Chichak
Can you point me at Sebastian’s driver? I haven’t been able to find it in the repo. A > On 2021-February-01, at 16:05, Joel Sherrill wrote: > > > > On Mon, Feb 1, 2021 at 4:54 PM Mr. Andrei Chichak > wrote: > Oh, crap, I’m off by 3 orders of magnitude, I’ve got

Re: Using LwIP on the STM32H7

2021-02-01 Thread Joel Sherrill
On Mon, Feb 1, 2021 at 4:54 PM Mr. Andrei Chichak wrote: > Oh, crap, I’m off by 3 orders of magnitude, I’ve got 512KB. > That's an LWIP candidate. :) But Sebastian did a driver for libbsd for the H7 series. If you have more memory or can attach external RAM, that's an option. > Bother, I

Re: Using LwIP on the STM32H7

2021-02-01 Thread Mr. Andrei Chichak
Oh, crap, I’m off by 3 orders of magnitude, I’ve got 512KB. Bother, I need a nap already. A > On 2021-February-01, at 15:35, Joel Sherrill wrote: > > > > On Mon, Feb 1, 2021 at 4:25 PM Andrei Chichak > wrote: > any guidance choosing between “Legacy Stack” and

Re: Using LwIP on the STM32H7

2021-02-01 Thread Joel Sherrill
On Mon, Feb 1, 2021 at 4:25 PM Andrei Chichak wrote: > any guidance choosing between “Legacy Stack” and libbsd? > This one is easy. Please please please please do NOT choose the legacy stack. :) The legacy stack should only be used on projects that are using it and those are encouraged to move

Re: Using LwIP on the STM32H7

2021-02-01 Thread Mr. Andrei Chichak
any guidance choosing between “Legacy Stack” and libbsd? I’ve got a 512MB of RAM processor, so I expect that I’ll have lots left over. But that is TBD. A > On 2021-February-01, at 15:21, Joel Sherrill > wrote: > > > > On Mon, Feb 1, 2021 at 4:03 PM Gedare Bloom

Re: Using LwIP on the STM32H7

2021-02-01 Thread Joel Sherrill
On Mon, Feb 1, 2021 at 4:03 PM Gedare Bloom wrote: > > > On Mon, Feb 1, 2021 at 2:42 PM Chris Johns wrote: > >> On 2/2/21 8:32 am, Mr. Andrei Chichak wrote: >> > Is there any advantage to using bsd networking over LWiP, or vice >> versa? >> >> They are different stacks with different feature

Re: Using LwIP on the STM32H7

2021-02-01 Thread Gedare Bloom
On Mon, Feb 1, 2021 at 2:42 PM Chris Johns wrote: > On 2/2/21 8:32 am, Mr. Andrei Chichak wrote: > > Is there any advantage to using bsd networking over LWiP, or vice versa? > > They are different stacks with different feature sets and different > hardware > resource demands. I am not familiar

Re: Using LwIP on the STM32H7

2021-02-01 Thread Chris Johns
On 2/2/21 8:32 am, Mr. Andrei Chichak wrote: > Is there any advantage to using bsd networking over LWiP, or vice versa?  They are different stacks with different feature sets and different hardware resource demands. I am not familiar with the features of LwIP so I am not the best person to

Re: Using LwIP on the STM32H7

2021-02-01 Thread Mr. Andrei Chichak
Is there any advantage to using bsd networking over LWiP, or vice versa? With Robin’s BSP, if it gets released, I think I should be able to finish up my bsd networking BSP for STM32F7. I’ll also see what I can do about getting it going for F4 as well. Andrei > On 2021-January-29, at 12:21,

Re: Using LwIP on the STM32H7

2021-01-29 Thread Gedare Bloom
On Fri, Jan 29, 2021 at 9:57 AM Robin Müller wrote: > The whole code base I'm using might go public soon so I will also send the > link here > as soon as it is. I think this might also be useful for people who would > like to evaluate how to set up Eclipse and the CMake build system for > their

Re: Using LwIP on the STM32H7

2021-01-29 Thread Robin Müller
The whole code base I'm using might go public soon so I will also send the link here as soon as it is. I think this might also be useful for people who would like to evaluate how to set up Eclipse and the CMake build system for their application Kind Regards Robin On Fri, 29 Jan 2021 at 17:47,

Re: Using LwIP on the STM32H7

2021-01-29 Thread Robin Müller
Alright, I figured out the issue, that was an application level problem, the UDP frames are received and sent without issues as far as I can see. I think I might submit a patch soon with some of initial improvements. But I will summarize the changes I had to do here for now in case other people

Re: Using LwIP on the STM32H7

2021-01-29 Thread Robin Müller
I think I might have found one issue. In the HAL_ETH_Init(ETH_HandleTypeDef *heth) function The following piece of code was excluded: #ifndef __rtems__ /* SET DSL to 64 bit */ MODIFY_REG(heth->Instance->DMACCR, ETH_DMACCR_DSL, ETH_DMACCR_DSL_64BIT); #endif /* __rtems__ */ I reintroduced the

Re: Using LwIP on the STM32H7

2021-01-29 Thread Joel Sherrill
On Fri, Jan 29, 2021, 5:52 AM Robin Müller wrote: > Hi, > > I am actually configuring the MPU with the following function, which was > taken over from the STM32 example project: > > /*Configure the MPU attributes */ > void MPU_Config(void) > { > MPU_Region_InitTypeDef MPU_InitStruct; > >

Re: Using LwIP on the STM32H7

2021-01-29 Thread Robin Müller
Hi, I am actually configuring the MPU with the following function, which was taken over from the STM32 example project: /*Configure the MPU attributes */ void MPU_Config(void) { MPU_Region_InitTypeDef MPU_InitStruct; /* Disable the MPU */ HAL_MPU_Disable(); /* Configure the MPU

Re: Using LwIP on the STM32H7

2021-01-29 Thread Sebastian Huber
On 29/01/2021 12:01, Robin Müller wrote: The HAL_ETH_Transmit call just times out. If I set the timeout to 20 to HAL_MAX_DELAY, the function will just block indefinitely. Does anyone have an idea why this might happen? I would check the memory settings in the MPU for this area. You probably

Re: Using LwIP on the STM32H7

2021-01-29 Thread Robin Müller
It probably adds the lwIP sources and builds them. Right now I am trying to solve an issue with the DMA (hopefully the last issue), because the following function used by lwIP is not working: static err_t low_level_output(struct netif *netif, struct pbuf *p) { uint32_t i=0, framelen = 0;

Re: Using LwIP on the STM32H7

2021-01-28 Thread Chris Johns
On 29/1/21 12:35 am, Robin Müller wrote: > Are there any other thinks I need to take into account for making LwIP > work with RTEMS? I have not used LwIP but there is an RSB package ... https://git.rtems.org/rtems-source-builder/tree/rtems/config/net/lwip-1-1.cfg It has a patch. I have no idea

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
Thanks for the clarifications. Now I actually understand what the MPU_Config call from the STM32 example does. I was not sure what that was for. I reintroduced the lwip sections (from my first mail9 again with the values from the STM32 linker script and used the MPU_Config call from the STM32

Re: Using LwIP on the STM32H7

2021-01-28 Thread Mr. Andrei Chichak
Good morning, I’ve been trying to get ethernet on STM32F7 going using the bsd networking stack (not going that well, there is a LOT of undocumented knowledge to straighten out). The STM32x7 ethernet controllers need their descriptors and data areas to be located on 32-byte boundaries with a

Re: Using LwIP on the STM32H7

2021-01-28 Thread Joel Sherrill
On Thu, Jan 28, 2021 at 10:52 AM Robin Müller wrote: > By the way, the lwipopts.h from the STM32 example application appears to > use the SRAM3 as the LWIP heap memory as well: > > /* Relocate the LwIP RAM heap pointer */ > #define LWIP_RAM_HEAP_POINTER(0x30044000) > > Might this be an

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
By the way, the lwipopts.h from the STM32 example application appears to use the SRAM3 as the LWIP heap memory as well: /* Relocate the LwIP RAM heap pointer */ #define LWIP_RAM_HEAP_POINTER(0x30044000) Might this be an issue? I'm also not sure whether any interrupts are configured .. but I

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
Okay, I managed to achieve the initialization process by adapting the BSP to perform the descriptor list initialization. Unfortunately, the program now appears to crash in the following polling function, which is called every 100 ms: void ethernetif_input(struct netif *netif) { err_t err;

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
Alright, I think these descriptors were not initialized inside the functions: ETH_DMATxDescListInit ETH_DMARxDescListInit because they are wrapped in preprocessor guards: static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth) { #ifndef __rtems__ ETH_DMADescTypeDef *dmatxdesc; uint32_t i;

Re: Using LwIP on the STM32H7

2021-01-28 Thread Sebastian Huber
On 28/01/2021 16:45, Robin Müller wrote:  *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bsp_nocache*)))  .bsp_nocache   0x3000     0x18c0 CMakeFiles/fsfw_example.dir/bsp_stm32_rtems/boardconfig/ethernetif.c.obj                 0x3000                DMARxDscrTab                

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
Thanks Sebastian. The descriptors now appear to have addresses inside the RAM according to the map file *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bsp_nocache*))) .bsp_nocache 0x3000 0x18c0 CMakeFiles/fsfw_example.dir/bsp_stm32_rtems/boardconfig/ethernetif.c.obj

Re: Using LwIP on the STM32H7

2021-01-28 Thread Sebastian Huber
On 28/01/2021 14:35, Robin Müller wrote: So far, transferring the code has worked, but there are some specific sections in the code used for our FreeRTOS example which put the ethernet DMA descriptors in specific sections: ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]

Re: Using LwIP on the STM32H7

2021-01-28 Thread Joel Sherrill
Specific addresses shouldn't be in the shared linkcmds.base. You could define new macro names like the other memory types and addresses and add those to the generic linkcmds. Then the linkcmds.base would generically know those sections and your BSP could set the right macros to place it. One

Re: Using LwIP on the STM32H7

2021-01-28 Thread Robin Müller
Some clarification: The linker script used for RTEMS is of course the default RTEMS linker script, the FreeRTOS example used the linker file taken from the STM32CubeH7 repository. Kind Regards Robin Müller On Thu, 28 Jan 2021 at 14:35, Robin Müller wrote: > Hi, > > I am trying to get LwIP