⚠️ 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.
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.
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?
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.
Hi Haitao,
You should use arch_printf() function, please follow the steps below:
Thanks, PM_Dialog
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?
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
Thanks, it works after assigning the pin.