FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2016 Threads]
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.
- configMACINTERRUPTPRIORITY 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: configMAXPRIORITIES needs to be an integer (with no casting [with older FreeRTOS it was `((unsigned portBASETYPE) 5)` and that bonks]). If you want to use vTaskList(), you now need to set a new configUSESTATSFORMATTING_FUNCTIONS to 1.
- With respect to the instructions, it is also necessary to include srcfreertos_plus-tcpportableNetworkInterface[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 __cplusplus
instead of #ifdef __cplusplus
.
- 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/packstructstart.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 packstructend.h this:
/* restore diagnostics */
#pragma GCC diagnostic pop
Thanks for the feedback. We have a SAM4E demo already, is the SAMV7 MAC
compatible with the SAM4E?
I would be grateful if you could post your code (at least the driver
level, if the application cannot be posted) to the FreeRTOS Interactive
site. We are aware of people using FreeRTOS+TCP on various chips and
would like to create a library of such things, but people seem to
'forget' to post their code:
http://interactive.freertos.org/forums/21211265-FreeRTOS-TCP
Comments below:
- configMACINTERRUPTPRIORITY 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).
You can use the SAM4E example as a reference here. In most cases you
would want to use the highest
priority from which FreeRTOS API functions can be called, but it is
somewhat application dependent as the network might not be your highest
priority. The SAM4E demo has it set to
configLIBRARYMAXSYSCALLINTERRUPTPRIORITY.
- FreeRTOS upgrade issues: configMAXPRIORITIES needs to be an integer
(with no casting [with older FreeRTOS it was ((unsigned
portBASETYPE) 5) and that bonks]). If you want to use vTaskList(),
you now need to set a new configUSESTATSFORMATTING_FUNCTIONS to 1.
That cast is often getting in the way now, normally when the definition
is used in a pre-processor directive which doesn't understand the cast.
- 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/packstructstart.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 packstructend.h this:
|/ restore diagnostics */ #pragma GCC diagnostic pop|
Right. In this case packed structures is a necessity.
- 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.
Not sure about this one and will have to follow your suggestion to see.
- FreeRTOS_Sockets.h erroneously uses |#if __cplusplus| instead of
|#ifdef __cplusplus|.
Fixed - thanks.
Thanks. The references about priorities are helpful.
I did not modify the driver; I believe the SAMV71 MAC is compatible with the SAM4E.
You might want to add the instruction to add the include path src\freertos_plus-tcp\portable\NetworkInterface\[microcontroller]
in the website instructions for including in a project (you may not have seen that comment as I added it in an edit to the message before).
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.