[PATCH] Basic lwIP for STM32H7 BSP

Robin Müller robin.mueller.m at gmail.com
Mon Mar 29 12:13:08 UTC 2021


I solved it like you mentioned now by putting the descriptors in the
.bsp_no_cache section and with the correct alignment.

/* Put into special RTEMS section and align correctly */
ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]
__attribute__((section(".bsp_nocache"),
__aligned__(DMA_DESCRIPTOR_ALIGNMENT)));
/* Put into special RTEMS section and align correctly */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]
 __attribute__((section(".bsp_nocache"),
__aligned__(DMA_DESCRIPTOR_ALIGNMENT)));
uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_RX_BUFFER_SIZE];

I will update the patch I sent with the sections removed from linccmd.base
. Maybe it still would be a better idea to have a separate BSP for the
STm32H743ZIT6-Nucleo but I would have to look into how to do this again.

Kind Regards
Robin

On Fri, 26 Mar 2021 at 15:24, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

>
> On 26/03/2021 11:34, Robin Müller wrote:
> > How would you define a generic linker section? I tried to put the
> > following section into the
> > linkcmdsmemory file like you suggested (at
> > spec/build/bsps/arm/stm32h7/linkcmdsmemory.yml):
> >
> >   SECTIONS {
> >     .stm32h7_sram_3 (NOLOAD) : ALIGN_WITH_INPUT {
> >       bsp_stm32h7_sram_3_start = stm32h7_memory_sram_3_begin;
> >       bsp_stm32h7_sram_3_end = stm32h7_memory_sram_3_end;
> >     } > SRAM_3 AT > FLASH
> >   }
>
> This should work. You need also input sections for this output section.
> I still don't know why you can't use the already existing:
>
>      .nocache : ALIGN_WITH_INPUT {
>          bsp_section_nocache_begin = .;
>          *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_nocache*)))
>          bsp_section_nocache_end = .;
>      } > REGION_NOCACHE AT > REGION_NOCACHE_LOAD
>      bsp_section_nocache_size = bsp_section_nocache_end -
> bsp_section_nocache_begin;
>      bsp_section_nocache_load_begin = LOADADDR (.nocache);
>      bsp_section_nocache_load_end = bsp_section_nocache_load_begin +
> bsp_section_nocache_size;
>
>      .nocachenoload (NOLOAD) : ALIGN_WITH_INPUT {
>          bsp_section_nocachenoload_begin = .;
>          *(SORT_BY_ALIGNMENT (SORT_BY_NAME (.bsp_noload_nocache*)))
>          bsp_section_nocacheheap_begin = .;
>          . += ORIGIN (REGION_NOCACHE) + LENGTH (REGION_NOCACHE) -
> ABSOLUTE (.);
>          bsp_section_nocacheheap_end = .;
>          bsp_section_nocachenoload_end = .;
>      } > REGION_NOCACHE AT > REGION_NOCACHE
>      bsp_section_nocacheheap_size = bsp_section_nocacheheap_end -
> bsp_section_nocacheheap_begin;
>      bsp_section_nocachenoload_size = bsp_section_nocachenoload_end -
> bsp_section_nocachenoload_begin;
>
> For the stm32h7 these regions are used:
>
>    REGION_ALIAS ("REGION_NOCACHE", SRAM_1);
>    REGION_ALIAS ("REGION_NOCACHE_LOAD", SDRAM_1);
>
> >
> > But the waf build fails with  a syntax error:
> >
> > [1610/1611] Linking build/arm/stm32h7/testsuites/samples/ticker.exe
> > [1611/1611] Linking build/arm/stm32h7/testsuites/samples/unlimited.exe
> >
> c:/users/robin/rtems/rtems-tools/rtems/6/bin/../lib/gcc/arm-rtems6/10.2.1/../../../../arm-rtems6/bin/ld.exe:linkcmds.memory:84:
>
> > syntax error
> > collect2.exe: error: ld returned 1 exit status
> >
> >
> c:/users/robin/rtems/rtems-tools/rtems/6/bin/../lib/gcc/arm-rtems6/10.2.1/../../../../arm-rtems6/bin/ld.exe:linkcmds.memory:84:
>
> > syntax error
> > collect2.exe: error: ld returned 1 exit status
> What is around line 84?
>
> --
> 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/devel/attachments/20210329/264b12e5/attachment.html>


More information about the devel mailing list