TWR-K64F120M + MQX + IAR (Output on Mini USB)

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

TWR-K64F120M + MQX + IAR (Output on Mini USB)

Jump to solution
806 Views
fabricetocci
Contributor III

Hi,

I have a Kinetis TWR-K64F120M , my application runs on MQX MQX RTOS and I use IAR embedded workbench IDE v 7.20.

I would like to use a USB as default IO channel.

Looking to TWR-K64 schematic I thought that mini USB was assigned to UART1 ttyb.

I added following define in user_config.h

#define BSP_DEFAULT_IO_CHANNEL "ttyb:"

#define BSP_DEFAULT_IO_CHANNEL_DEFINED

and I enabled

#define BSPCFG_ENABLE_TTYB  1

#define BSPCFG_ENABLE_ITTYB 1

When I run TWR-K64F120M\mqx\examples\hello2 from iar IDE, nothing is shown on the PuTTy console opened on the USB COM port assigned to OPEN SDA.

What is the mistake with my setting?

Is it possible to use OPENSDA Mini USB port to as default IO Channel?

Best regards.

Fabrice.

0 Kudos
1 Solution
441 Views
fabricetocci
Contributor III

Dear Dawei,

Finaly I have resolved the issue.

It was a jumper setting problem.

J39 should be open and J14 should be open also.

Thank you for your help.

I'll close this ticket.

Best regards.

Fabrice

View solution in original post

0 Kudos
5 Replies
441 Views
daweiyou
NXP Employee
NXP Employee

Hi Fabrice:

I think default user_config.h needn’t modify.

The TTYB setting is like below,

#define BSPCFG_ENABLE_TTYB 1

#define BSPCFG_ENABLE_ITTYB 0

Below setting is defined in twrk70f120m.h

#define BSP_DEFAULT_IO_CHANNEL "ttyb:"

#define BSP_DEFAULT_IO_CHANNEL_DEFINED

Dawei You(尤大为)

0 Kudos
441 Views
fabricetocci
Contributor III

I Dawei,

Thank you for your reply.

The TTY configuration is correct now, but I'm still unable to see messages on Mini USB.

I think that Jumper setting is not correct.

I'm using IAR + Ijet probe to debug on JTAG.

J14 is closed and I had to remove J39 to avoid an error message on IAR debugger (processor not powered).

What is the correct jumper settting to use J2 Mini USB (ttyb UART1) and JTAG interfaces?

Best regards.

Fabrice Tocci

0 Kudos
442 Views
fabricetocci
Contributor III

Dear Dawei,

Finaly I have resolved the issue.

It was a jumper setting problem.

J39 should be open and J14 should be open also.

Thank you for your help.

I'll close this ticket.

Best regards.

Fabrice

0 Kudos
441 Views
daweiyou
NXP Employee
NXP Employee

Of course, you also could route the stream to IAR debug window.

You could define as below

#define BSPCFG_ENABLE_IODEBUG 1

#define BSP_DEFAULT_IO_CHANNEL "iodebug:"

#define BSP_DEFAULT_IO_CHANNEL_DEFINED

Dawei You(尤大为)

0 Kudos
441 Views
soledad
NXP Employee
NXP Employee

Hi Fabrice,

The Default Console for the TWR-K64 is the ttyb: OpenSDA (USB mini connector).

You don’t need to modify the user_config.h.

In addition, the standard UART driver supports both polled and interrupt-driven modes. If enabled in user configuration, the serial devices are installed as “ttya:”, “ttyb:” and “ttyc:” (polled mode) and “ittya:”, “ittyb:” and “ittyc:” (interrupt mode) automatically during BSP startup.

In order to change the default port you need to follow the steps:

  1. Open the <board>.h file located on following path: <Freescale_MQX_4_X_install_path>\mqx\source\bsp\<board-name>

   2. You need to enable the UART port that you need,

TTYA-> UART0,

TTYB -> UART2,     

TTYC-> UART4,      

TTYD -> UART5  

TTYE-> UART6.

   3. For do that, find the lines according the port that you need, and set it. For example

#ifndef BSPCFG_ENABLE_TTY(**change the letter according the port that you need**)

    #define BSPCFG_ENABLE_TTY(**change the letter according the port that you need**)              1

#endif

    4. Chane the lines

#ifndef BSP_DEFAULT_IO_CHANNEL

    #if BSPCFG_ENABLE_TTYF

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

With

#ifndef BSP_DEFAULT_IO_CHANNEL

    #if BSPCFG_ENABLE_TTY(**change the letter according the port that you need**)

        #define BSP_DEFAULT_IO_CHANNEL                    "tty(**change the letter according the port that you need**):"    /* OSJTAG-COM   polled mode */

    5. It is necessary to rebuild the BSP and PSP libraries.

I hope this helps :smileywink:


Have a great day,
Sol

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

0 Kudos