This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is it possible to put characters to console and get characters from console on 16K MSP 430? How do you set breakpoints, before downloading the program?
Silver Diamond said:Is it possible to put characters to console and get characters from console
What do you mean by, "console"?
A microcontroller (such as the MSP430) does not have a "console". It has some interfaces which you might use to connect to a console - but the console itself is entirely outside the microcontroller itself.
Perhaps you meant to ask how to use the UART...?
http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/18546.aspx
http://e2e.ti.com/support/microcontrollers/msp430/f/166/p/262106/917022.aspx#917022
Silver Diamond said:How do you set breakpoints, before downloading the program?
That will be described in the documentation for whatever toolset you are using.
I mean the debug console in CCS 5.3? Is it possible? program compiles but does not output anything when runs. Would be very handy.
There is an explanation below, but printf is big, is it possible to print a char at a time with less code?
http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler
When I follow these directions using printf, I get the error below, so I was hoping to just use minimal memory required to spit out characters like putchar, but when I use putchar it compiles but nothing comes through Console:
"../lnk_msp430fr5739.cmd", line 127: error #10099-D: program will not fit into available memory. placement with alignment fails for section "ALL_FRAM" size 0x4a14 . Available memory ranges:
FRAM size: 0x3d80 unused: 0x3d80 max hole: 0x3d80
error #10010: errors encountered during linking; "I2C.out" not built
My lnk_msp430fr5739.cmd listing is:
SECTIONS
{
GROUP(ALL_FRAM)
{
GROUP(READ_WRITE_MEMORY): ALIGN(0x0200) RUN_START(fram_rw_start)
{
.cio : {} /* C I/O BUFFER */
.sysmem : {} /* DYNAMIC MEMORY ALLOCATION AREA */
}
GROUP(READ_ONLY_MEMORY): ALIGN(0x0200) RUN_START(fram_ro_start)
{
.cinit : {} /* INITIALIZATION TABLES */
.pinit : {} /* C++ CONSTRUCTOR TABLES */
.init_array : {} /* C++ CONSTRUCTOR TABLES */
.mspabi.exidx : {} /* C++ CONSTRUCTOR TABLES */
.mspabi.extab : {} /* C++ CONSTRUCTOR TABLES */
.const : {} /* CONSTANT DATA */
}
GROUP(EXECUTABLE_MEMORY): ALIGN(0x0200) RUN_START(fram_rx_start)
{
.text : {} /* CODE */
}
} > FRAM
.bss : {} > RAM /* GLOBAL & STATIC VARS */
.data : {} > RAM /* GLOBAL & STATIC VARS */
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */
.infoA : {} > INFOA /* MSP430 INFO FRAM MEMORY SEGMENTS */
.infoB : {} > INFOB
Write your own functions. For example....
void putChar(char c)
{
while ( ( UCA0IFG & UCTXIFG ) == 0 );
UCA0TXBUF = c;
}
Doesn't this tell you the whole story? Your program is bigger than the available program memory. No compiler or linker setting will install more memory in the MSP.Silver Diamond said:program will not fit into available memory.
Only solution: make your code smaller or use a bigger MSP.
Or install an OS with a virtual memory driver and attach a HD. But that's perhaps a bit overkill.
Jens-Michael Gross said:Doesn't this tell you the whole story?
No, I don't think it does. He obviously knows it's too big, realizes that bringing along some of the library functions "bloats" the code, and was asking for alternatives to printf, for example. If you don't need formatting, then my recommendation was to write your own putChar function (getChar too, if you need it).
Alternatively, there are tiny printf implementations on the web that you can grab that provide basic formatting without unnecessarily bloating the binary image.
EDIT: Either way, I don't think we've helped him solve his original problem.... using the CCS console. But I'm not a CCS user...
Neither am I.Brian Boorman said:Either way, I don't think we've helped him solve his original problem.... using the CCS console. But I'm not a CCS user...
On IAR, there was a console feature where IAR was placing breakpoints to the (otherwise empty) default putchar/getchar functions, and fetching/injecting the data bytes through JTAG. I don't kjow whether a similar mechanism was implemented into CCS.
Alternatively, the usually console means you're sending data serially by UART. It may well be that the CSS console is just listening on the virtual serial port that is provided on several (but not all) FETS of evaluation boards (such as the LaunchPad). In this case, proper UART code is required to send and receive data. And you just don't need an external program such as HyperTerm, Putty or so.
However, I just looked into the CCS 4.2 users guide (searching the PDF for 'console') and it tells:
" Console I/O (CIO) functions, such as printf, require the use of a breakpoint. If these functions are compiled in, but you do not wish to use a breakpoint, disable CIO functionality by changing the option in Project →Properties → CCS Debug Settings → Target → Generic Debug Options → Enable CIO function use."
So this answers my own question: yes, CCS has also implemented the console through breakpoints.
And perhaps it is disabled by default (to save a breakpoint) on the latest versions of CSS.
Brian Boorman said:Write your own functions. For example....
void putChar(char c)
{
while ( ( UCA0IFG & UCTXIFG ) == 0 );
UCA0TXBUF = c;
}
[/quote]
Brian,
That requires an additional UART port. I was hoping this can be done over the debug port.
The IAR tools support this.... from the help file:
Terminal I/O window
The Terminal I/O window is available from the View menu.
Use this window to enter input to your application, and display output from it.
To use this window, you must:
Link your application with the option "With I/O emulation modules".
C-SPY will then direct stdin, stdout and stderr to this window. If the Terminal I/O window is closed, C-SPY will open it automatically when input is required, but not for output.
I assume CCS must have something similar...
At least CCS4.2 did. See my last post above.Brian Boorman said:I assume CCS must have something similar...
**Attention** This is a public forum