cancel
Showing results for 
Search instead for 
Did you mean: 

3 uarts tx works on STR910-EVAL but only uart 0 rx work

d_steffen
Associate II
Posted on January 07, 2007 at 04:28

3 uarts tx works on STR910-EVAL but only uart 0 rx work

5 REPLIES 5
d_steffen
Associate II
Posted on May 17, 2011 at 09:33

Hi,

Does anyone have a working example using all 3 uarts

on the STR910-EVAL board (from ST).

Best thing would be a Keil project which is using the

ST STR9 library.

I've running all 3 uarts tx, but only uart 0 can rx data.

Best regards

d_steffen
Associate II
Posted on May 17, 2011 at 09:33

My port pin initialisation:

// Gonfigure UART0_Rx pin GPIO5.1

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init (GPIO5, &GPIO_InitStructure);

// Gonfigure UART0_Tx pin GPIO3.4

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3 ;

GPIO_Init (GPIO3, &GPIO_InitStructure);

// Gonfigure UART1_Rx pin GPIO3.2

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init (GPIO3, &GPIO_InitStructure);

// Gonfigure UART1_Tx pin GPIO3.3

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2;

GPIO_Init (GPIO3, &GPIO_InitStructure);

// Gonfigure UART2_Rx pin GPIO3.1

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPConnected = GPIO_IPConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init (GPIO3, &GPIO_InitStructure);

// Gonfigure UART2_Tx pin GPIO3.5

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3 ;

GPIO_Init (GPIO3, &GPIO_InitStructure);

Any ideas please ?

d_steffen
Associate II
Posted on May 17, 2011 at 09:33

I've found the error, some other gpio-initialisation

destroy the uarts rx configuration.

mehdi239955
Associate II
Posted on May 17, 2011 at 09:33

Hi Barricade,

Find attached an example using 3 UART (0,1 and 2) similar to the UART example in STlib.

I think that the problem is caused by GPIO configuration. 😉 In fact, I advise to change the GPIO Direction when transmitting:

// Configure UART0_Tx pin GPIO3.4

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3 ;

GPIO_Init (GPIO3, &GPIO_InitStructure);

The configuration should be like this:

GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

If you’re using GPIO_DeInit ,try to use only one time at the begin of the GPIO configuration.

GPIO_DeInit(GPIO5);

GPIO_DeInit(GPIO3);

// Configure UART0_Tx pin GPIO3.4

// Configure UART1_Rx pin GPIO3.2

// Configure UART1_Tx pin GPIO3.3

…

I hope this can help you.

BSRD.

🙂

[ This message was edited by: MBS on 04-01-2007 17:41 ]

d_steffen
Associate II
Posted on May 17, 2011 at 09:33

Hi MBS,

thank you for your answer, but I've

solved this problem 2 months ago.

Another (later) GPIO configuration has overwritten

my (before) correct initialization of the GPIO Uart

pins.

If you would help, look at my other

still open posts.

Thank you, best regards