Hello!
I'm using the frdm k64f and i'm testing the bootloader with examples. I'm using the freedom_bootloader example from bootloader_examples (SDK 2.5.0) and the KinetisFlashTool for updating programs.
For me both examples - led_demo_freedom_0000 (without bootloader) and led_demo_freedom_a000 (with BL) works!
Now I try to use another UART for updating my program, e.g UART2 (RX - PTD2 TX - PTD3).
I found this note inside ""pinmux_utility_common.c":
//! this is to store the function pointer for calling back to the function that wants
//! the UART RX instance pin that triggered the interrupt. This only supports 1 pin
//! for UART0 because UART1 is on PORTC which does not support interrupts 
Soo, is it possible to run my bootloader by using UART2 on PTD2/3?
Where can I check which uart is usable?
I found sth like this for MKV31F51212:
Hi,
Sorry for reply you so late.
I tested UART2, it can work. There are some key point you should pay attention to.
1. In peripherals_pinmux.c,
#define BL_ENABLE_PINMUX_UART2 (BL_CONFIG_SCUART)
#define UART2_RX_PORT_BASE PORTE
#define UART2_RX_GPIO_BASE PTE
#define UART2_RX_GPIO_PIN_NUM 17
#define UART2_RX_FUNC_ALT_MODE kPORT_MuxAlt3
#define UART2_RX_GPIO_ALT_MODE kPORT_MuxAsGpio
#define UART2_RX_GPIO_IRQn PORTE_IRQn
#define UART2_RX_GPIO_IRQHandler PORTE_IRQHandler
#define UART2_TX_PORT_BASE PORTE
#define UART2_TX_GPIO_PIN_NUM 16
#define UART2_TX_FUNC_ALT_MODE kPORT_MuxAlt3
2. In peripherals_KV31F512.c
#if BL_CONFIG_SCUART
{.typeMask = kPeripheralType_UART,
.instance = 2,
.pinmuxConfig = uart_pinmux_config,
.controlInterface = &g_scuartControlInterface,
.byteInterface = &g_scuartByteInterface,
.packetInterface = &g_framingPacketInterface },
#endif
3. DSPI pin is conflict with UART2, please take care.
4. In the function get_uart_clock(), you should add
case 2:
return get_bus_clock();
Regards,
Jing
Quotation from: https://community.nxp.com/thread/474392
I did all what Jing suggested and I still cant connect with KinetisFlashTool.
jingpan maybe u have any other suggestions?
Regards!