add systemview for debugging purposes
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -1,3 +1,6 @@
|
|||||||
[submodule "Drivers/RTT"]
|
[submodule "Drivers/RTT"]
|
||||||
path = Drivers/RTT
|
path = Drivers/RTT
|
||||||
url = https://github.com/SEGGERMicro/RTT.git
|
url = https://github.com/SEGGERMicro/RTT.git
|
||||||
|
[submodule "Drivers/SystemView"]
|
||||||
|
path = Drivers/SystemView
|
||||||
|
url = https://github.com/SEGGERMicro/SystemView.git
|
||||||
|
|||||||
1
Drivers/SystemView
Submodule
1
Drivers/SystemView
Submodule
Submodule Drivers/SystemView added at d8bbf3f6e7
7
Makefile
7
Makefile
@@ -58,6 +58,8 @@ Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_exti.c \
|
|||||||
Drivers/RTT/RTT/SEGGER_RTT.c \
|
Drivers/RTT/RTT/SEGGER_RTT.c \
|
||||||
Drivers/RTT/RTT/SEGGER_RTT_printf.c \
|
Drivers/RTT/RTT/SEGGER_RTT_printf.c \
|
||||||
Drivers/RTT/Syscalls/SEGGER_RTT_Syscalls_GCC.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
|
Src/system_stm32g0xx.c
|
||||||
|
|
||||||
# ASM sources
|
# ASM sources
|
||||||
@@ -124,7 +126,10 @@ C_INCLUDES = \
|
|||||||
-IDrivers/CMSIS/Device/ST/STM32G0xx/Include \
|
-IDrivers/CMSIS/Device/ST/STM32G0xx/Include \
|
||||||
-IDrivers/CMSIS/Include \
|
-IDrivers/CMSIS/Include \
|
||||||
-IDrivers/RTT/Config \
|
-IDrivers/RTT/Config \
|
||||||
-IDrivers/RTT/RTT
|
-IDrivers/RTT/RTT \
|
||||||
|
-IDrivers/SystemView/Config \
|
||||||
|
-IDrivers/SystemView/SEGGER \
|
||||||
|
-IDrivers/SystemView/SYSVIEW
|
||||||
|
|
||||||
|
|
||||||
# compile gcc flags
|
# compile gcc flags
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
|
#include "SEGGER_SYSVIEW.h"
|
||||||
#include "SEGGER_RTT.h"
|
#include "SEGGER_RTT.h"
|
||||||
#include "stm32g0b1xx.h"
|
#include "stm32g0b1xx.h"
|
||||||
#include "stm32g0xx_hal_cortex.h"
|
#include "stm32g0xx_hal_cortex.h"
|
||||||
@@ -119,6 +120,7 @@ void init_UART1_dma(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USART1_IRQHandler(){
|
void USART1_IRQHandler(){
|
||||||
|
SEGGER_SYSVIEW_RecordEnterISR();
|
||||||
if(USART1->ISR & USART_ISR_RXNE_RXFNE){
|
if(USART1->ISR & USART_ISR_RXNE_RXFNE){
|
||||||
//printf("%x ", USART1->RDR);
|
//printf("%x ", USART1->RDR);
|
||||||
rxBuffer[rxBufferPos++] = USART1->RDR;
|
rxBuffer[rxBufferPos++] = USART1->RDR;
|
||||||
@@ -150,14 +152,17 @@ void USART1_IRQHandler(){
|
|||||||
USART1->ICR = USART_ICR_UDRCF;
|
USART1->ICR = USART_ICR_UDRCF;
|
||||||
printf("UDR\n");
|
printf("UDR\n");
|
||||||
}
|
}
|
||||||
|
SEGGER_SYSVIEW_RecordExitISR();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMA1_Channel1_IRQHandler(){
|
void DMA1_Channel1_IRQHandler(){
|
||||||
|
SEGGER_SYSVIEW_RecordEnterISR();
|
||||||
if(DMA1->ISR & DMA_ISR_TCIF1){
|
if(DMA1->ISR & DMA_ISR_TCIF1){
|
||||||
DMA1->IFCR = DMA_IFCR_CTCIF1;
|
DMA1->IFCR = DMA_IFCR_CTCIF1;
|
||||||
DMA1_Channel1->CCR &= ~( DMA_CCR_EN );
|
DMA1_Channel1->CCR &= ~( DMA_CCR_EN );
|
||||||
DMA1_Channel1->CMAR = ( uint32_t )&rxBuffer[0];
|
DMA1_Channel1->CMAR = ( uint32_t )&rxBuffer[0];
|
||||||
}
|
}
|
||||||
|
SEGGER_SYSVIEW_RecordExitISR();
|
||||||
}
|
}
|
||||||
/* USER CODE END 0 */
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
@@ -167,9 +172,12 @@ void DMA1_Channel1_IRQHandler(){
|
|||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* USER CODE BEGIN 1 */
|
||||||
SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
|
SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL);
|
||||||
printf("Moin!\n");
|
printf("Moin!\n");
|
||||||
|
|
||||||
|
SEGGER_SYSVIEW_Conf(); /* Configure and initialize SystemView */
|
||||||
/* USER CODE END 1 */
|
/* USER CODE END 1 */
|
||||||
|
|
||||||
/* MCU Configuration--------------------------------------------------------*/
|
/* MCU Configuration--------------------------------------------------------*/
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
/* Private includes ----------------------------------------------------------*/
|
/* Private includes ----------------------------------------------------------*/
|
||||||
/* USER CODE BEGIN Includes */
|
/* USER CODE BEGIN Includes */
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
#include "SEGGER_SYSVIEW.h"
|
||||||
/* USER CODE END Includes */
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
/* Private typedef -----------------------------------------------------------*/
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
@@ -126,11 +127,11 @@ void PendSV_Handler(void)
|
|||||||
void SysTick_Handler(void)
|
void SysTick_Handler(void)
|
||||||
{
|
{
|
||||||
/* USER CODE BEGIN SysTick_IRQn 0 */
|
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||||
|
SEGGER_SYSVIEW_RecordEnterISR();
|
||||||
/* USER CODE END SysTick_IRQn 0 */
|
/* USER CODE END SysTick_IRQn 0 */
|
||||||
HAL_IncTick();
|
HAL_IncTick();
|
||||||
/* USER CODE BEGIN SysTick_IRQn 1 */
|
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||||
|
SEGGER_SYSVIEW_RecordExitISR();
|
||||||
/* USER CODE END SysTick_IRQn 1 */
|
/* USER CODE END SysTick_IRQn 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,9 @@
|
|||||||
-IDrivers/CMSIS/Include
|
-IDrivers/CMSIS/Include
|
||||||
-IDrivers/RTT/Config
|
-IDrivers/RTT/Config
|
||||||
-IDrivers/RTT/RTT
|
-IDrivers/RTT/RTT
|
||||||
|
-IDrivers/SystemView/Config
|
||||||
|
-IDrivers/SystemView/SEGGER
|
||||||
|
-IDrivers/SystemView/SYSVIEW
|
||||||
-Og
|
-Og
|
||||||
-Wall
|
-Wall
|
||||||
-fdata-sections
|
-fdata-sections
|
||||||
|
|||||||
Reference in New Issue
Block a user