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.
Hi Mario,
I have resolved this issue. Thanks for your help.
I forgot to include below line in Makefile.
CFLAGS += -DUART=1
Hi,
I have performed above steps and configured UART0 as debug UART. But, I am facing issue with these configurations.
Now, UART1 is used for sending serial commands and UART0 is used for debug logs. I am able to issue command from UART1 but not getting response on UART0.
Can you please help me to resolve this issue? or let me know if I am wrong in performing some steps.
Hi Jainil,
Did you enable the priority in the irq_JN516x.S?
Regards,
Mario
Hi Mario,
Yes, I have enable priority for UART1 in irq_JN516x.S file. Please find below snap for your reference.