<div dir="ltr"><div><div>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.<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 14:35, 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><div>Hi,<br><br></div>I am trying to get LwIP working on the STM32H7 because it has a low RAM usage (at least that's what I heard). We already did this for FreeRTOS, but we used the LwIP Raw API to not be bound specifically to the OS. I am now trying to adapt LwIP to RTEMS , but I'm not really a LwIP expert and most did copy & paste up until now.<br><br></div>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:<br><br>
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */<br>ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection"))); /* Ethernet Tx DMA Descriptors */<br>uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_RX_BUFFER_SIZE] __attribute__((section(".RxArraySection"))); /* Ethernet Receive Buffers */<br><br>/* For RTEMS can we put this in the text section? */<br>//ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */<br>//ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */<br>//uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_RX_BUFFER_SIZE]; /* Ethernet Receive Buffers */
<br><br></div>I got an "section `.unexpected_sections' will not fit in region<br> * `UNEXPECTED_SECTIONS'" error because of this. I checked the linker script used, which was taken from the STM32CubeH7 repository and found this LwIP specific section:<br><br> .lwip_sec (NOLOAD) : {<br> . = ABSOLUTE(0x30040000);<br> *(.RxDecripSection) <br> <br> . = ABSOLUTE(0x30040060);<br> *(.TxDecripSection)<br> <br> . = ABSOLUTE(0x30040200);<br> *(.RxArraySection) <br> } >RAM_D2 AT> FLASH<br><br></div>So the descriptors are placed at RAM_D2 (or SRAM_3 in RTEMS). I've placed the following<br>section in linkcmds.base now:<br><br> .lwip_sec (NOLOAD) : ALIGN_WITH_INPUT {<br> . = ABSOLUTE(0x30040000);<br> *(.RxDecripSection) <br> <br> . = ABSOLUTE(0x30040060);<br> *(.TxDecripSection)<br> <br> . = ABSOLUTE(0x30040200);<br> *(.RxArraySection) <br> } >SRAM_3 AT> REGION_TEXT_LOAD<div><div><br></div><div>Are any STM32 or LwIP experts here that see a problem with this adaption? I still need to do some other stuff to integrate LwIP properly so I haven't tested it yet. Are there any other thinks I need to take into account for making LwIP work with RTEMS?<br><br></div><div>Kind Regards<br></div><div>Robin<br></div></div></div>
</blockquote></div>