Hi,all
I found the root cause and sovled this problem.
Firstly, the official lib API vAHI_UartSetBaudRate with 115200 CAN NOT work well.
Because the UART clock is routed from 16MHz peripheral clock.
As it is said in JN-UG-3087, 115200 is just a approximant.
After my research, if you want to use 115200 you should use the code below:
/* SetBaudRate to 115200 */
vAHI_UartSetBaudDivisor(UART, 23);
vAHI_UartSetClocksPerBit(UART, 5);
instead of vAHI_UartSetBaudRate(UART, E_AHI_UART_RATE_115200)!!!
It seems that vAHI_UartSetBaudRate set BaudDivisor to 9! I think 23 is better and it is with my actual code.
In the same way, if you want to use 9600bps, please use:
/* SetBaudRate to 9600 */
vAHI_UartSetBaudDivisor(GSENSOR_UART, 119);
vAHI_UartSetClocksPerBit(GSENSOR_UART, 13);
Secondly, JN5169 can not undertake the huge data flood, so be careful if the other node outputs lots of data.
In my project, I decreased the datarate of the other device.
Thirdly, by the way, the UART1 TX pin is used in JN-AN-1189-ZigBee-HA-Demo\Common_Light\Source\DriverBulb\DriverBulb_DR1175.c.
in PUBLIC void DriverBulb_vInit(void):
PUBLIC void DriverBulb_vInit(void)
{
static bool_t bFirstCalled = TRUE;
if (bFirstCalled)
{
bRGB_LED_Enable();
bRGB_LED_Off();
bWhite_LED_Enable();
bWhite_LED_Off();
#if defined RGB || defined CCT
bRGB_LED_SetLevel(255,255,255);
bRGB_LED_SetGroupLevel( 255);
#else
bWhite_LED_SetLevel(255);
#endif
bFirstCalled = FALSE;
}
}
So UART1 TX can not work properly. I think these two lines should be controlled by the MACRO RGB:
#ifdef RGB
#info delete for UART1 TX
bRGB_LED_Enable();
bRGB_LED_Off();
#endif
if the UART1 TX is used in the mono light project.
That's all.
Tks!
This issue can be closed.