hithesh123
Full Member level 6
- Joined
- Nov 21, 2009
- Messages
- 324
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Location
- lax
- Activity points
- 3,548
The compiler is IAR. The device is TI CC2510What is the compiler and device to which you are referring?
Some compilers like KEIL already offer such a implementation.
BigDog
void print_uart(unsigned char *strng)
{
while(*strng!='\0')
{
tx(*strng++);
}
}
print_uart("Hello world");
u can use following function as
void print_uart(unsigned char *strng)
{
while(*strng!='\0')
{
tx(*strng++);
}
}
now tx function will send one byte at a time. and u can use fun as
print_uart("Hello world");
which is same as printf.
If it is one character then it is a character and not string. single characters should be enclosed in single quotes and strings should be enclosed in double quotes.
void printf_uart(char *strn)
{
UTX0IF=0; // RESET TX IF
while(*strn!='\0')
{
U0DBUF= *strn++;
while(UTX0IF==0);
UTX0IF=0;
}
}
Error[e16]: Segment ISTACK (size: 0x40 align: 0) is too long for segment definition.
I'm not familiar with your compiler or MCU, but this error message seems to indicate you've overflowed your stack. The conditions in which your problem occurs also point towards this.
Check its size. The stack must be large enough to hold all non-constant local variables in use at any instant, plus saved MCU registers and return addresses when functions are called.
I am calling the printf_uart function 3 timesShow your function call.
void noack_msg1()
{
UTX0IF=0; // RESET TX IF
printf_uart("ACK ERR");
ackcount=4;
}
What compiler are you using? IAR for ARM or AVR? Zip and post your IAR files so that it can be Compiled and tested. If you can't post you will not get much help and also quick solution.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?