Quality RTOS & Embedded Software

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


Loading

Problem in Receiving char on MSP430

Posted by Nobody/Anonymous on April 3, 2005
Hi All,

I am using FreeRTOS on MSP430-449STK2 board from OLIMEX.

The downloaded demo application for MSP430 works fine on that. I can get characters on hyperterminal.

My problem is ....I am not able to receive characters from hyperterminal, like if I type char 'a' on hyperterminal then I should get it echoed back on hyperterminal coming through UART. What changes do I need to do ? I tried whatever I could do but seems I am not gettng any interrupt on typing character.

Also for debugging I am using GDB Insight, but for this I was not able to connect to target in target settings so I tried for 'simulator'. Is it correct to debug with simulator ?.

I have been struggling with this since ages.... :-(

Any help in this matter willbe appreciated.

Regards,
-mkh


RE: Problem in Receiving char on MSP430

Posted by Richard on April 3, 2005
> The downloaded demo application for MSP430 works fine on that. I can get characters
> on hyperterminal.

Good ...

> My problem is ....I am not able to receive characters from hyperterminal, like
> if I type char 'a' on hyperterminal then I should get it echoed back on hyperterminal
> coming through UART. What changes do I need to do ? I tried whatever I could
> do but seems I am not gettng any interrupt on typing character.

The behaviour of the standard demo is not to echo characters so I presume you have made some changes in order for it to do this.

The file that handles the serial port test functions is demo/common/minimal/contest.c. In this file you will see two tasks, vComTxTask() and vComRxTask(). The Rx task expects to receive characters from the Tx task but does not by default echo them. If you want the characters to be echoed then:

1) Stop the Tx task from getting created otherwise you will get a conflict between the two tasks both trying to access the serial port Tx registers simultaneously. To stop the Tx task getting created comment out the line that starts "cTaskCreate( vComTxTask, " with the function vAltStartComTestTasks().

2) Simplify the functionality of the Rx task so it simply waits until a character is received, then sends the character. Something like:

static vComRxTask( void *pvParameters )
{
signed cByteRxed;

----for( ;; )
----{
--------/* Block waiting for a character. */
--------if( cSerialGetChar( xPort, &cByteRxed, comRX_BLOCK_TIME ) )
--------{
------------/* Send the character just received. */
------------cSerialPutChar( xPort, cByteRxed, comNO_BLOCK );
--------}
----}
}

[I have not actually tried this code, so may be some typo's but you get the idea].

Is this similar to what you have tried? Have you made any other alterations?


> Also for debugging I am using GDB Insight, but for this I was not able to connect
> to target in target settings so I tried for 'simulator'. Is it correct to debug
> with simulator ?.

I have not used GDB with the MSP430, only ARM7.

How are you attempting to connect to the board using GDB? You either need the debugging stubs built into your code, or an intermediary such as OCDLibRemote which intercepts GDB commands and turns them into wiggler JTAG commands. Are you using a Wiggler?


Regards.


RE: Problem in Receiving char on MSP430

Posted by Nobody/Anonymous on April 3, 2005
Thanks Richard.

It works now. Actually I had not commented out the TX task and also I had to do

U1CTL |= CHAR ;

instead of

U1CTL |= CHAR + LISTEN;

Now to debug the code using insight or any other debugger, what steps do I need to do and where can I get the information/documentation. I am not using Wiggler or anything. As I am a student, can you suggest me something like freeware or cheaper ?

Thanks,
-mkh

RE: Problem in Receiving char on MSP430

Posted by Nobody/Anonymous on April 4, 2005
For debug you need a program called "msp430-gdbproxy". I think this comes with MSPGCC. Instructions for using this are on the FreeRTOS WEB site - MSP430 port pages.

GDB connects to msp430-gdbproxy using TCP (this is internal to your host machine - no cabling is required), then msp430-gdbproxy converts the tcp commands to/from wiggler commands.

You can alternatively use the simulator, but this is only a CPU core simulator and does not simulate the peripherals, so serial ports/timers/etc. will not be simulated and the RTOS tick will not tick.


[ 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