Hello,
I would like to add UART to the ss_twr_resp example downloaded from GitHub.
In the ss_twr_init example printf sends data over the serial terminal. I would like to do the same in the responder example but I cannot get it to work. If I add printf to the program I get the following error:
> Building ‘ss_twr_resp’ from solution ‘ss_twr_resp’ in configuration ‘nrf52832_xxaa’
> Linking ss_twr_resp.elf
> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi.a(libc2.o): in function printf': libc2.c:(.text.libc.printf+0x3c): undefined reference to
__putchar’
> Build failed
I’ve tried the following based on differences between ‘ss_twr_init’ and ‘ss_twr_resp’:
1- Adding “app_uart_fifo.c” and “retarget.c” (that originally only appeared on ‘ss_twr_init’) into nRF_Libraries in ‘ss_twr_resp’.
2- Adding “UART.c” into the ‘ss_twr_resp’ directly.
Also adding in the main.c program (in ss_twr_resp) to initialize UART and use the printf command:
boUART_Init ();
printf(“Singled Sided Two Way Ranging ResponderExample \r\n”);
Results:
After doing all of this and compiled, the same error appeared:
> Building ‘ss_twr_resp’ from solution ‘ss_twr_resp’ in configuration ‘nrf52832_xxaa’
> Linking ss_twr_resp.elf
> C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 5.10/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi.a(libc2.o): in function printf': libc2.c:(.text.libc.printf+0x3c): undefined reference to
__putchar’
> Build failed
Further observations:
The only thing I’ve found that could give me a clue about what’s missing is that in ‘ss_twr_resp’, the “retarget.c” library hasn’t any number on the right hand side. In the ‘ss_twr_init’ example, in which the printf works, the “retarget.c” has a number when compiled.
Also in the “retarget.c” dependencies folder in ‘ss_twr_init’, there’s the following ‘.h’ that are missing on it’s ‘ss_twr_resp’ counterpart:
‘app_error.h’
‘app_error_weak.h’
‘app_uart.h’
‘app_utl_platform.h’
‘nrf_assert.h’
Is it because the previous problem?
Any suggestions how to do this?
Thanks in advance
Regards,