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 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 ]    [ 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