uart debug issue with dkpro

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
5 posts / 0 new
Last post
Haitao
Offline
Last seen:1 year 8 months ago
Joined:2018-06-29 01:59
uart debug issue with dkpro

Dear support
I try to modify the RCU project with the dkpro, but I don't know how to print debug messages, how can I open uart debug with the dkpro.

Device:
PM_Dialog
Offline
Last seen:3 days 16 hours ago
Staff
Joined:2018-02-08 11:03
Hi Haitao,

Hi Haitao,

You should use arch_printf() function, please follow the steps below:

  • #define CFG_PRINTF in the da1458x_config_basic.h
  • Change the uart ports of the fw and assign the UART_TX port/pin to P04 and UART_RX port/pin to P05 (make sure that the configuration that you have changed is under the HW_CONFIG_PRO_DK and that this the board declared in the HW_CONFIG definition).
  • Invoke the arch_printf() function in order to print for example when the device starts advertising.
  • Include the arch_console.h file.

Thanks, PM_Dialog

Haitao
Offline
Last seen:1 year 8 months ago
Joined:2018-06-29 01:59
Thanks for your advice, I do

Thanks for your advice, I do all the things as you mentioned above , but I still can not get the debug messages.
I test uart debug in the ble_app_peripheral project , I configure HW and SW as shown in the screenshot.
I include arch_console.h in the user_peripheral.c, invoke arch_printf() in the call back user_ app _connection() as below:
void user_app_connection(uint8_t connection_idx, struct gapc_connection_req_ind const *param)
{

arch_printf(" \r\n FSM: connected");
if (app_env[connection_idx].conidx != GAP_INVALID_CONIDX)
{
app_connection_idx = connection_idx;
....
}
this callback can be invoked when ble connection established , but no debug message printed out . Is there anything I missed?

PM_Dialog
Offline
Last seen:3 days 16 hours ago
Staff
Joined:2018-02-08 11:03
Hi Haitao,

Hi Haitao,

Did you assign the UART_TX port/pin to P04 and UART_RX port/pin to P05 into the user_periph_setup.h header file? Please try to find the CFG_PRINTF_UART2 hash define into the user_periph_setup.h and the configuration of the HW_CONFIG_PRO_DK should be like the following code snippet:

#elif HW_CONFIG_PRO_DK

#define UART2_TX_GPIO_PORT GPIO_PORT_0

#define UART2_TX_GPIO_PIN GPIO_PIN_4

#define UART2_RX_GPIO_PORT GPIO_PORT_0

#define UART2_RX_GPIO_PIN GPIO_PIN_5

I tested from my side and I am able to print your message into the user_app_connection() function. If you found any the answers useful please mark it accepted.

Thanks, PM_Dialog

Haitao
Offline
Last seen:1 year 8 months ago
Joined:2018-06-29 01:59
Thanks, it works after

Thanks, it works after assigning the pin.