danielappiagyei-bc opened a new issue, #10556:
URL: https://github.com/apache/nuttx/issues/10556

   Hi,
   Is there any documentation or examples on how to use Segger's RTT 
functionality in NuttX?
   I've read [segger's documentation](https://wiki.segger.com/RTT) and set the 
appropriate [nuttx 
kconfig's](https://github.com/apache/nuttx/blob/nuttx-12.2.1/drivers/segger/Kconfig):
   
   ```
   CONFIG_STREAM_RTT=y
   CONFIG_SEGGER_RTT=y
   # IMXRT1064 cache line is 4 bytes
   CONFIG_SEGGER_RTT_CPU_CACHE_LINE_SIZE=4
   ```
   
   After compiling I see an `RTT` directory generated under `drivers/segger/` 
with segger's source and header RTT implementation files.
   I include 
[segger/rtt.h](https://github.com/apache/nuttx/blob/nuttx-12.2.1/include/nuttx/segger/rtt.h)
 in a file of mine that gets compiled **as C++** but compilation fails due to 
`rtt.h` using the C++ reserved keyword `public` for fields in `struct 
lib_rttoutstream_s` and `struct lib_rttinstream_s`. Additionally, the 
transitive include 
[streams.h](https://github.com/apache/nuttx/blob/nuttx-12.2.1/include/nuttx/streams.h)
 uses `public` as well as the `this` keyword (e.g., 
[here](https://github.com/apache/nuttx/blob/nuttx-12.2.1/include/nuttx/streams.h#L73)
 and 
[here](https://github.com/apache/nuttx/blob/nuttx-12.2.1/include/nuttx/streams.h#L140)).
   
   rtt.h uses a '#ifdef __cplusplus' guard 
[here](https://github.com/apache/nuttx/blob/nuttx-12.2.1/include/nuttx/segger/rtt.h#L62)
 so I'm assuming including it from a c++ file was an intended use case. Could 
someone help me understand if this is a bug or if I'm attempting to use the RTT 
API incorrectly?
   
   Thanks!
   
   **NuttX version**: 12.2.1


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to