Printf redirection in MQX

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

Printf redirection in MQX

1,136 Views
hariharasuthanc
Contributor I

Hi,

I am using TWR-K65F180M with MQX in IAR workbench. The MQX takes over the IO and redirects it to Serial port. I would like to display it in the IDE using JTAG. How do I disable this default MQX redirection ?

or Remove the MQX terminal i/o code to use the standard IO ?

thanks

0 Kudos
3 Replies

707 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi ,

If you are using MQX 4.x you can fin in twrk65f180m.h the definitions shown in code below. You may change the default io channel to iodebug and rebuild MQX libraries. This file is located in the following path:

C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\twrk65f180m

/*

* Other Serial console options:(do not forget to enable BSPCFG_ENABLE_TTY define if changed)

*      "ttyc:"      OSJTAG-COM, TWR_SER  polled mode

*      "ittyc:"    TWR-SER    interrupt mode

*    "iodebug:" IDE debug console

** MGCT: <option type="string" maxsize="256" quoted="false" allowempty="false"/>

*/

#ifndef BSP_DEFAULT_IO_CHANNEL

    #if BSPCFG_ENABLE_TTYC

      #define BSP_DEFAULT_IO_CHANNEL                        "ttyc:"   /* OpenSDA-COM  polled mode  */

        #define BSP_DEFAULT_IO_CHANNEL_DEFINED

    #else

        #define BSP_DEFAULT_IO_CHANNEL                        NULL

    #endif

#else

    /* undef is for backward compatibility with user_configh.h files which have already had it defined */

    #undef  BSP_DEFAULT_IO_CHANNEL_DEFINED

    #define BSP_DEFAULT_IO_CHANNEL_DEFINED

#endif


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

707 Views
hariharasuthanc
Contributor I

Hi Calos,

         Thanks for the reply.  I am using the MQX which comes with KSDK_1.3.0.  that is  MQX RTOS version 3.0.

I tried what you suggested in the message, it is raising an exception in Init_Bsp.c  on the line _bsp_nio_stdio_install();

#if BSPCFG_ENABLE_IO_SUBSYSTEM

     _bsp_nio_stdio_install();

#else /* BSPCFG_ENABLE_IO_SUBSYSTEM */

#if  !defined(PEX_MQX_KSDK)

     dbg_uart_init();

#endif

#endif /* BSPCFG_ENABLE_IO_SUBSYSTEM */

by the way I inserted the code in the bsp.h , since I did not see twrk65f180m in the specified folder.

I can see a file "system_MK65F18.c", inside C:\Freescale\KSDK_1.3.0\platform\devices\MK65F18\startup folder.

Thanks,

Hari

0 Kudos

707 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Hari,

this functionality is not implemented in MQX for KSDK and implementing may not be easy.

As you may know classic MQX uses POSIX peripheral drivers, MQX for KSDK does not, it uses the KSDK drivers. You may need to create a NIO (New IO) POSIX wrapper and replicate the original iodebug driver from classic MQX.

Here you can find a guide to create New IO driver from isaacavila

Installing NIO driver in MQX for KSDK

The original iodebug driver code in classic MQX can be found in classic MQX installation.

C:\Freescale\Freescale_MQX_4_2\mqx\source\io\debug

Best regards,

Carlos

0 Kudos