Reply by "Bajaj, Rahul" March 6, 20082008-03-06
Hi,

This has already happened with me. I also tried using printf( ). I am using MSP430 and IAR compiler over JTAG/USB. It should not work and program was locked as MSP does not know the meaning of printf statement. you have to make your own function if yu want to get some information from running MSP you can print chracters in flash or to serial port.

regards,
Rahul


________________________________

From: m... [mailto:m...] On Behalf Of oliver at mettrix
Sent: Montag, 3. Mz 2008 22:57
To: m...
Subject: Re: [msp430] Re: printf() causes lockup

Thank you for the information and ideas provided so far.

The development device we are using is the TI EZ430-RF2500
When we ran our small printf program, it resided on the AP and we did not enable any trasmissions/receptions, etc.

As we understand it the 430 devices talkst to another 430 device via SPI which then talks out the USB. So I don't think we are
using JTAG in any way to communicate.

Perhaps this will provide more information, hopefully useful.

Oliver P. Engel
Mettrix Technology Corp
1906 Rt 52 Suite D
Hopewell Junction, NY 12533

PH: 845 897 4960
FX: 845 897 5529

----- Original Message -----
From: microbit
To: m...
Sent: Monday, March 03, 2008 4:48 PM
Subject: RE: [msp430] Re: printf() causes lockup

I've never particularly had problems with printf().
In case you are using it to stdout (ie. __putchar()), make sure your stack is deep enough.
Although I must say it doesn't sound like a stack overflow problem.

Is your printf() talking through the JTAG perhaps ? Something fishy might be on there.

Best Regards,
Kris

--- In m... , "oliver at mettrix" wrote:
>
> Hello,
>
> Thanks to all who have provided help with our questions recently.
>
> Here's a new one that is giving fits:
>
> To get some information out of the IAR we use a printf statement.
Without the printf(), the program runs. With it, the program locks up
> after some variable number of printf() statement executions.
>
> Here's main: All it has to do is print the value of i every 100
times through the loop, yet the program dies, sometime after just a few
> printf executions, other times after 50 or more.
>
> If any one has any insight, we'd greatly appreciate it.
>
> Thank you:
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
>
> SYS_initPorts(); // Initialize GPIO pins
>
>
>
> int i = 0;
>
>
>
> while (TRUE){
>
> if( i%100 == 0) printf("%d\n", i);
>
> i++;
>
> }
>
>
>
>
> Oliver
> Mettrix Technology Corp
>
>
>
>


Beginning Microcontrollers with the MSP430

Reply by "Bajaj, Rahul" March 5, 20082008-03-05
May be this is of some help:

http://www.dur.ac.uk/peter.baxendale/stuff/msp430/msp430-development.pdf


________________________________

From: m... [mailto:m...] On Behalf Of oliver at mettrix
Sent: Montag, 3. Mz 2008 22:57
To: m...
Subject: Re: [msp430] Re: printf() causes lockup

Thank you for the information and ideas provided so far.

The development device we are using is the TI EZ430-RF2500
When we ran our small printf program, it resided on the AP and we did not enable any trasmissions/receptions, etc.

As we understand it the 430 devices talkst to another 430 device via SPI which then talks out the USB. So I don't think we are
using JTAG in any way to communicate.

Perhaps this will provide more information, hopefully useful.

Oliver P. Engel
Mettrix Technology Corp
1906 Rt 52 Suite D
Hopewell Junction, NY 12533

PH: 845 897 4960
FX: 845 897 5529

----- Original Message -----
From: microbit
To: m...
Sent: Monday, March 03, 2008 4:48 PM
Subject: RE: [msp430] Re: printf() causes lockup

I've never particularly had problems with printf().
In case you are using it to stdout (ie. __putchar()), make sure your stack is deep enough.
Although I must say it doesn't sound like a stack overflow problem.

Is your printf() talking through the JTAG perhaps ? Something fishy might be on there.

Best Regards,
Kris

--- In m... , "oliver at mettrix" wrote:
>
> Hello,
>
> Thanks to all who have provided help with our questions recently.
>
> Here's a new one that is giving fits:
>
> To get some information out of the IAR we use a printf statement.
Without the printf(), the program runs. With it, the program locks up
> after some variable number of printf() statement executions.
>
> Here's main: All it has to do is print the value of i every 100
times through the loop, yet the program dies, sometime after just a few
> printf executions, other times after 50 or more.
>
> If any one has any insight, we'd greatly appreciate it.
>
> Thank you:
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
>
> SYS_initPorts(); // Initialize GPIO pins
>
>
>
> int i = 0;
>
>
>
> while (TRUE){
>
> if( i%100 == 0) printf("%d\n", i);
>
> i++;
>
> }
>
>
>
>
> Oliver
> Mettrix Technology Corp
>
>
>
>


Reply by oliver at mettrix March 4, 20082008-03-04
Thank you for the information and ideas provided so far.

The development device we are using is the TI EZ430-RF2500
When we ran our small printf program, it resided on the AP and we did not enable any trasmissions/receptions, etc.

As we understand it the 430 devices talkst to another 430 device via SPI which then talks out the USB. So I don't think we are
using JTAG in any way to communicate.

Perhaps this will provide more information, hopefully useful.
Oliver P. Engel
Mettrix Technology Corp
1906 Rt 52 Suite D
Hopewell Junction, NY 12533

PH: 845 897 4960
FX: 845 897 5529
----- Original Message -----
From: microbit
To: m...
Sent: Monday, March 03, 2008 4:48 PM
Subject: RE: [msp430] Re: printf() causes lockup
I've never particularly had problems with printf().
In case you are using it to stdout (ie. __putchar()), make sure your stack is deep enough.
Although I must say it doesn't sound like a stack overflow problem.

Is your printf() talking through the JTAG perhaps ? Something fishy might be on there.

Best Regards,
Kris

--- In m..., "oliver at mettrix" wrote:
>
> Hello,
>
> Thanks to all who have provided help with our questions recently.
>
> Here's a new one that is giving fits:
>
> To get some information out of the IAR we use a printf statement.
Without the printf(), the program runs. With it, the program locks up
> after some variable number of printf() statement executions.
>
> Here's main: All it has to do is print the value of i every 100
times through the loop, yet the program dies, sometime after just a few
> printf executions, other times after 50 or more.
>
> If any one has any insight, we'd greatly appreciate it.
>
> Thank you:
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
>
> SYS_initPorts(); // Initialize GPIO pins
>
>
>
> int i = 0;
>
>
>
> while (TRUE){
>
> if( i%100 == 0) printf("%d\n", i);
>
> i++;
>
> }
>
>
>
>
> Oliver
> Mettrix Technology Corp
>
>
>
>
Reply by microbit March 3, 20082008-03-03
I've never particularly had problems with printf().
In case you are using it to stdout (ie. __putchar()), make sure your stack is deep enough.
Although I must say it doesn't sound like a stack overflow problem.

Is your printf() talking through the JTAG perhaps ? Something fishy might be on there.

Best Regards,
Kris

--- In m..., "oliver at mettrix" wrote:
>
> Hello,
>
> Thanks to all who have provided help with our questions recently.
>
> Here's a new one that is giving fits:
>
> To get some information out of the IAR we use a printf statement.
Without the printf(), the program runs. With it, the program locks up
> after some variable number of printf() statement executions.
>
> Here's main: All it has to do is print the value of i every 100
times through the loop, yet the program dies, sometime after just a few
> printf executions, other times after 50 or more.
>
> If any one has any insight, we'd greatly appreciate it.
>
> Thank you:
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
>
> SYS_initPorts(); // Initialize GPIO pins
>
>
>
> int i = 0;
>
>
>
> while (TRUE){
>
> if( i%100 == 0) printf("%d\n", i);
>
> i++;
>
> }
> Oliver
> Mettrix Technology Corp
>
>
Reply by old_cow_yellow March 3, 20082008-03-03
Do you have a "stdout"? Or, are you using the I/O Emulation Modules?

I tried I/O Emulation. See:
http://www.msp430.ubi.pt/forum/viewtopic.php?tb28

--- In m..., "oliver at mettrix" wrote:
>
> Hello,
>
> Thanks to all who have provided help with our questions recently.
>
> Here's a new one that is giving fits:
>
> To get some information out of the IAR we use a printf statement.
Without the printf(), the program runs. With it, the program locks up
> after some variable number of printf() statement executions.
>
> Here's main: All it has to do is print the value of i every 100
times through the loop, yet the program dies, sometime after just a few
> printf executions, other times after 50 or more.
>
> If any one has any insight, we'd greatly appreciate it.
>
> Thank you:
>
> void main(void)
>
> {
>
> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
>
> SYS_initPorts(); // Initialize GPIO pins
>
>
>
> int i = 0;
>
>
>
> while (TRUE){
>
> if( i%100 == 0) printf("%d\n", i);
>
> i++;
>
> }
> Oliver
> Mettrix Technology Corp
>
>
Reply by Kipton Moravec March 3, 20082008-03-03
Don't use printf. use itoa and puts.

I have run into more problems with different compilers with printf than
I care to deal with. I don't remember how IAR does it, but I have seen
some use the heap for intermediate storage. I do not like using a heap
in an embedded system at all.

So keep it simple. Use lower level routines that are simple. And static
sized buffers.

Kip
On Mon, 2008-03-03 at 15:53 -0500, oliver at mettrix wrote:
--
Kipton Moravec KE5NGX
"Always do right; this will gratify some people and astonish the rest."
--Mark Twain
Reply by oliver at mettrix March 3, 20082008-03-03
Hello,

Thanks to all who have provided help with our questions recently.

Here's a new one that is giving fits:

To get some information out of the IAR we use a printf statement. Without the printf(), the program runs. With it, the program locks up
after some variable number of printf() statement executions.

Here's main: All it has to do is print the value of i every 100 times through the loop, yet the program dies, sometime after just a few
printf executions, other times after 50 or more.

If any one has any insight, we'd greatly appreciate it.

Thank you:

void main(void)

{

WDTCTL = WDTPW + WDTHOLD; // Stop WDT

SYS_initPorts(); // Initialize GPIO pins

int i = 0;

while (TRUE){

if( i%100 == 0) printf("%d\n", i);

i++;

}

Oliver
Mettrix Technology Corp