<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 28, 2021 at 10:52 AM Robin Müller <<a href="mailto:robin.mueller.m@gmail.com">robin.mueller.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>By the way, the lwipopts.h from the STM32 example application appears to use the SRAM3 as the LWIP heap memory as well:<br><br>/* Relocate the LwIP RAM heap pointer */<br>#define LWIP_RAM_HEAP_POINTER (0x30044000)<br><br></div>Might this be an issue?</div></div></div></blockquote><div><br></div><div>Does that address conflict with memory RTEMS is using for stacks, heap or workspace?</div><div>If so, this is going to crash in an odd an unpredictable way.</div><div><br></div><div>Can LWIP work with malloc() optionally? Or can you malloc() (aligned?) the </div><div>memory before initializing LWIP and turn that RAM_HEAP_POINTER into a </div><div>void * variable access? I doubt it is referenced much.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div> I'm also not sure whether any interrupts are configured .. but I think the Raw API is polling based..<br><br></div>Kind Regards<br></div>Robin Müller<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 Jan 2021 at 17:40, Robin Müller <<a href="mailto:robin.mueller.m@gmail.com" target="_blank">robin.mueller.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Okay, I managed to achieve the initialization process by adapting the BSP to perform the descriptor list initialization.<br></div>Unfortunately, the program now appears to crash in the following polling function, which is called every 100 ms:<br><br>void ethernetif_input(struct netif *netif)<br>{<br> err_t err;<br> struct pbuf *p;<br> <br> /* move received packet into a new pbuf */<br> p = low_level_input(netif);<br><br> /* no packet could be read, silently ignore this */<br> if (p == NULL) return;<br><br> /* entry point to the LwIP stack */<br> err = netif->input(p, netif);<br><br> if (err != ERR_OK)<br> {<br> LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));<br> pbuf_free(p);<br> p = NULL;<br> }<br><br> HAL_ETH_BuildRxDescriptors(&EthHandle);<br>}<br><br></div><div>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?<br><br></div><div>Kind Regards<br></div><div>Robin Müller<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 Jan 2021 at 17:15, Robin Müller <<a href="mailto:robin.mueller.m@gmail.com" target="_blank">robin.mueller.m@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Alright, I think these descriptors were not initialized inside the functions:<br>ETH_DMATxDescListInit<br>ETH_DMARxDescListInit<br><br>because they are wrapped in preprocessor guards:<br><br>static void ETH_DMATxDescListInit(ETH_HandleTypeDef *heth)<br>{<br>#ifndef __rtems__<br> ETH_DMADescTypeDef *dmatxdesc;<br> uint32_t i;<br><br> /* Fill each DMATxDesc descriptor with the right values */<br> for(i=0; i < (uint32_t)ETH_TX_DESC_CNT; i++)<br> {<br> dmatxdesc = heth->Init.TxDesc + i;<br><br> WRITE_REG(dmatxdesc->DESC0, 0x0);<br> WRITE_REG(dmatxdesc->DESC1, 0x0);<br> WRITE_REG(dmatxdesc->DESC2, 0x0);<br> WRITE_REG(dmatxdesc->DESC3, 0x0);<br><br> WRITE_REG(heth->TxDescList.TxDesc[i], (uint32_t)dmatxdesc);<br> }<br><br> heth->TxDescList.CurTxDesc = 0;<br><br> /* Set Transmit Descriptor Ring Length */<br> WRITE_REG(heth->Instance->DMACTDRLR, (ETH_TX_DESC_CNT -1));<br><br> /* Set Transmit Descriptor List Address */<br> WRITE_REG(heth->Instance->DMACTDLAR, (uint32_t) heth->Init.TxDesc);<br><br> /* Set Transmit Descriptor Tail pointer */<br> WRITE_REG(heth->Instance->DMACTDTPR, (uint32_t) heth->Init.TxDesc);<br>#endif /* __rtems__ */<br>}<br><br></div>Is there a specific reason the function was excluded?<br><br></div>Kind Regards<br></div>Robin<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 Jan 2021 at 16:47, Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 28/01/2021 16:45, Robin Müller wrote:<br>
<br>
> *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bsp_nocache*)))<br>
> .bsp_nocache 0x0000000030000000 0x18c0 <br>
> CMakeFiles/fsfw_example.dir/bsp_stm32_rtems/boardconfig/ethernetif.c.obj<br>
> 0x0000000030000000 DMARxDscrTab<br>
> 0x0000000030000060 DMATxDscrTab<br>
> 0x00000000300000c0 Rx_Buff<br>
> 0x00000000300018c0 bsp_section_nocache_end = .<br>
> 0x00000000000018c0 bsp_section_nocache_size = <br>
> (bsp_section_nocache_end - bsp_section_nocache_begin)<br>
><br>
> But in the debugger, the descriptor entries are still zeroed out <br>
> unfortunately..<br>
If you place them in BSP_NOCACHENOLOAD_SECTION or <br>
BSP_NOCACHENOLOAD_SUBSECTION(), they are not loaded (zero initialized).<br>
<br>
-- <br>
embedded brains GmbH<br>
Herr Sebastian HUBER<br>
Dornierstr. 4<br>
82178 Puchheim<br>
Germany<br>
email: <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
phone: +49-89-18 94 741 - 16<br>
fax: +49-89-18 94 741 - 08<br>
<br>
Registergericht: Amtsgericht München<br>
Registernummer: HRB 157899<br>
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler<br>
Unsere Datenschutzerklärung finden Sie hier:<br>
<a href="https://embedded-brains.de/datenschutzerklaerung/" rel="noreferrer" target="_blank">https://embedded-brains.de/datenschutzerklaerung/</a><br>
<br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a></blockquote></div></div>