Lim CB

Enabling UART1 on Coordinator on JN-AN-1217-Zigbee-3-0-Base-Device for JN5168

Discussion created by Lim CB on Nov 14, 2016

Since ZB3.0 stack no longer able to use u32AHI_Init() due to RTOS, here is a way to enable UART1. 

 

   1.   First, to build application on JN5168 module:

Menu Bar > Project > Properties > (Left) C/C++ Build > (Center Top) Configuration : [Coordinator] > (Middle) Build Command

make JENNIC_CHIP_FAMILY=JN516x JENNIC_CHIP=JN5168 DR=DR1199 GROUPS=0 ICODES=0 APP_NTAG=0

Click Apply. 

 

   2.   Edit irq_JN516x.S:

PIC_ChannelPriorities:
.byte 0 # pwm1 priority
.byte 0 # pwm2 priority
.byte 15 # system controller priority
.byte 7 # MAC priority
.byte 0 # AES priority
.byte 0 # PHY priority
.byte 5 # uart0 priority
.byte 5 # uart1 priority
.byte 0 # timer0 priority
.byte 0 # spi slave priority
.byte 0 # i2c maste/slave priority
.byte 0 # spi master priority
.byte 0 # pwm4 priority
.byte 0 # analog peripherals priority
.byte 0 # pwm3 priority
.byte 12 # tick timer priority

 

   3.   Edit Makefile:

CFLAGS += -DUART=1

 

   4.   Edit uart.c

Line 162: PUBLIC void UART_vInit(void)

#if (UART == E_AHI_UART_0)
   vAHI_UartSetRTSCTS(UART, TRUE);
#endif

Line 281:

PUBLIC void UART_vRtsStopFlow(void)
{
#if (UART == E_AHI_UART_0)
   vAHI_UartSetControl(UART, FALSE, FALSE, E_AHI_UART_WORD_LEN_8, TRUE, E_AHI_UART_RTS_HIGH);
#endif

}

Line 295:

PUBLIC void UART_vRtsStartFlow(void)
{
#if (UART == E_AHI_UART_0)
   vAHI_UartSetControl(UART, FALSE, FALSE, E_AHI_UART_WORD_LEN_8, TRUE, E_AHI_UART_RTS_LOW);
#endif
}

   

   5.   Build Coordinator (for DR1199)

 

   6.   Wire up DIO 14/15 (CN1 Digital 4, 5 on DR1174) to USB-TTL and send commands as per:

            C:\NXP\bstudio_nxp\workspace\JN-AN-1217-Zigbee-3-0-Base-Device\Doc\JN-AN-1217-Zigbee-3-0-Base-Device.pdf

            > pg7. 4.2.8 Summary of Serial Interface Commands

 

UART0 should now output DBG messages (for JTAG), and UART1 can be used to send commands. 

Outcomes