cancel
Showing results for 
Search instead for 
Did you mean: 

using VIC0 and VIC1 both

sr_shinde
Associate II
Posted on December 10, 2008 at 00:49

using VIC0 and VIC1 both

9 REPLIES 9
sr_shinde
Associate II
Posted on May 17, 2011 at 09:56

Hi all

We are using FreeRTOS.

We have configured TIM0 interrupt,TIM1 interrupt,CAN interrupt those are in VIC0.Also we have configured UART0 receive interrupt,Wake up interrupt those are in VIC1.

We are getting interrupt of VIC0.But we are not getting interrupt of VIC1.

Is there any other configuration related to VIC1

Please Guide me through

Regards

Sai

dhoyen
Associate II
Posted on May 17, 2011 at 09:56

Hi,

I was using both of VIC0 as VIC1, with FreeRTOS, with plenty of interrupt source (7 or 8). Both was working.

Are you able to fire (more than 1 time, to be sure the return works correctly) a unique interrupt source, located with the VIC1 ?

Regards

damien HOYEN

sjackson
Associate II
Posted on May 17, 2011 at 09:56

I'm having a similar problem. Like dhoyen, I also use FreeRTOS and try to get receive interrupts on UART1 via VIC1. They work for awhile but eventually just seem to stop working altogether for no apparent reason. Oddly enough, an external interrupt that operates through the WIU interrupt channel (also on VIC1) continues to function normally.

I know that ST just released a new Errata sheet for the STR9 with an item that mentions an issue with daisy-chained interrupts, but the workaround description given isn't very helpful; whenever I try to implement it interrupts break entirely.

Does anyone know if this issue could be related and if so, what the proper ISR assembly routine should look like? Even if it isn't a FreeRTOS version of the routine, I'd still like to take a look.

[ This message was edited by: SJackson on 05-12-2008 20:39 ]

mark9
Associate II
Posted on May 17, 2011 at 09:56

I had trouble with interrupts and FreeRTOS. There seemed to be 2 problems. One had something to with the watchdog timer -- if you used the JTAG debugger to halt the code, all interrupts would stop working after that. The second problem had to do with not enabling IRQ and FIQ interrupts for SYS mode in the init script. I thought I could enable interrupts are any point later in the code, but that did not seem to work. I didn't investigate.

dhoyen
Associate II
Posted on May 17, 2011 at 09:56

@lakata : Hum, you should look at the end of your development to implement the watchdog functionnality... My point of view is: before is always a lack of time, and complexify deeply the debuging...

@sr_shinde: How do you acquit your VIC controler
sjackson
Associate II
Posted on May 17, 2011 at 09:56

Quote:

On 08-12-2008 at 14:46, Anonymous wrote:

@lakata : Hum, you should look at the end of your development to implement the watchdog functionnality... My point of view is: before is always a lack of time, and complexify deeply the debuging...

@sr_shinde: How do you acquit your VIC controler ? Could you insert your IRQ declaration in assembler.

Regards.

Damien hoyen

FreeRTOS uses the watchdog interrupt to generate a system tick so that it can perform scheduling duties, so its likely that lakata didn't do anything to the WDG interrupt specifically and was/is probably just experiencing the effects of some other issue.

Also, I'm guessing you meant to ask sr_shinde how his VIC init sequence goes.

[ This message was edited by: SJackson on 08-12-2008 19:57 ]

sr_shinde
Associate II
Posted on May 17, 2011 at 09:56

Hi all

Now I have configured VIC by directly configuring its SFR,previously it was configured using library.And now its working.

But UART0 receive interrupt doesn't work with UART1(No interrupt just TX).

When I Disabled(commented) UART1 configuration it works.

Regards

Sai

sjackson
Associate II
Posted on May 17, 2011 at 09:56

Can you post the code you use to initialize the UARTs and GPIO lines associated with them?

Edit:

Nevermind. I found it here: http://www.st.com/mcu/modules.php?mop=modload&name=Splatt_Forums&file=viewtopic&topic=7693&forum=21

[ This message was edited by: SJackson on 09-12-2008 14:19 ]

sr_shinde
Associate II
Posted on May 17, 2011 at 09:56

Hi all

UART0 configuration is as follows:

void Init_UART0(unsigned long l_ulg_BaudRate)

{

GPIO_InitTypeDef GPIO_InitStructure;

UART_InitTypeDef UART_InitStructure;

SCU_APBPeriphClockConfig(__UART0, ENABLE);

SCU_APBPeriphReset(__UART0, DISABLE);

SCU_APBPeriphClockConfig(__GPIO6 , ENABLE);

SCU_APBPeriphReset(__GPIO6, DISABLE);

//UART0 Rx pin configuration

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init (GPIO6, &GPIO_InitStructure);

//UART0 Tx pin configuration

GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt3;

GPIO_Init (GPIO6, &GPIO_InitStructure);

//UART0 Configuration

UART_InitStructure.UART_WordLength = UART_WordLength_8D;

UART_InitStructure.UART_BaudRate = l_ulg_BaudRate;

UART_InitStructure.UART_StopBits = UART_StopBits_1;

UART_InitStructure.UART_Parity = UART_Parity_No ;

UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None;

UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;

UART_InitStructure.UART_FIFO = UART_FIFO_Disable;

UART_Init(UART0, &UART_InitStructure);

VIC1->VAiR[1] = (u32)UART0_IRQHandler;

VIC1->VCiR[1] = 0x20 | 0;

VIC1->INTSR &= ~(1);

VIC1->INTER |= (1);

UART_ITConfig(UART0,UART_IT_Receive, ENABLE); //Enable Receive Interrupt

UART_Cmd(UART0, ENABLE); //Enable UART0

}

UART2 configuration is as follows:

void Init_UART2(unsigned long l_ulg_BaudRate)

{

GPIO_InitTypeDef GPIO_InitStructure;

UART_InitTypeDef UART_InitStructure;

SCU_APBPeriphClockConfig(__UART2, ENABLE);

SCU_APBPeriphReset(__UART2, DISABLE);

SCU_APBPeriphClockConfig(__GPIO3 , ENABLE);

SCU_APBPeriphReset(__GPIO3, DISABLE);

//UART0 Rx pin configuration

GPIO_InitStructure.GPIO_Direction = GPIO_PinInput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1;

GPIO_Init (GPIO3, &GPIO_InitStructure);

GPIO_StructInit(&GPIO_InitStructure); //Reset GPIO initstructure

//UART0 Tx pin configuration

GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;

GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull;

GPIO_InitStructure.GPIO_IPInputConnected = GPIO_IPInputConnected_Enable;

GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt2;

GPIO_Init (GPIO3, &GPIO_InitStructure);

//UART0 Configuration

UART_InitStructure.UART_WordLength = UART_WordLength_8D;

UART_InitStructure.UART_BaudRate = l_ulg_BaudRate;

UART_InitStructure.UART_StopBits = UART_StopBits_1;

UART_InitStructure.UART_Parity = UART_Parity_No ;

UART_InitStructure.UART_HardwareFlowControl = UART_HardwareFlowControl_None;

UART_InitStructure.UART_Mode = UART_Mode_Tx_Rx;

UART_InitStructure.UART_FIFO = UART_FIFO_Disable;

UART_Init(UART2, &UART_InitStructure);

UART_Cmd(UART2, ENABLE); //Enable UART0

}

Let me know if I have done any mistake

Regards

Sai