Using shell with RTT console on nRF52840 DK


Rodrigo Peixoto
 

Hi,
I am trying to use the shell feature with the RTT console. I can see the SYS_LOG output with the pyrtt-viwer but I cannot write any command.

Any clue on that?

Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex



Michael Rosen
 

Rodrigo

 

Currently, the RTT console driver doesn’t support input (ie, from a host to device). You would have to add this functionality to the RTT console driver (drivers/console/rtt_console.c) and the shell subsystem to interact with it (subsys/shell/shell.c); you can use the uart_console as a reference (drivers/console/uart_console.c).

 

Mike

 

From: users@... [mailto:users@...] On Behalf Of Rodrigo Peixoto
Sent: Wednesday, June 13, 2018 3:34 PM
To: users@...
Subject: [Zephyr-users] Using shell with RTT console on nRF52840 DK

 

Hi,

I am trying to use the shell feature with the RTT console. I can see the SYS_LOG output with the pyrtt-viwer but I cannot write any command.

 

Any clue on that?

 

Best regards,

Rodrigo Peixoto

Co-founder and Technical advisor

 

+55 (82) 98144-8585

http://ayna.tech | Skype: rodrigopex

 


Rodrigo Peixoto
 

Thank you.

I'll try to start that.

Best regards,
Rodrigo Peixoto

On Wed, 13 Jun 2018 at 19:45 Rosen, Michael R <michael.r.rosen@...> wrote:

Rodrigo

 

Currently, the RTT console driver doesn’t support input (ie, from a host to device). You would have to add this functionality to the RTT console driver (drivers/console/rtt_console.c) and the shell subsystem to interact with it (subsys/shell/shell.c); you can use the uart_console as a reference (drivers/console/uart_console.c).

 

Mike

 

From: users@... [mailto:users@...] On Behalf Of Rodrigo Peixoto
Sent: Wednesday, June 13, 2018 3:34 PM
To: users@...
Subject: [Zephyr-users] Using shell with RTT console on nRF52840 DK

 

Hi,

I am trying to use the shell feature with the RTT console. I can see the SYS_LOG output with the pyrtt-viwer but I cannot write any command.

 

Any clue on that?

 

Best regards,

Rodrigo Peixoto

Co-founder and Technical advisor

 

+55 (82) 98144-8585

http://ayna.tech | Skype: rodrigopex

 

--
Rodrigo Peixoto
Co-founder and Technical guru

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex

.


Rodrigo Peixoto
 

Mike,

I was taking a look at the uart_console and I couldn't any straight solution for RTT.
Uart has a device driver that enables us to use an ISR approach which is cool. There is no device driver for the SEGGER (at least, I could not find it), so the only thing I have in mind right now is to make a polling on the SEGGER_RTT_HasData function to see if there is data to be read from the host, if so write it to the input hook. For me, it seems to be a not so good solution. What do you think? Any other idea?


Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex




Carles Cufi
 

Hi Rodrgo,

 

Krzysztof (on copy) is working on RTT and logging as well.

 

There’s this PR from him under review at the moment: https://github.com/zephyrproject-rtos/zephyr/pull/8110

 

Regards,

 

Carles

 

From: users@... <users@...> On Behalf Of Rodrigo Peixoto
Sent: 14 June 2018 15:58
To: Rosen, Michael R <michael.r.rosen@...>
Cc: users@...
Subject: Re: [Zephyr-users] Using shell with RTT console on nRF52840 DK

 

Mike,

 

I was taking a look at the uart_console and I couldn't any straight solution for RTT.

Uart has a device driver that enables us to use an ISR approach which is cool. There is no device driver for the SEGGER (at least, I could not find it), so the only thing I have in mind right now is to make a polling on the SEGGER_RTT_HasData function to see if there is data to be read from the host, if so write it to the input hook. For me, it seems to be a not so good solution. What do you think? Any other idea?

 

 

Best regards,

Rodrigo Peixoto

Co-founder and Technical advisor

 

+55 (82) 98144-8585

http://ayna.tech | Skype: rodrigopex

 

 


Michael Rosen
 

Rodrigo,

 

Unfortunately, as RTT is just buffers in memory, there is no good way I can think of except to have a low priority background thread which polls the input channel using GetKey() and yields if negative (basically what WaitKey() does but with a yield). It might be a good idea to create an issue on github to track this request if you haven’t already.

 

Mike

 

From: Cufi, Carles [mailto:Carles.Cufi@...]
Sent: Thursday, June 14, 2018 7:02 AM
To: Rodrigo Peixoto <rodrigopex@...>; Rosen, Michael R <michael.r.rosen@...>; Chruściński, Krzysztof <Krzysztof.Chruscinski@...>
Cc: users@...
Subject: RE: [Zephyr-users] Using shell with RTT console on nRF52840 DK

 

Hi Rodrgo,

 

Krzysztof (on copy) is working on RTT and logging as well.

 

There’s this PR from him under review at the moment: https://github.com/zephyrproject-rtos/zephyr/pull/8110

 

Regards,

 

Carles

 

From: users@... <users@...> On Behalf Of Rodrigo Peixoto
Sent: 14 June 2018 15:58
To: Rosen, Michael R <michael.r.rosen@...>
Cc: users@...
Subject: Re: [Zephyr-users] Using shell with RTT console on nRF52840 DK

 

Mike,

 

I was taking a look at the uart_console and I couldn't any straight solution for RTT.

Uart has a device driver that enables us to use an ISR approach which is cool. There is no device driver for the SEGGER (at least, I could not find it), so the only thing I have in mind right now is to make a polling on the SEGGER_RTT_HasData function to see if there is data to be read from the host, if so write it to the input hook. For me, it seems to be a not so good solution. What do you think? Any other idea?

 

 

Best regards,

Rodrigo Peixoto

Co-founder and Technical advisor

 

+55 (82) 98144-8585

http://ayna.tech | Skype: rodrigopex

 

Image removed by sender.

 


Rodrigo Peixoto
 

Mike,
I have created the issue (#8394). I will try to start that.


Thank you,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex