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

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