Dear NXP Support Team,
I am currently working with the JN5189DK6 development kit and attempting to flash and debug an OpenThread RCP image ( ot-rcp.elf) built from the OpenThread stack. I am encountering an issue where the debugger is unable to resolve symbols, specifically showing:
Configuration Details:
Built the OpenThread RCP firmware for the JN5189 target with debug symbols enabled.
Loaded the ot-rcp.elf into the debugger for symbol reference.
Started a debug session, but encountered the message:
Board configuration images
Debugging file (ot-rcp.elf)
Project configuration screenshots
已解决! 转到解答。
Hello.
The issue you are seeing is due to the fact that the build is done using "MinSizeRel" option which strips the debug symbols.
To fix this, you need to change the following line: https://github.com/NXP/ot-nxp/blob/release/v1.4.0/script/build_jn5189#L40
from "MinSizeRel" to "RelWithDebInfo", rebuild the image and flash. Can you please try this change and provide your feedback?
Have a good day!
Mihai
Hello.
The issue you are seeing is due to the fact that the build is done using "MinSizeRel" option which strips the debug symbols.
To fix this, you need to change the following line: https://github.com/NXP/ot-nxp/blob/release/v1.4.0/script/build_jn5189#L40
from "MinSizeRel" to "RelWithDebInfo", rebuild the image and flash. Can you please try this change and provide your feedback?
Have a good day!
Mihai
Hello.
Logging for any ot-nxp app on JN5189 can be enabled by modifying some of the defines from the build. From my memory, as I worked on this some time ago, you need to modify:
- OPENTHREAD_CONFIG_LOG_OUTPUT to OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED in src/k32w0/jn5189/openthread-core-jn5189-config.h
- OPENTHREAD_CONFIG_LOG_LEVEL to OT_LOG_LEVEL_DEBG in the same file
- UART_USE_SWO_LOG to 1 in src/k32w0/jn5189/jn5189-sdk-config.h
- UART_USE_DRIVER_LOG and UART_USE_SERIAL_MGR_LOG to 0 in the same file as above
This should enable logging on the SWO interface, which by default routes to pin 14 on P10 header and it also routes to the external LPC-Link2 SWO_TRGT. With that set, you should be able to see the logs by either probing the pin 14 with an external FTDI to USB adapter (connect pin to the RX pin of the FTDI adapter) or in MCUXpresso ITM viewer. An app note on that is available here: https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/mcuxpresso%40tkb/41/1/How%20To%20Use%20S...
I need to retest this on my side to confirm, and I will try to do this in the following days, but for now, you should have some information to get started on your side.
BR,
Mihai
Hello, Vikash.
You are seeing RCP timeouts on the host side, meaning the MPU/MCU host running ot-daemon, which is normal, because while you are debugging the JN5189 RCP application, you are stopping the code execution on the chip and implicitly, the UART communication to the host.
Using the FTDI USB doesn't stop the processor and communication, so it is normal to not see such events.
BR,
Mihai
Hello, Vikash.
What I can suggest is to have a look at K32W0 configuration for flow control. More specifically, in script/build_k32w061, there is a build option:
OT_OPTIONS_RCP_ONLY_UART_FLOW_CONTROL=(
"-DOT_RCP_FLOW_CONTROL=ON"
"-DOT_APP_CLI=OFF"
"-DOT_FTD=OFF"
"-DOT_MTD=OFF"
"-DUART_BAUD_RATE=1000000"
)
This sets to ON the OT_RCP_FLOW_CONTROL option, which enables the SDK option
gUartHwFlowControl_d
Looking into the SDK in boards/<chip>/wireless_examples/openthread/reed/bm/board.c, you can see that this enables RTS and CTS pin usage for flow control on UART0, by default on PIO6 for RTS and PIO7 for CTS. You can adjust the pins to other USART0 used pins by referencing Table 3 in JN5189 User Manual .
This should improve the stability of the UART communication.
K32W0x1 is pin compatible with JN5189, it's actually the JN5189 variant with BLE, so you can take as reference the K32W0 SDK.
BR,
Mihai
Hello, Vikash.
The debug logs are printed on the USART1 instance. You can check the JN5189 User Manual , table 3 about what other pins can be used for USART1. JN5189 has two USART instance, with USART0 for the OpenThread CLI/Spinel communication.
On a quick search, we have:
USART0_TXD: PIO3, PIO8, PIO18.
UASRT0_RXD: PIO2, PIO9, PIO19.
USART1_TXD: PIO0, PIO6, PIO10, PIO20.
UASRT1_RXD: PIO1, PIO7, PIO11, PIO19.
BR,
Mihai
Hello, Vikash.
Regarding 1), the difference between routing the UART between LPC-Link2 port and the FTDI port is that on the FTDI port, the UART is routed to the FT230XS FTDI chip on the DK6 board, which translates the signals to USB on a more "hardware" logic, implying that it's done faster. On the LPC-Link2 port, the signals are passed through the LPC4322 chip, which acts also as a debugger probe and I suspect that it implies a more "software" approach, with more processing leading to some delays.
We haven't seen any issues using that port on our scenarios, but we do suggest using the FTDI port for real life scenarios, due to the limitations which I pointed out. One thing I can suggest to you is to switch the firmware running on the LPC Link2 chip. You can do this by putting the LPC in DFU mode (switch JP5 from NORMAL to DFU) and use the LPCScrypt software to do the change. A user guide is available in the link. You have the option to use the CMSIS or the JLink firmwares.
Regarding 2), I suggest using UART_USE_SERIAL_MGR instead of UART_USE_DRIVER. The changes I suggested in the post earlier should also be done:
- OPENTHREAD_CONFIG_LOG_OUTPUT to OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED in src/k32w0/jn5189/openthread-core-jn5189-config.h
- OPENTHREAD_CONFIG_LOG_LEVEL to OT_LOG_LEVEL_DEBG in the same file
Regarding 3), yes, I remember capturing SWO debug lines in TeraTerm so it should work.
Regarding 4), the change in linker file, RAM0: 0x4000400 was done to accommodate RAM needs from running the ROM code at boot (scratch RAM) and you can also change the settings in MCUXpresso to match, but I don't think it has any impact if you keep the old settings, as we are not loading any applications in RAM when writing the board.
JN5189 is a legacy part and some things are out of date and won't be updated in next releases. Furthermore, JN5189 and K32W0x1 are to be removed from ot-nxp repository in next releases and enter a maintenance phase on the last released version.
If you desire to develop a solution with NXP OpenThread Wireless silicon that will benefit from ongoing support regarding stack and SDK maintenance, I can suggest you to have a look at the MCXW7x family.
BR,
Mihai
Hello, Vikash.
After consulting with R&D, I think I can offer a better solution.
As I said, JN5189 and K32W0x1 are compatible chips from the same family, the K32W0x1 being the upper trim of JN, with BLE added. In the K32W0x1 ot-nxp examples, there is a rcp_only_uart_dma configuration that is recommended to be used in your actual use case, RCP without frame control. You can check it out in script/build_k32w061.
OT_OPTIONS_RCP_ONLY_UART_DMA=(
"-DOT_RCP_UART_DMA=ON"
"-DOT_APP_CLI=OFF"
"-DOT_FTD=OFF"
"-DOT_MTD=OFF"
"-DOT_1_2_SUPPORT=ON"
"-DUART_BAUD_RATE=1000000"
)
readonly OT_OPTIONS_RCP_ONLY_UART_DMA
This example uses a special DMA library which improves the UART and radio modules handling.
You can build the K32W0 example and use it on JN5189 for your testing.
BR,
Mihai