‘Hello World’ MQX example print problem K60

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

‘Hello World’ MQX example print problem K60

Jump to solution
1,822 Views
Kratz
Contributor IV

I have the debugger running for the hello world example. I have seen others have struggled too.

I am using the TWR-K60D100M. The program runs with the debugger. I have Tera Term up. Tera Term has found and connected to the tower by serial USB.

The only thing is there is no "hello world" message displaying. Displaying through the terminal should be helpful for us to debug with.  What am I missing?

Labels (1)
0 Kudos
1 Solution
840 Views
LuisCasado
NXP Employee
NXP Employee

Kevin,

I have done the modification using CW10.4 and MQX 4.0.1, those are the latest versions.

No issues rebuilding with the modifications suggested. I am attaching the modified user_config.h

Inport the working set in C:\Freescale\Freescale_MQX_4_0\config\twrk60d100m\cw10

(remember to install the MQX pluging using Install New Software in CW 10.4 menu after CW 10.4 and MQX 4.0.1 isntallations)

Then, change the user config in C:\Freescale\Freescale_MQX_4_0\config\twrk60d100m\

And you should build without any problem

Luis

View solution in original post

0 Kudos
11 Replies
840 Views
LuisCasado
NXP Employee
NXP Employee

Hello Kevin,

Default UART is the one connected to OSJTAG USB connector, to use TWR-SER, change the user_config.h

Change this line:

#define BSPCFG_ENABLE_TTYD       1

And add:

#define BSP_DEFAULT_IO_CHANNEL "ttyd:"

And rebuild the libraries.

Luis

0 Kudos
840 Views
Kratz
Contributor IV

There are compiler errors that I could use help with. Here is the user_config.h file changes

#define  BSPCFG_ENABLE_TTYD       1

#define  BSP_DEFAULT_IO_CHANNEL "ttyd:" /* added to bring out serial board*/

#define  BSPCFG_ENABLE_ITTYD      1   //Note this was 0, but resulted at an error at this line so I changed it to 1.

Here are the tagged section with the errors:

#ifndef
BSP_DEFAULT_IO_CHANNEL_DEFINED

** This is the error line **

#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. Please set corresponding
BSPCFG_ENABLE_TTYx to non-zero in user_config.h and recompile BSP with this
option.

  #endif

The message says: 1) Preprossor error directive 2) mingw32-make **** 3) Preprocessor #error directive

Does the "hello world" message have to come out of the Ser board because the TWR board has its USB tied up with the debugger?

0 Kudos
840 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Do the one I suggested:

#define  BSPCFG_ENABLE_TTYD       1

#define  BSPCFG_ENABLE_ITTYD      0

Yo cannot define non interrupt and interrupt UART support simultaneously.

And then, after all the peripherals definition:

#define  BSP_DEFAULT_IO_CHANNEL "ttyd:"

Luis

840 Views
Kratz
Contributor IV

Luis, Please help me through the compile errors that came up.

Code  at lines 48 & 49:

48 #define BSPCFG_ENABLE_TTYD       1

49 #define BSPCFG_ENABLE_ITTYD      0 

 

After all of the defines, on line 100 this line was added.

101 #define BSP_DEFAULT_IO_CHANNEL "ttyd:"

built BSP with no errors.  then built Hello and received this error:

#error This application requires
BSP_DEFAULT_IO_CHANNEL to be not NULL. Please set corresponding
BSPCFG_ENABLE_TTYx to non-zero in user_config.h and recompile BSP with this
option.

#endif



0 Kudos
840 Views
LuisCasado
NXP Employee
NXP Employee

Hi,

CW Freescale ARM compiler?


Luis

0 Kudos
840 Views
Kratz
Contributor IV

Yes, 10.3.1 FSL

0 Kudos
841 Views
LuisCasado
NXP Employee
NXP Employee

Kevin,

I have done the modification using CW10.4 and MQX 4.0.1, those are the latest versions.

No issues rebuilding with the modifications suggested. I am attaching the modified user_config.h

Inport the working set in C:\Freescale\Freescale_MQX_4_0\config\twrk60d100m\cw10

(remember to install the MQX pluging using Install New Software in CW 10.4 menu after CW 10.4 and MQX 4.0.1 isntallations)

Then, change the user config in C:\Freescale\Freescale_MQX_4_0\config\twrk60d100m\

And you should build without any problem

Luis

0 Kudos
840 Views
LuisCasado
NXP Employee
NXP Employee

Hello,

Regarding your question. The BSP default UART is the one connected to OSJTAG on TWR-K60. You can get the output also in that UART. When you connect the TWR-K60 to USB, you will get two profiles, OSJTAG and CDC terminal. If, not, ploease, upgrade OSJTAG firmware with Pemicro Firmware Update App:

http://www.pemicro.com/osbdm/index.cfm

Luis


0 Kudos
840 Views
lmg
Contributor III

I'm having similar problems with Kevin.

CW10.4, MQX 4.0.1, TWRK60D100M.

I have been able to write, download, and debug some simple programs - both canned examples and my own programs.

But I cannot see anything from printf() statements in the code.

I have successfully updated the P&E software to osbdmens_arm.3121. When I plug the USB port in and look at my Win8 control panel, I see only the OSBDM - Debug Port; no CDC terminal as you say.

Capture.PNG

So it's not surprising that when I open P&E's Terminal Window application (v2.05) and attempt to "Open Serial Port" on USB COM, I get an error message: "Failed to Open, Plug DEMO board into PC via USB cable." (My Tower board is plugged in to a USB port of course.)

Capture.PNG

I have tried all Baud rates.

Here is what config.h looks like:

Capture.PNG

What am I doing wrong?

~LMG

0 Kudos
840 Views
lmg
Contributor III

I think I've found a solution.

1. Download and install Tera Term virtual terminal.

       teraterm-4.78.exe from Download - Tera Term - SourceForge.JP

2. Start Tera Term. Cancel any windows that pop open upon start up.

3. Plug in TWR board USB connection. I'm using the one on the board itself, not the SER board.

4. In Tera Term, click File->New Connection.

Capture.PNG

5. Select the serial port that is the OSBDM connection. (I assume the com number may be different on different machines.)

Capture.PNG

6. Under Setup->Serial Port, make sure the settings are correct. I'm using the TWRK60D100M.

7. And it works! Results from printf() show on the Tera Term screen.

8. You can also go to Setup->Save Setup to make your selected serial port and baud rate the default. TERATERM.INI appears to be the default file that is loaded each time the program starts. If you do this, the connection is made automatically when you start Tera Term the next time - assuming the USB cable to the TWR board is plugged in. If the USB cable is not plugged in when you start Tera Term, you get an error message. You then have to click File->New Connection after starting Tera Term.

~LMG

0 Kudos
840 Views
lmg
Contributor III

And another solution:

Now I know that the TWR board is talking to my PC on COM5, I tried P&E's virtual terminal.

Capture.PNG

And it works!

So I guess my problem was that I did not know where on my PC the serial port was going to show up. Tera Term helped because it showed me that COM5 was active.

Hope this helps.

~LMG

0 Kudos