add systemview for debugging purposes
This commit is contained in:
@@ -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 */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user