Hi All,
I am using a custom MK70FN1M0VMJ12 board. I am using MQX-4.1 and keil uvision. I am using twrk70f120m code.
First of all will the code run in my custom board ?
And I wanted to change the pin mux as per the custom board and use the default OSJTAG-COM uart in UART-0.
My UART-0 pins are
PTB16/UART0_RX
PTB17/UART0_TX
So I changed the Init_gpio in the bsp library to
case 0:
pctl = (PORT_MemMapPtr)PORTB_BASE_PTR;
if (flags & IO_PERIPHERAL_PIN_MUX_ENABLE)
{
/* PTF17 as RX function (Alt.4) + drive strength */
pctl->PCR[16] = 0 | PORT_PCR_MUX(4) | PORT_PCR_DSE_MASK;
/* PTF18 as TX function (Alt.4) + drive strength */
pctl->PCR[17] = 0 | PORT_PCR_MUX(4) | PORT_PCR_DSE_MASK;
}
if (flags & IO_PERIPHERAL_PIN_MUX_DISABLE)
{
/* PTF17 default */
pctl->PCR[16] = 0;
/* PTF18 default */
pctl->PCR[17] = 0;
}
if (flags & IO_PERIPHERAL_CLOCK_ENABLE)
{
/* start SGI clock */
sim->SCGC4 |= SIM_SCGC4_UART0_MASK;
}
if (flags & IO_PERIPHERAL_CLOCK_DISABLE)
{
/* stop SGI clock */
sim->SCGC4 &= (~ SIM_SCGC4_UART0_MASK);
}
break;
I wanted to use this as default debug uart port as in OSJTAG-COM
So I changed in twrk70f120m.h
/*
** Interrupt-driven TTY device (UART0)
** MGCT: <option type="bool"/>
*/
#ifndef BSPCFG_ENABLE_ITTYA
#define BSPCFG_ENABLE_ITTYA 1
#endif
#ifndef BSP_DEFAULT_IO_CHANNEL
#if BSPCFG_ENABLE_ITTYA
#define BSP_DEFAULT_IO_CHANNEL "ittya:" /* OSJTAG-COM polled mode */
#define BSP_DEFAULT_IO_CHANNEL_DEFINED
#else
#define BSP_DEFAULT_IO_CHANNEL NULL
#endif
And in user_config.h
#define BSPCFG_ENABLE_ITTYA 1
I rebuilt the library and I flashed the test code.
But No prints are coming in that UART-0.
Is there any other thing to change ?
Please Help.
Regards,
Vibhu.