Quality RTOS & Embedded Software

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


Loading

Enabling USART interrupt sources makes only the first task start

Posted by adissida on September 14, 2015

But, when I have the USB cable from the FTDI chip to my computer connected, then it works, all tasks start. Have I missed something?

This is my init of uart:

void trvInitCLIUART( void ) { volatile avr32usartt *usart = trvCLIUSART; // CLI - USART1 INIT static const gpiomapt USARTGPIOMAP = { {trvCLIUSARTRXPIN, AVR32USART1RXD00FUNCTION}, {trvCLIUSARTTXPIN, AVR32USART1TXD00FUNCTION} }; static const usartoptionst USARTOPTIONS = { .baudrate = trvCLIUSARTBAUD, .charlength = trvCLIUSARTCHARLENGTH, .paritytype = USARTNOPARITY, .stopbits = USART1STOPBIT, .channelmode = USARTNORMALCHMODE };

trvUART_CLI_CREATE_QUEUES();

portENTER_CRITICAL();
{
	gpio_enable_module( USART_GPIO_MAP, sizeof(USART_GPIO_MAP) / sizeof(USART_GPIO_MAP[0]) );

	usart_init_rs232( trvCLI_USART, &USART_OPTIONS, F_CPU );

	// disable receiver and transmitter. */
	usart->cr |= AVR32_USART_CR_RXDIS_MASK | AVR32_USART_CR_TXDIS_MASK;

	trvUART_CLI_ISR_reg();

	/* Enable USART interrupt sources (but not Tx for now)... */
	usart->ier = AVR32_USART_IER_RXRDY_MASK;

	/* Enable receiver and transmitter... */
	usart->cr |= AVR32_USART_CR_TXEN_MASK | AVR32_USART_CR_RXEN_MASK;
}
portEXIT_CRITICAL();


trvCLI_ClearScreen();
//trvCLI_WriteLine( "Debug USART initiated\n\r" );

}


Enabling USART interrupt sources makes only the first task start

Posted by rtel on September 14, 2015

Sorry - I have no idea what you are trying to do, or what is wrong: http://www.freertos.org/FAQ-how-to-use-the-FreeRTOS-support-forum.html


Enabling USART interrupt sources makes only the first task start

Posted by adissida on September 14, 2015

Im usign v8.2.2 of freeRTOS together with ATMEL UC3. Im using my own custom PCB, no demo board. For CLI im using UART1 which is connected to a FTDI chip. I have also two tasks which is blinking two LEDs in different freq (just to see that it is alive). As long as I have the USB from FTDI chip connected to my computer, the two tasks is running, I get text on the console and so on... When I disconnect the USB for the console, only the first task starts. I then connect the FTDI USB to the computer and it is alive. I can also boot the board with USB from FTDI connected to computer, then disconnect it, and the two tasks is still running. So it has something to do with usart->ier = AVR32USARTIERRXRDYMASK. When I delete that line in the code above, it always works (two LEDs blinking), with or without the USB from FTDI connected to the computer (but not the interrupt).


Enabling USART interrupt sources makes only the first task start

Posted by heinbali01 on September 14, 2015

Hi Adis,

I'm afraid that the information that you're giving is still not enough to give some advice. You are setting an RX-ready interrupt, and I presume that somewhere the code (the ISR) checks what interrupts have been enabled. One of your tasks stops blinking the LED: it sounds like it stays in a blocking call for ever. If I were you I would use a limited value for xBlockTime so you are able to show more information and/or to set breakpoints.

Please give more information or attach some sample source code if you like.

Regards.


Enabling USART interrupt sources makes only the first task start

Posted by adissida on September 14, 2015

Hi Hein

I think I found the problem. In my code in the first post, if I only enter this: usart->cr = AVR32USARTCRTXENMASK; To be said; im using external RAM. The init of the SDRAM and vPortDefineHeapRegions() is done after the UART init. So when I put the usart->cr = AVR32USARTCRRXENMASK; after the SDRAM init it works.

The strange thing is why did it work before with the USB cable connected to the computer.


Enabling USART interrupt sources makes only the first task start

Posted by heinbali01 on September 15, 2015

The strange thing is why did it work before with the USB cable connected to the computer.

Maybe you board had somehow rebooted and therefore the SDRAM was still properly initialised?


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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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