FreeRTOS TCP/IP build for NXP FRDM-K64 board.

rseedle wrote on Friday, August 23, 2019:

I have been trying to get theTCP/IP stack for FreeRTOS to build. The issue that I am having now is that there is no
hardware specific source code for my development platform (ie. (formerly Freescale) NXP FRDM-K64. At this point I tried to use NXP LPC18xx NetworkInterface.c but I am getting some errors specific to the hardware.

Invoking: MCU C Compiler
arm-none-eabi-gcc -DFSL_RTOS_BM -DSDK_OS_BAREMETAL -DSDK_DEBUGCONSOLE=0 -DCR_INTEGER_PRINTF -DPRINTF_FLOAT_ENABLE=0 -DFSL_RTOS_FREE_RTOS -DSDK_OS_FREE_RTOS -DCPU_MK64FN1M0VLL12 -DCPU_MK64FN1M0VLL12_cm4 -D__MCUXPRESSO -D__USE_CMSIS -DDEBUG -D__REDLIB__ -I../board -I../source -I../ -I../amazon-freertos/include -I../amazon-freertos/FreeRTOS/portable -I../drivers -I../device -I../CMSIS -I../CMSIS_driver -I../component/serial_manager -I../component/uart -I../utilities -O0 -fno-common -g3 -Wall -c -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -D__REDLIB__ -specs=redlib.specs -MMD -MP -MF"drivers/fsl_adc16.d" -MT"drivers/fsl_adc16.o" -MT"drivers/fsl_adc16.d" -o "drivers/fsl_adc16.o" "../drivers/fsl_adc16.c"
../source/NetworkInterface.c:67:3: error: #error please define configNUM_RX_DESCRIPTORS in your FreeRTOSIPConfig.h
  #error please define configNUM_RX_DESCRIPTORS in your FreeRTOSIPConfig.h
   ^```
../source/NetworkInterface.c:71:3: error: #error please define configNUM_TX_DESCRIPTORS in your FreeRTOSIPConfig.h
  #error please define configNUM_TX_DESCRIPTORS in your FreeRTOSIPConfig.h
   ^```
../source/NetworkInterface.c:75:3: error: #error NETWORK_IRQHandler must be defined to the name of the function that is installed in the interrupt vector table to handle Ethernet interrupts.
  #error NETWORK_IRQHandler must be defined to the name of the function that is installed in the interrupt vector table to handle Ethernet interrupts.
   ^```

Any ideas ? The solution needs to work on a NXP FRDM-K64 board.

Randy Seedle

rtel wrote on Friday, August 23, 2019:

I suspect you will find a network driver for that part on the web somewhere. As for the error message you are getting - the error message is telling you what to do - define configNUM_RX_DESCRIPTORS in FreeRTOSIPConfig.h - so then look at why.

If I search the source code for the error I see it only appears in the LPCxx version of the network interface https://sourceforge.net/p/freertos/code/HEAD/tree/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/LPC18xx/NetworkInterface.c#l72 - then searching that file for the constant it is telling me I need to define I see it is used throughout the file, for example https://sourceforge.net/p/freertos/code/HEAD/tree/tags/V10.1.1/FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/portable/NetworkInterface/LPC18xx/NetworkInterface.c#l200 so if it is not defined the file won’t build and the error message is giving a hint as to why.

So that particular driver requires those #defines in addition to the ones that are always required in the FreeRTOSIPConfig.h file. If you define then, then the error will go away, but I don’t think that is helpful as the LPCxx driver is presumably using a very different Ethernet MAC to the K64 as one part was designed by NXP and the other by Freescale (although they could conceivably have licensed the MAC hardware IP from the same same place.