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

LEUART problems in Silicon labs LG230

Posted by eldad-k on November 29, 2015

Hi. I'm working on a silicon labs MCU (LG230 - this is a cortex M3 device), and i seem to have a problem with the LEUART, when FreeRTOS is running. it appears that characters sometimes aren't received by the MCU. this only happens when the OS is running. this is the test setup: a host that constantly sends sequential characters (0, 1, 2...) to the device's LEUART, buadrate 9600, no parity, 8 bits. the device receives a character and checks if it matches what was expected (starting with 0, the device increments the next expected value - 0 received, the next expected is 1, and so on. overflow is taken into consideration). this happens in an infinite loop. if the device receives the correct character, it replies with an "A" character. if the device receives a wrong character (3 when expecting 2, etc.) it replies with a "N" character. these characters are used to trigger a scope that can be triggered by serial data). This is implemented in an ISR, not in a task. after a few minutes the scope always triggers - when checking the scope, i see that the device didn't reply at all for a few characters (no "A"s or "N"s), causing it to fail once it is "restored". checking the scope, the signals are very clean - no noise was found to indicate a reason why the character might be lost.

I thought that the problem might be related to moving in and out of sleep (EM2), so i performed the following tests: I ran the test, but prevented the OS from moving the MCU to sleep (it remained in EM0) - the problem persisted. I ran the test, disabled the OS, and prevented the MCU from going to sleep (it remained in EM0) - the problem was gone. i ran the test, disabled the OS, and created an infinite loop with a single "go to sleep (EM2)" line in it - the problem was gone. the conclusion is that moving in and out of sleep, isn't related to the problem.

in this test (when the OS is active) there's a single task that is doing nothing but vTaskDelay. the ISR doesn't use any OS functions. in the real system, this task uses OS "fromISR" functions, and i used NVIC_SetPriority to set the interrupt's priority correctly, so the OS recoginzes it, though it is irrelevant for the test above.

If anyone is familiar with such a problem, or how to further investigate it, please help. Thanks.


LEUART problems in Silicon labs LG230

Posted by rtel on December 3, 2015

Sorry this post took a while to appear. For some reason it ended up in a moderation queue, which happens from time to time, even though moderation is turned off.

this happens in an infinite loop. if the device receives the correct character, it replies with an "A" character. if the device receives a wrong character (3 when expecting 2, etc.) it replies with a "N" character. these characters are used to trigger a scope that can be triggered by serial data). This is implemented in an ISR, not in a task.

Can you please post some code, I'm confused as to where the infinite loop is if this is done in an ISR. Also, if a task is used, it would be good to see how the data is passed between ISR and task.


LEUART problems in Silicon labs LG230

Posted by rtel on December 3, 2015

LEUART problems in Silicon labs LG230

Posted by eldad-k on December 9, 2015

Hi. My bad, the use of "infinite loop" in this context was wrong. I meant to say that sending the sequential characters by the host happens continuously, with no expiry or stop conditions.

sequence start: Host sends a character through UART.

the device's UART receives the character and triggers an interrupt. the device's UART ISR is called, and checks if the character is the expected one. if yes, the device sends an "A" character as a reply. if no, the device sends a "N" character as reply. the UART is full duplex.

with OS active, there's a single task in the system. its infinte loop only contains a task delay. without an OS, there's a main loop that calls the sleep function (SLEEP_Sleep();).


[ 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