Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

FreeRTOS with ethernet

Posted by Rickey Leung on December 16, 2008
Dear Richard,

As mentioned, we need to plug our design board on top of STR91x. But we found a problem, the Ethernet in FreeRTOS on STR91x use the GPIO5 with
GPIO_Struct.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3;
......
......
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2;

but we need the GPIO5 (Pin 0 and Pin 1) to be our extend memory addressing and must be set as:
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1;

It causes the Ethernet not working at all!! Any solution? Can we use another Pin as Ethernet?

Rickey Leung

RE: FreeRTOS with ethernet

Posted by Stefano Oliveri on December 16, 2008
Dear Rickey,

STR91x should allow to configure each in PIN in independent manner. In your case you can try something like this:

void GpioCongiguration()
{
...
GPIO_DeInit(GPIO5);
GPIO_Struct.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_3;
GPIO_Struct.GPIO_Type = GPIO_Type_PushPull;
GPIO_Struct.GPIO_Direction = GPIO_PinOutput;
GPIO_Struct.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable;
GPIO_Struct.GPIO_Alternate=GPIO_OutputAlt2;
GPIO_Init(GPIO5, &GPIO_Struct);

GPIO_Struct.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
GPIO_Struct.GPIO_Alternate=GPIO_OutputAlt1;
GPIO_Init(GPIO5, &GPIO_Struct);
...
}

This code doesn't prevent Ethernet to work.

Regards,
Stefano

RE: FreeRTOS with ethernet

Posted by Rickey Leung on December 16, 2008
Many thx~ It solved!
But another problem is we need to address the ext. memory (21e00000) in ST91x. I have configured the EMI as follow but still failed~ can you help me?


GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5 |GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3;
GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable;
GPIO_Init (GPIO5, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2;
GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Disable;
GPIO_Init (GPIO7, &GPIO_InitStructure);
GPIO_Init (GPIO8, &GPIO_InitStructure);
GPIO_Init (GPIO9, &GPIO_InitStructure);



// those bastards. this one pin out of 24 is on a different alt bus
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3;
GPIO_Init (GPIO7, &GPIO_InitStructure);



// configure SCU
SCU_EMIModeConfig(SCU_EMI_DEMUX);
SCU_EMIBCLKDivisorConfig(SCU_EMIBCLK_Div1); // or SCU_EMIBCLK_Div1;
SCU->GPIOEMI = 1; // enable ports 8 & 9 for EMI


GPIO_EMIConfig( ENABLE );

/* Enable EMI clock */
EMI_DeInit();
EMI_StructInit( &eMI_InitStruct );
eMI_InitStruct.EMI_Bank_MemWidth = EMI_Width_HalfWord;
eMI_InitStruct.EMI_Bank_IDCY =0x6;
eMI_InitStruct.EMI_Bank_WSTRD =0x6;
eMI_InitStruct.EMI_Bank_WSTWR =0x6;
eMI_InitStruct.EMI_Bank_WSTROEN=0x6;
eMI_InitStruct.EMI_Bank_WSTWEN=0x08;
eMI_InitStruct.EMI_Bank_MemWidth=EMI_Width_HalfWord;
EMI_Init( EMI_Bank1, &eMI_InitStruct );




RE: FreeRTOS with ethernet

Posted by Stefano Oliveri on December 18, 2008
Dear Rickey,

have you given a look at the application note from ST?

http://www.st.com/mcu/modules.php?name=mcu&file=familiesdocs&FAM=101

There is one that describe how to configure the STR9 EMI:

AN2647 - Using the STR91xFA external memory interface (EMI)

Best regards,
Stefano


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


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner