0

RTT & RTT disable sdk 12/13 nRF52832/nRF52840

BLE 999 gravatar image

asked 2017-07-17 10:59:28 +0100

Dear all,

Help please, I'm evaluating ble_app_uart (Central/Peripheral) but I don't understand how to disable the echo I have on the RTT USB VCP

When I send data from the UART, I got (PCA10056/10040) the data in both on the RTT USB VCP and on the UART I would like to control separately the UART and the USB VCP.

I would like to be able to use NRF_LOG in parallel, let's say NRF_LOG_RAW_INFO()/NRF_LOG_GETCHAR() for the RTT USB VCP only and printf() for UART.

example: if I do: printf("Hello world"), I got "Hello world" on both the USB/VCP (Segger) and on the PuTTY (from the UART) on the Host

Is there any #define to set (perhaps in sdk_config.h)? Probably a combination of : NRF_LOG_ENABLED,NRF_LOG_BACKEND_SERIAL_USES_UART,NRF_LOG_BACKEND_SERIAL_USES_RTT

1) with the following I got the echo on the RTT(USB/VCP) NRF_LOG_ENABLED=1, NRF_LOG_BACKEND_SERIAL_USES_UART=1, NRF_LOG_BACKEND_SERIAL_USES_RTT=1

2) In the following setting, the printf() outputs the "Hello world" on both the USB/VCP and on the UART PuTTY but the NRL_LOG_RAW_INFO() don't output anything NRF_LOG_ENABLED=1, NRF_LOG_BACKEND_SERIAL_USES_UART=1, NRF_LOG_BACKEND_SERIAL_USES_RTT=0

any idea?

Thanks in advance

edit retag flag offensive close delete report spam

2 answers

Sort by » oldest newest most voted
0
BLE 999 gravatar image

answered 2017-07-27 12:20:08 +0100

Dear Peter,

Sorry about the delay to reply you, holidays. So I still have the problem, I tested with your suggestions: NRF_LOG_BACKEND_SERIAL_USES_RTT = 1 NRF_LOG_BACKEND_SERIAL_USES_UART=0 The TTY host software on an USB only

// using ble_app_uart_c for example main() { timer_init(); uart_init(): .... printf("\r\nHello world - printf()");
NRF_LOG_INFO("\r\nHello world - log()"); .... }

I got the following (only) on the TTY: Hello world - printf()

I expected to don't have the **...printf()..." on the RTT. Perhaps a retarget() default initialization?

Any idea?

Comment: I got the same output with: NRF_LOG_BACKEND_SERIAL_USES_RTT = 0 NRF_LOG_BACKEND_SERIAL_USES_UART=0

Thanks,

edit flag offensive delete publish link more
0
Petter gravatar image

answered 2017-07-17 14:42:55 +0100

NRF_LOG_ENABLED=1, NRF_LOG_BACKEND_SERIAL_USES_UART=0, NRF_LOG_BACKEND_SERIAL_USES_RTT=1 ?

edit flag offensive delete publish link more

Comments

Yes, I tried your setting and I got the following:

NRF_LOG_INFO("Hello word NRF LOG") => nothing on the both two PuTTY (USB/VCP & UART)

printf("Hello word printf") => I got the "Hello word printf" on both the two PuTTY (USB/VCP & UART)

I excepted to have: "Hello word NRF LOG" on PuTTY USB/VCP "Hello word printf" on PuTTY UART

Thanks for you fast reply Petter

John

ble999 ( 2017-07-17 15:12:20 +0100 )editconvert to answer

Strange. Seems to be working fine here. Have you made any other changes to the project?

Petter Myhre ( 2017-07-17 15:24:35 +0100 )editconvert to answer

Peter, I re-do the test using SDK 13.0.7ca7556 with the ble_peripheral\pca10056_s140

the only modification I did was: NRF_LOG_BACKEND_SERIAL_USES_RTT=0 and adding in the main(): printf("Hello word -printf"); NRF_LOG_RAW_INFO("Hello word -NRF_LOG");

Results: PuTTY USB/RS232: Hello word - printf PuTTY UART: Hello word - printf

(the Hello word -NRF_LOG didn't output)

I expected to have only the ouput on PuTTY UART and nothing on the PuTTY USB/VCP

Sorry about my previous text mistake

ble999 ( 2017-07-17 16:02:52 +0100 )editconvert to answer

Why would you set NRF_LOG_BACKEND_SERIAL_USES_RTT = 0? It should be 1. And NRF_LOG_BACKEND_SERIAL_USES_UART=0. Actually the ble_app_uart example should work like that out of the box. NRF_LOG_INFO() should appear on RTT and printf should appear on UART.

Petter Myhre ( 2017-07-18 14:06:49 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower

Stats

Asked: 2017-07-17 10:59:28 +0100

Seen: 154 times

Last updated: juli 27