嗨 i also want to add uart to the project(reporter_fh) to print some message,if you have added uart to that project successfully,please tell me ,What should I do.
what is the difference between uart2.c and uart.c in the driver directory?
Best regards, Vesa
edit: I'm trying to print to serial monitor with DA14580. I defined CFG_PRINTF and included uart2.c in my project file. Then I copied the code above to my project source file but I didn't receive the message in my monitor. Can I have more detailed instructions?
你好, Even I want to print some debug statements in app_init_func in file : fh_proxr_sdk.c in reporter_fh project. I added uart.c and uart.h from peripheral_examples project, but since SPI_DI and UART_RX are sitting on same PORT and same PIN, I disabled BLE_SPOTA_RECEIVER profile in da14580_config.h file. Now the code is getting flashed, but I am unable to see any Debug MSGS.
你好,视频电子设备标准协会, In spite of doing all the above mentioned changes I am still unable to see any debug MSGS on console. I used included a statement arch_printf("Hello"); inside app_init_func
对不起,我不是什么新鲜事getting irritated. Anyone have a working example of SmartTag with functional UART string write out for the basic board. I've been play with VesaN step by step example and tweaking it along with other examples for uart. but i keep running into __asm("BKPT #0\n"); // this pin has not been previously reserved!.. or not working at all. I even starting going to town delete everything related to pin reserve but still stuck.
Hi,
This should help you get started:
I hope it helps you,
嗨
i also want to add uart to the project(reporter_fh) to print some message,if you have added uart to that project successfully,please tell me ,What should I do.
Hi,
what is the difference between uart2.c and uart.c in the driver directory?
Best regards, Vesa
edit: I'm trying to print to serial monitor with DA14580. I defined CFG_PRINTF and included uart2.c in my project file. Then I copied the code above to my project source file but I didn't receive the message in my monitor. Can I have more detailed instructions?
你好,
Even I want to print some debug statements in app_init_func in file : fh_proxr_sdk.c in reporter_fh project.
I added uart.c and uart.h from peripheral_examples project, but since SPI_DI and UART_RX are sitting on same PORT and same PIN, I disabled BLE_SPOTA_RECEIVER profile in da14580_config.h file.
Now the code is getting flashed, but I am unable to see any Debug MSGS.
Thanks
asm
Hi asmaitha,
I recommend you to use app_console with printing rather than make your own uart manipulation operations. This should somewhat work:
#define CFG_PRINTF
inda14580_config.h..\..\..\src\modules\app\src\app_utils\app_console
#include "app_console.h"
arch_printf
to print textIt is important that you defined right UART pins!Do it inperiph_setup.cfile inarch/folder:
Reserve GPIO in
GPIO_reservations
function with following macros:#ifdef CFG_PRINTF_UART2
RESERVE_GPIO( UART2_TX, GPIO_PORT_0, GPIO_PIN_4, PID_UART2_TX);
RESERVE_GPIO( UART2_RX, GPIO_PORT_0, GPIO_PIN_5, PID_UART2_RX);
#endif
and in
set_pad_functions
function#ifdef CFG_PRINTF_UART2
GPIO_ConfigurePin(GPIO_PORT_0, GPIO_PIN_4, OUTPUT, PID_UART2_TX, false);
GPIO\ U配置引脚(GPIO\ U端口\ U 0,GPIO\ U引脚\ U 5,输入,PID\ UART2\ U RX,false);
#endif
Thanks
你好,视频电子设备标准协会,
In spite of doing all the above mentioned changes I am still unable to see any debug MSGS on console.
I used included a statement arch_printf("Hello"); inside app_init_func
Thanks
asm
Hello asmaitha,
Can you give more details of what goes wrong? Does the program compile? What hardware are you using? What is your pin configuration?
Are you sure you have following lines in your da14580_config.h and did you check you don't have
#undef CFG_PRINTF
after that?/*UART Console Print*/
#define CFG_PRINTF
#ifdef CFG_PRINTF
#define CFG_PRINTF_UART2
#endif
Thanks!
你好,视频电子设备标准协会,
In da14580_config.h
#define CFG_PRINTF
#define CFG_PRINTF_UART2
have been defined.
But I still have a bsic doubt :
in periph_setup.c file :
#if (BLE_SPOTA_RECEIVER)
RESERVE_GPIO( SPI_CLK, GPIO_PORT_0, GPIO_PIN_0, PID_SPI_CLK);
RESERVE_GPIO( SPI_DO, GPIO_PORT_0, GPIO_PIN_6, PID_SPI_DO);
RESERVE_GPIO( SPI_DI, GPIO_PORT_0, GPIO_PIN_5, PID_SPI_DI);
RESERVE_GPIO( SPI_EN, GPIO_PORT_0, GPIO_PIN_3, PID_SPI_EN);
#endif
#ifdef CFG_PRINTF_UART2
RESERVE_GPIO( UART2_TX, GPIO_PORT_0, GPIO_PIN_4, PID_UART2_TX);
RESERVE_GPIO( UART2_RX, GPIO_PORT_0, GPIO_PIN_5, PID_UART2_RX);
#endif
So here Between UART2_RX and SPI_DI, there is a clash, which means UART ports initialization doesn't happen at all rite...
Thanks
asm
Hi asmaitha,
实际上,GPIO保留宏根本不重要。他们只是要确保没有冲突。更重要的是你用它做什么
GPIO_ConfigurePin
functions. And you obiviously have a conflict with SPI bus, things won't work then!Hello VesaN,
Thanks a lot.
Thanks
asm
对不起,我不是什么新鲜事getting irritated. Anyone have a working example of SmartTag with functional UART string write out for the basic board. I've been play with VesaN step by step example and tweaking it along with other examples for uart. but i keep running into __asm("BKPT #0\n"); // this pin has not been previously reserved!.. or not working at all. I even starting going to town delete everything related to pin reserve but still stuck.