FreeRTOS +TCP on SAME70

  1. Are you using heap_4?

Although the algorithm is the same, I prefer to use heap_5.

The actual free amount of RAM available, is only known after linking the project. The heap space starts were the data segments end, and it ends where the main stack begins.

I used pseudo variables which are defined in my linker script:

extern uint8_t __bss_end__, _estack, _Min_Stack_Size;
#define HEAP_START		__bss_end__
#define HEAP_END		_estack

volatile uint32_t ulHeapSize;
volatile uint8_t *pucHeapStart;

static void heapInit( )
{
uint32_t ulStackSize = (uint32_t)&(_Min_Stack_Size);

    pucHeapStart = ( uint8_t * ) (((( uint32_t)&HEAP_START) + 7) & ~0x07ul);

    ulHeapSize = ( uint32_t ) ( &HEAP_END - &HEAP_START );
    ulHeapSize &= ~0x07ul;
    ulHeapSize -= ulStackSize;

    HeapRegion_t xHeapRegions[] = {
        { ( unsigned char *) pucHeapStart, ulHeapSize },
        { NULL, 0 }
    };

    vPortDefineHeapRegions( xHeapRegions );
}

  1. The settings in there are for an SPI-based combined MAC/PHY

I used 2 EMAC/PHY’s in this project: one through SPI, and the EMAC peripheral. I needed a second interface to test FreeRTPS+TCP /multi.
You won’t need SPI to set-up Ethernet.