Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

FreeRTOS+UDP on Pic24

Posted by Quatoria on August 27, 2013
Hello,

I just wanted to know if somebody has already ported FreeRtOS+UDP to Microchip P24 ?

I already understand the chapter http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_UDP/Embedded_Ethernet_Porting.shtml for functions description but have no idea about amount of job, the other solution is probably to use the entire TCPIPStack from Microchip but probably with more problem concerning multitasking..

So I am not asking to do the job but just having some input and thought about this problem.

Regards and Thanks

RE: FreeRTOS+UDP on Pic24

Posted by Richard on August 29, 2013
...no replies, so I guess nobody reading the thread has anyway.

Porting is quite straight forward, and even more so if Microchip provide their own drivers. Stick to the 'standard' rather than 'zero copy' interface to start with as it is simpler. If you need the extra performance you can add in the zero copy interface once the standard one is working.

I'm not aware of any PIC24 devices with Ethernet on-board so maybe you are planning on using one of the MAC/PHY devices with an SPI interface - if so then I'm sure you will be able to get some source code from Microchip too.

Regards.

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 29, 2013
Dear Richard,

No replies OR nobody did the job to port FrreRTOS+UDP on Pic24 ! by the way I am using my own board with ENC424J600 from Microchip, so the hardware driver is not a problem with SPI interface, if I understood well I have to concentrate effort on 3 functions to interface with freertos+udp... I will try to do it... if any question comes up, I hope to have little support from here..

Regards

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 29, 2013
Dear Richard,

I have 2 questions concerning frreRTOS+UDP :

1) Concerning pack_struct_end.h and start does this FreeRTOS-Plus/FreeRTOS-Plus-UDP/portable/Compiler/GCC already contains implementations for other compilers that can be used directly, or as a reference when adding new compiler ports is ok for Xc compiler for pic24 ?

2) When compiling I got error that the file demoiptrace.h is missing, I did not find in the available files is this normal ?

Best Regards

RE: FreeRTOS+UDP on Pic24

Posted by Richard on August 29, 2013
“1)”


pack_struct_start/end.h has definitions for the compilers that have already been used by us. You can add to the files as needed by the compiler you are using.

I think XC is GCC, so it might be that you don't need to edit the files at all. Although, having a quick look at the XC16 user guide, it seems that you may need to use __pack to pack structures, as in:

__pack struct DATAPOINT {
unsigned char type;
int value;
} x-point;


...cut from the user guide directly. That means pack_struct_start would contain __pack and pack_struct_end would contain just the semicolon (;).


“2)”


You can either include the path to the demoiptrace.h header file (which I think is part of FreeRTOS-Plus/Demo, rather than FreeRTOS-Plus/Source) or remove the line:

#include "DemoIPTrace.h"


from the bottom of FreeRTOSIPConfig.h so it does not even try including the header file. The header file in question is just an example of how the UDP trace macros can be used and is not necessary for the UDP stack to function correctly.

Regards.

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 29, 2013
Thanks Richard,

Very strange error when compiling, is says The FreeRTOS header file task.h must be included before FreeRTOS_Sockets.h., when looking at task.h the define is like this :

#ifndef INC_TASK_H
#define INC_TASK_H

so the error is normal since FreeRTOS_Sockets.his expecting to have TASK_H define instead of INC_TASK_H may be a change in v 7.5.2 ?

Regards

RE: FreeRTOS+UDP on Pic24

Posted by Richard on August 29, 2013
Yes - the definition in task.h was changed in V7.5.0 to make it consistent with the other files. What you are seeing is a slight "side effect" ;o) of the change that is in the current release, although it has been corrected in the SVN copy. Just change it manually from TASK_H to INC_TASK_H for now to get you past that.

Regards.

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 29, 2013
I did the change before your answer, thanks. Anther side effect may be this error appears :

FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_UDP_IP.c:63:5: error: missing binary operator before token "1000"

this is on the line

#if configTICK_RATE_HZ > 1000
#error configTICK_RATE_HZ must be less than 1000 to use FreeRTOS+UDP
#endif

for me nothing abnormal or may be the error is on freertosconfig.h :

#define configTICK_RATE_HZ( ( portTickType ) 1000 )

??

Regards

RE: FreeRTOS+UDP on Pic24

Posted by Richard on August 29, 2013
It might just be complaining about the cast to portTickType in the #define. The cast is not needed.

Regards.

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 31, 2013
Dear Richard,

Progressing and trying to at least compile the FreeRTOS + UDP with mplabX and latest version of FreeRtos :

1) Concerning __pack it does nor work on XC16 latest version it can not compile also if flag "use CCI syntax " is checked so the only things ok is

__attribute__((__packed__)) and semicolon at the end of struct definition.

Except this point I still have strange error on all these lines :

xNetworkBufferDescriptor_t *pxNetworkBufferGet( size_t xRequestedSizeBytes, portTickType xBlockTimeTicks );
xNetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );
void vNetworkBufferRelease( xNetworkBufferDescriptor_t * const pxNetworkBuffer );
portBASE_TYPE vNetworkBufferReleaseFromISR( xNetworkBufferDescriptor_t * const pxNetworkBuffer );

Error is :

FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/include/NetworkBufferManagement.h:45:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

and after few time of searching I can not solve them.

Regards

RE: FreeRTOS+UDP on Pic24

Posted by Dave on August 31, 2013
Looks like it does not know what xNetworkBufferDescriptor_t is. xNetworkBufferDescriptor_t must be defined in a header file. Is the header file being included?

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 31, 2013
Yes included.


RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 31, 2013
I have only few error at the linking now but very strange error :

build/default/production/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_Sockets.o(.text+0x2c6): In function `.LSM86':: undefined reference to `_xQueueCreateCountingSemaphore'
build/default/production/FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/portable/BufferManagement/BufferAllocation_2.o(.text+0xc): In function `.LSM2':
: undefined reference to `_xQueueCreateCountingSemaphore'

I can not find any trace of this function xQueueCreateCountingSemaphore somewhere !

Regards

RE: FreeRTOS+UDP on Pic24

Posted by Dave on August 31, 2013
Set configUSE_COUNTING_SEMAPHORES to 1 in FreeRTOSConfig.h to make the function available.

xQueueCreateCountingSemaphore() is not directly a part of the public API but called indirectly by the xSemaphoreCreateCounting() macro (defined in semphr.h).

RE: FreeRTOS+UDP on Pic24

Posted by Quatoria on August 31, 2013
Thanks Dave it is ok now,

I was also oblige to add ping function in order to link correctly, now building is done...

RE: FreeRTOS+UDP on Pic24

Posted by Richard on August 31, 2013
“ I was also oblige to add ping function in order to link correctly, now building is done...”


If you set ipconfigSUPPORT_OUTGOING_PINGS to 1 in FreeRTOSIPConfig.h then you need to supply a ping reply hook. If you don't need that then set ipconfigSUPPORT_OUTGOING_PINGS to 0.

Regards.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists