add systemview for debugging purposes

dma
Eggert Jung 6 months ago
parent e7c793c88e
commit 8f576045ed

3
.gitmodules vendored

@ -1,3 +1,6 @@
[submodule "Drivers/RTT"]
path = Drivers/RTT
url = https://github.com/SEGGERMicro/RTT.git
[submodule "Drivers/SystemView"]
path = Drivers/SystemView
url = https://github.com/SEGGERMicro/SystemView.git

@ -0,0 +1 @@
Subproject commit d8bbf3f6e779af76a09cf7000c2003ab17ca11c6

@ -58,6 +58,8 @@ Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c \
Drivers/RTT/RTT/SEGGER_RTT.c \
Drivers/RTT/RTT/SEGGER_RTT_printf.c \
Drivers/RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.c \
Drivers/SystemView/SYSVIEW/SEGGER_SYSVIEW.c \
Drivers/SystemView/Sample/NoOS/Config/Cortex-M0/SEGGER_SYSVIEW_Config_NoOS_CM0.c\
Src/system_stm32g0xx.c
# ASM sources
@ -124,7 +126,10 @@ C_INCLUDES = \
-IDrivers/CMSIS/Device/ST/STM32G0xx/Include \
-IDrivers/CMSIS/Include \
-IDrivers/RTT/Config \
-IDrivers/RTT/RTT
-IDrivers/RTT/RTT \
-IDrivers/SystemView/Config \
-IDrivers/SystemView/SEGGER \
-IDrivers/SystemView/SYSVIEW
# compile gcc flags

@ -21,6 +21,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "SEGGER_SYSVIEW.h"
#include "SEGGER_RTT.h"
#include "stm32g0b1xx.h"
#include "stm32g0xx_hal_cortex.h"
@ -119,6 +120,7 @@ void init_UART1_dma(){
}
void USART1_IRQHandler(){
SEGGER_SYSVIEW_RecordEnterISR();
if(USART1->ISR & USART_ISR_RXNE_RXFNE){
//printf("%x ", USART1->RDR);
rxBuffer[rxBufferPos++] = USART1->RDR;
@ -150,14 +152,17 @@ void USART1_IRQHandler(){
USART1->ICR = USART_ICR_UDRCF;
printf("UDR\n");
}
SEGGER_SYSVIEW_RecordExitISR();
}
void DMA1_Channel1_IRQHandler(){
SEGGER_SYSVIEW_RecordEnterISR();
if(DMA1->ISR & DMA_ISR_TCIF1){
DMA1->IFCR = DMA_IFCR_CTCIF1;
DMA1_Channel1->CCR &= ~( DMA_CCR_EN );
DMA1_Channel1->CMAR = ( uint32_t )&rxBuffer[0];
}
SEGGER_SYSVIEW_RecordExitISR();
}
/* USER CODE END 0 */
@ -167,9 +172,12 @@ void DMA1_Channel1_IRQHandler(){
*/
int main(void)
{
/* USER CODE BEGIN 1 */
SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
printf("Moin!\n");
SEGGER_SYSVIEW_Conf(); /* Configure and initialize SystemView */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/

@ -23,6 +23,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stdio.h"
#include "SEGGER_SYSVIEW.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@ -126,11 +127,11 @@ void PendSV_Handler(void)
void SysTick_Handler(void)
{
/* USER CODE BEGIN SysTick_IRQn 0 */
SEGGER_SYSVIEW_RecordEnterISR();
/* USER CODE END SysTick_IRQn 0 */
HAL_IncTick();
/* USER CODE BEGIN SysTick_IRQn 1 */
SEGGER_SYSVIEW_RecordExitISR();
/* USER CODE END SysTick_IRQn 1 */
}

@ -9,6 +9,9 @@
-IDrivers/CMSIS/Include
-IDrivers/RTT/Config
-IDrivers/RTT/RTT
-IDrivers/SystemView/Config
-IDrivers/SystemView/SEGGER
-IDrivers/SystemView/SYSVIEW
-Og
-Wall
-fdata-sections

Loading…
Cancel
Save