Why is it that when running the sprintf function in the JN-AN-1247 program to save decimals as strings, the decimals can be stored correctly as strings, but when the endpoint restarts and rejoins the network, the control bridge triggers a watchdog warning?
The information printed on the JN-AN-1247 control bridge is as follows
The information printed by the endpoint is as follows
Solved! Go to Solution.
Hi,
You can try configuring the pins corresponding to UART1 instance in pin_mux.c file according to the pin availability and pin multiplexing (for more information on this, please refer to JN5189 User Manual, Chapter 12: I/O Pin Configuration IOCON). If you are using a JN5189 Development Kit, please consult the schematic to check the available pins to avoid any signal/pin configuration overlapping.
Also, you may need to change the UART0 instance in app.h file to use UART1 instead. The same should apply for board.h file and app_uart.c file.
Regards,
Eduardo.
Hello @qianchihuang,
What SDK version are you using? What version of the JN-AN-1247 App Note are you using?
Just to confirm, if you remove that portion of code, does your application work as expected? Is it the only modification that triggers this behavior?
Regards,
Eduardo.
My SDK version is 2.6.5 and JN-AN-1247 App Note version is 2007.
I use the sprintf function to change float type to string type, when removed the endpoint node can join the network at any time. When I comment out the sprintf function it doesn't trigger this behavior.
Hi,
According to the JN-AN-1247 Release Notes (JN-AN-1247 folder > Doc), this App Note has been tested with SDK version 2.6.8.
Besides, some functions such as sprintf() may consume an important amount of memory and time, and this my affect the performance or constraints of the application. Please, consider using an alternative to this function.
Regards,
Eduardo.
Hi,
In the following code, the sprintf function is to save the decimal point as a string and then print it out through the USART1 serial port.
I consider using an alternative to this function.I plan to use the following way to print floating-point numbers, but DBG_vPrintf function uses the USART0 serial port by default to print, now I want to use the USART1 serial port to print the DBG_vPrintf function, so where do I make changes to complete this task?
Hi,
You can try configuring the pins corresponding to UART1 instance in pin_mux.c file according to the pin availability and pin multiplexing (for more information on this, please refer to JN5189 User Manual, Chapter 12: I/O Pin Configuration IOCON). If you are using a JN5189 Development Kit, please consult the schematic to check the available pins to avoid any signal/pin configuration overlapping.
Also, you may need to change the UART0 instance in app.h file to use UART1 instead. The same should apply for board.h file and app_uart.c file.
Regards,
Eduardo.