-
First, thank you for your great effort on this project. It looks most useful. I have a device that has and internal file system and I would like to output the Trice messages to there in files. The device also has an RTOS, so my plan is to have a task specifically for writing Trice messages to the file system. It is not clear to me which functions I need to rewrite in order to send the Trice messages to a file, could you advise please? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi sidprice, what I understand from your question: It is only one single device. You intend to use TRICE macros on that device and wish to have a log file on the very same device on the device internal file system. |
Beta Was this translation helpful? Give feedback.
-
@rokath Yes, the device logs will be kept locally and then may be transferred via Bluetooth or by the PC reading the filesystem via USB. |
Beta Was this translation helpful? Give feedback.
-
Inside the `triceConfig around line 48 you see this: //#define TRICE_RTT_CHANNEL 0 //!< Enable and set channel number for SeggerRTT usage. Only channel 0 works right now for some reason.
#define TRICE_UART USART2 //!< Enable and set UART for serial output. Proposal: Change that to: //#define TRICE_RTT_CHANNEL 0 //!< Enable and set channel number for SeggerRTT usage. Only channel 0 works right now for some reason.
//#define TRICE_UART USART2 //!< Enable and set UART for serial output.
#define TRICE_LOCAL_BINARY_LOGFILE //!< Enable and set a local file as logfile for output. #if defined( TRICE_LOCAL_BINARY_LOGFILE ) && !defined( TRICE_HALF_BUFFER_SIZE ) // direct out to local files system
#define TRICE_WRITE( buf, len ) do{ WriteToLocalLogFile( buf, len ); }while(0)
void WriteToLocalLogFile( uint8_t const * buf, unsigned len );
#endif Alternatively: #if defined( TRICE_LOCAL_BINARY_LOGFILE ) && defined( TRICE_HALF_BUFFER_SIZE ) // buffered out to local files system
#define TRICE_WRITE( buf, len ) do{ WriteToLocalLogFile( buf, len ); }while(0)
void WriteToLocalLogFile( uint8_t const * buf, unsigned len );
#endif Then provide function After you transferred trice log -port FILEBUFFER assuming trice log -port FILEBUFFER -args "path/to/MyTrices.bin" -idList "path/to/til.json" If you mount the target filesystem to the PC you can also say: trice log -port FILE -args "mnt/path/to/trices.raw" -idList "mnt/path/to/til.json" to see the logs continously. This proposal logs the trice messages in binary form. A log in text form I would not recommend for space and speed reasons. |
Beta Was this translation helpful? Give feedback.
Inside the `triceConfig around line 48 you see this:
Proposal: Change that to: