I thought I’d share my experience building this for an Atmel SAMV71Q21.
- The Atmel software framework (ASF) includes FreeRTOS 7.0.3 as the latest version, and that will not work with +TCP, as it is missing some functionality. I built with the latest 8.2.3.
- It’s important NOT to use the ASF module “PHY Ethernet MAC (GMAC) (driver)”, as this is superseded by the driver included in +TCP (under NetworkInterface/ATSAM4E). Otherwise the build will be tedious with conflicts, and it’s confusing as there are at least 5 gmac.h files. Hopefully the new driver is indeed compatible, but I haven’t gotten so far as to test yet.
- configMAC_INTERRUPT_PRIORITY needs to be defined in FreeRTOSConfig.h in order to build, but it’s not clear how to set this (relative to other priorities used by +TCP).
- FreeRTOS upgrade issues: configMAX_PRIORITIES needs to be an integer (with no casting [with older FreeRTOS it was
((unsigned portBASE_TYPE) 5)and that bonks]). If you want to use vTaskList(), you now need to set a new configUSE_STATS_FORMATTING_FUNCTIONS to 1.
- With respect to the instructions, it is also necessary to include src\freertos_plus-tcp\portable\NetworkInterface[microcontroller] in the include paths. And in case step 2 of the instructions is confusing, you need to build all the .c files in that directory (not just NetworkInterface.c).
- The code has a number of multiple declarations (FreeRTOS_netstat(), etc…) : it may be helpful to compile with -Wredundant-decls (in GCC) to find and eliminate them.
- FreeRTOS_Sockets.h erroneously uses
#if __cplusplusinstead of
- If you have certain warnings enabled in GCC, you’ll get hundreds of warnings about packed structs causing inefficient alignment. Under most circumstances these warnings are helpful, but not here. May I suggest using portable/Compiler/GCC/pack_struct_start.h to do this:
/* disable warnings about inefficient alignment caused by packed (they are deliberate here) */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wattributes" #pragma GCC diagnostic ignored "-Wpacked"
and at the end of pack_struct_end.h this:
/* restore diagnostics */ #pragma GCC diagnostic pop