Harmony V2 - issue with TCP/IP stack on external RAM
I'm trying to use the external RAM for the TCP/IP stack. FreeRTOS is configured with 5 heap regions (1 in internal RAM, 4 in external RAM [0xC0000000, 0xC0100000, 0xC0200000, 0xC0300000]). The TCP/IP stack is configured with
#define TCPIP_STACK_MALLOC_FUNC pvPortMalloc
#define TCPIP_STACK_CALLOC_FUNC pvPortCalloc
#define TCPIP_STACK_FREE_FUNC vPortFree
#define TCPIP_STACK_HEAP_USE_FLAGS TCPIP_STACK_HEAP_FLAG_NO_MTHREAD_SYNC
#define TCPIP_STACK_HEAP_USAGE_CONFIG TCPIP_STACK_HEAP_USE_DEFAULT
#define TCPIP_STACK_SUPPORTED_HEAPS 1
Upon startup, the TCP stack is able to allocate memory from FreeRTOS. During startup _MACDeinit is called which frees up buffers by calling _MacRxFreeCallback and _MacTxFreeCallback.
These two functions call DRV_ETHMAC_LibDescriptorGetBuffer. In DRV_ETHMAC_LibDescriptorGetBuffer it is checked if a buffer exists. If yes, it is returned with an address translation.
if(pEDcpt->hwDcpt.pEDBuff != 0)
However, this address translation calculates addresses that are invalid and we get a "data bus error" (Type: 1; Cause: 7) upon accessing the memory location. So I'm wondering if anybody can provide a hint what I am missing here? Does this kind of setup require to map the external RAM to specific locations? Why do we need the mapping between PA and KVA addresses
in the first place?
* Harmony Configurator 220.127.116.11
* TCP/IP Stack 7.31
* External RAM (4 x 512K)