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+TCP with STM32F429 and LAN8720

Posted by mgolebiowski on October 6, 2016

Hello, I'm doing a project on STM32F429ii and LAN8720( http://ww1.microchip.com/downloads/en/DeviceDoc/00002165B.pdf ) PHY with FreeRTOS. It'll serve a Webserver with continuous data fetch over AJAX and Modbus TCP.

I have a working version based on LwIP and Demo from ST but there are problems with long working continuous data fetch propably because of LwIP or ST's ETH driver.

I'm now trying to set up the FreeRTOS+TCP stack instead of LwIP. I used this demo http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusTCP/TCP-IPFATExamplesSTSTM32F407.html as a starting point but I have problems with make the TCP stack working with my hardware.

And here is the question: what should I change in NetworkInterface.c and HAL driver in this demo to make it working with my PHY? Unfortunately changing the defines (like PHYBCR etc.) and GPIOs HALETH_MspInit is not enough and it's still not responding for pings.

Thanks for help, Michal


FreeRTOS+TCP with STM32F429 and LAN8720

Posted by rtel on October 6, 2016

As you have a working driver for your existing lwIP example I presume you already have a working initialise and transmit function - albeit with the lwIP function names rather than the function names FreeRTOS+TCP expects.

As a starting point I would suggest using the lwIP initialisation function, but call it xNetworkInterfaceOutput(), so it links with FreeRTOS+TCP. That way you don't need to change any of the PHY code as you have it working already.

You will probably also be able to use the lwIP transmit function, which can be renamed xNetworkInterfaceOutput() so it links with FreeRTOS+TCP, but that will require some updates as the packets passed into the function for transmission will be in FreeRTOS+TCP network buffers rather than lwIP network buffers.

That should be enough to see data going out onto the network - once that is working you can then create the receive function from the lwIP receive function too, but again you will have to adapt it to package the received data in FreeRTOS+TCP network buffers rather than lwIP network buffers. In this case there is no specific function name that is needed, but you do need to send the network buffers on a queue. You will see how that is done in the FreeRTOS+TCP STM32 driver that you are already using as a reference.

Once things are just 'working' you can look at how you could optimise them for FreeRTOS+TCP, if optimisation is a concern.

http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusTCP/EmbeddedEthernetPorting.html


[ 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