On Fri, Mar 26, 2021 at 11:21 AM Gregory Nutt <spudan...@gmail.com> wrote:
> > So, if I understand correctly, anyone can declare a static buffer like this:
> >
> > static uint8_t g_spi6_txbuf[SPI6_DMABUFSIZE_ADJUSTED]
> > SPI6_DMABUFSIZE_ALGN locate_data(".sram4");
> >
> > and automatically the heap will not overlap it?
>
> Yes provided that:
>
>  1. The .sram_resevere section is origined at SRAM4_BEGIN, and
>  2. The region that you add is in the range from SRAM4_RESERVE_END to
>     SRAM4_END

FYI my work (in progress) on this is in the branch
"stm32h7-fix-heap-clobber" in my fork, in case anyone wants to look...

https://github.com/hartmannathan/incubator-nuttx/tree/stm32h7-fix-heap-clobber

I've implemented this for my custom board and verified that it is
correctly skipping my SRAM4 DMA buffers and adding only the remainder
of SRAM4 to the heap. NSH starts up and the board is working.

So far the branch contains only the Kconfig and C code changes. I will
now fix all STM32H7 linker scripts to contain the required:

    .sram4_reserve :
    {
        _sram4_reserve_start = ABSOLUTE(.);
        *(.sram4)
        _sram4_reserve_end = ABSOLUTE(.);
    } > sram4

"I'll be back..." :-)
Nathan

Reply via email to