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

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