JN5189

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
724 Views
qianchihuang
Contributor III

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?qianchihuang_0-1696583662834.png

The information printed on the JN-AN-1247 control bridge is as follows

qianchihuang_1-1696584023621.png

The information printed by the endpoint is as follows

qianchihuang_2-1696584087942.png

 

0 Kudos
1 Solution
626 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

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.

View solution in original post

0 Kudos
5 Replies
699 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

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.

0 Kudos
695 Views
qianchihuang
Contributor III

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.

0 Kudos
667 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

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.

650 Views
qianchihuang
Contributor III

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.

qianchihuang_0-1696946886389.png

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?

qianchihuang_1-1696949298162.jpeg

 

0 Kudos
627 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

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.

0 Kudos