0

Im trying to implement Continuous Recording for systemview over UART on an STM32F103. my application is using FreeRTOS v11. I am able to successfully get data in snapshot mode and view it in systemview. I tried implementing continuous mode using uart by adding the following code to SEGGER_SYSVIEW_Config_UART.h

void BSP_UART_Init(uint32_t uart_port, uint32_t baudrate) {
  static uint8_t rxByte = 0;
  static uint8_t txByte = 0;

  // Assign the pointers to these local static bytes
  recieveData = &rxByte;
  transmitData = &txByte;

  if (uart_port == 0) {
    MX_USART2_UART_Init(baudrate);
    HAL_UART_Receive_IT(&huart2, (uint8_t *)recieveData, 1);
  }
}

/*********************************************************************
*
*       HAL_UART_TxCpltCallback
*/
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
  (void)huart;
  _SysView_OnTxComplete(_SYSVIEW_UART_PORT);
}

/*********************************************************************
*
*       HAL_UART_RxCpltCallback
*/
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
  (void)huart;
  _SysView_OnRxComplete(_SYSVIEW_UART_PORT, *recieveData);
}

The recording starts but stops in between. I've attached a screenshot below showing the behavior

I've set SEGGER_SYSVIEW_RTT_BUFFER_SIZE to 20KB

2
  • Where does Segger come into this? Are you using Segger Studio (which is actually a thin wrapper around Rowley Crossworks)? This looks like the so-called "HAL" by ST to me. Commented Oct 22 at 9:11
  • Im Using STM32_Cube_IDE with FreeRTOS. The only thing that is SEGGER's is Systemview Commented Oct 22 at 11:18

1 Answer 1

0

I got it working eventually. The issue was that once the events buffer became empty, the uart just stopped transmitting data. In the file SEGGER_SYSVIEW_Conf.h I added the macro for SEGGER_SYSVIEW_ON_EVENT_RECORDED . Here's my final file

#ifndef SEGGER_SYSVIEW_CONF_H
#define SEGGER_SYSVIEW_CONF_H

#if !(defined SEGGER_SYSVIEW_SECTION) && (defined SEGGER_RTT_BUFFER_SECTION)
  #define SEGGER_SYSVIEW_SECTION                  SEGGER_RTT_BUFFER_SECTION
#endif


#define SEGGER_SYSVIEW_USE_INTERNAL_RECORDER 1

#define SEGGER_SYSVIEW_CORE 2

#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE (1024*20)

void SEGGER_SYSVIEW_X_OnEventRecorded(unsigned NumBytes);

#define SEGGER_SYSVIEW_ON_EVENT_RECORDED(NumBytes) SEGGER_SYSVIEW_X_OnEventRecorded(NumBytes)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.