About printf

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

About printf

966 Views
sebasira
Senior Contributor I

Hello!

I'm new to MQX and RTOS in general; and I'm hands-on TWRK60N512. I'm trying out the examples from MQX installation and I've got a simple question about printf. For example, the hello project prints out "Hello World"... My doubt is, if printf flush data from standard out, then what's the stadard out? (TWRK60N512 has no display.... I also have the TWR-SER, does is it flush it through the UART?)

Thanks as always!!!

Best Regards!

SebaS

Tags (3)
0 Kudos
6 Replies

559 Views
JuroV
NXP Employee
NXP Employee

Hello sebasira,

in the mqx/source/bsp/twrk60n512/twrk60n512.h you can find:

        #define BSP_DEFAULT_IO_CHANNEL                    "ttyf:"    /* OSJTAG-COM   polled mode   */

I hope that this helps.

559 Views
sebasira
Senior Contributor I

Thanks Juraj!

It helps me a lot. Please, excuse my ignorance, I just need some tips, so I get more closely to it and then understand better MQX documentation. Further the more, I didn't know that OSJTAG was also listed as a COM port

But I'm confused... I found twrk60n512.h, inside two folders:

     1- mqx/source/bsp/twrk60n512/twrk60n512.h (the one you mentioned)

     2- lib\twrk60n512.iar\bsp

Wich one should I modify and why? Why there are two of them?

Best Regards!

SebaS

0 Kudos

559 Views
JuroV
NXP Employee
NXP Employee

Hello,

this is principal knowledge how MQX build is done. After the BSP/ PSP/ any_other_MQX_component is built as a library, the result (.a file) is copied into /lib folder. Together with that, all exported header files are copied into /lib. You can consider these files as generated, (though 1:1 copy of the original files). It is recommended to modify original files in mqx directory.

After the MQX is compiled, you can start write your own application and it will be using files only from /lib directory. If any change is needed, modify the file in the mqx directory, rebuild MQX and continue developing your own app.

559 Views
sebasira
Senior Contributor I

Thanks!

Just for testing I've change BSP_DEFAULT_IO_CHANNEL to be iodebug... I recompile the BSP, and verify that as you said the files in /lib where a copy of the source and the change is as I want it to be... I downloaded the code to the TWRK60 kit but I don't know where I would espect it to appear.

Now I can't see HELLO WORLD on the Terminal I/O... (I'm using IAR v6.3) If I configure the terminal I/O to show target resets I can see them, but when I run, there's no "Hello World". What went wrong?

0 Kudos

559 Views
c0170
Senior Contributor III

Hello sebasira,

please open the document MQX IAR Getting Started located in /doc/tools/iar. There's explanation what to change in project settings :smileywink:  Does it help to see the hello world?

Regards,

MartinK

0 Kudos

559 Views
sebasira
Senior Contributor I

Maritn,

I've been looking at the document you mentioned. My project was (by default) configured as in the imagen of the last page of the MQX IAR Getting Started, under "Using the MQX DebugIO Driver with EWARM IDE".

I've change BSP_DEFAULT_IO_CHANNEL to be "iodebug:" in the source folder, but still can`t see anything on the TerminalIO.

Any clue?

Thanks in advance!

SebaS

0 Kudos