Using LwIP on the STM32H7

Robin Müller robin.mueller.m at gmail.com
Thu Jan 28 16:40:17 UTC 2021


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;
  struct pbuf *p;

  /* move received packet into a new pbuf */
  p = low_level_input(netif);

  /* no packet could be read, silently ignore this */
  if (p == NULL) return;

  /* entry point to the LwIP stack */
  err = netif->input(p, netif);

  if (err != ERR_OK)
  {
    LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
    pbuf_free(p);
    p = NULL;
  }

  HAL_ETH_BuildRxDescriptors(&EthHandle);
}

More specifically, it appears to crash in netif->input.. Is there someone
who has managed to make LwIP work on the STM32 with the Raw API?

Kind Regards
Robin Müller

On Thu, 28 Jan 2021 at 17:15, Robin Müller <robin.mueller.m at gmail.com>
wrote:

> 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;
>
>   /* Fill each DMATxDesc descriptor with the right values */
>   for(i=0; i < (uint32_t)ETH_TX_DESC_CNT; i++)
>   {
>     dmatxdesc = heth->Init.TxDesc + i;
>
>     WRITE_REG(dmatxdesc->DESC0, 0x0);
>     WRITE_REG(dmatxdesc->DESC1, 0x0);
>     WRITE_REG(dmatxdesc->DESC2, 0x0);
>     WRITE_REG(dmatxdesc->DESC3, 0x0);
>
>     WRITE_REG(heth->TxDescList.TxDesc[i], (uint32_t)dmatxdesc);
>   }
>
>   heth->TxDescList.CurTxDesc = 0;
>
>   /* Set Transmit Descriptor Ring Length */
>   WRITE_REG(heth->Instance->DMACTDRLR, (ETH_TX_DESC_CNT -1));
>
>   /* Set Transmit Descriptor List Address */
>   WRITE_REG(heth->Instance->DMACTDLAR, (uint32_t) heth->Init.TxDesc);
>
>   /* Set Transmit Descriptor Tail pointer */
>   WRITE_REG(heth->Instance->DMACTDTPR, (uint32_t) heth->Init.TxDesc);
> #endif /* __rtems__ */
> }
>
> Is there a specific reason the function was excluded?
>
> Kind Regards
> Robin
>
> On Thu, 28 Jan 2021 at 16:47, Sebastian Huber <
> sebastian.huber at embedded-brains.de> wrote:
>
>> On 28/01/2021 16:45, Robin Müller wrote:
>>
>> >  *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bsp_nocache*)))
>> >  .bsp_nocache   0x0000000030000000     0x18c0
>> > CMakeFiles/fsfw_example.dir/bsp_stm32_rtems/boardconfig/ethernetif.c.obj
>> >                 0x0000000030000000                DMARxDscrTab
>> >                 0x0000000030000060                DMATxDscrTab
>> >                 0x00000000300000c0                Rx_Buff
>> >                 0x00000000300018c0  bsp_section_nocache_end = .
>> >                 0x00000000000018c0  bsp_section_nocache_size =
>> > (bsp_section_nocache_end - bsp_section_nocache_begin)
>> >
>> > But in the debugger, the descriptor entries are still zeroed out
>> > unfortunately..
>> If you place them in BSP_NOCACHENOLOAD_SECTION or
>> BSP_NOCACHENOLOAD_SUBSECTION(), they are not loaded (zero initialized).
>>
>> --
>> embedded brains GmbH
>> Herr Sebastian HUBER
>> Dornierstr. 4
>> 82178 Puchheim
>> Germany
>> email: sebastian.huber at embedded-brains.de
>> phone: +49-89-18 94 741 - 16
>> fax:   +49-89-18 94 741 - 08
>>
>> Registergericht: Amtsgericht München
>> Registernummer: HRB 157899
>> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
>> Unsere Datenschutzerklärung finden Sie hier:
>> https://embedded-brains.de/datenschutzerklaerung/
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20210128/cad79af1/attachment-0001.html>


More information about the users mailing list