/* ** =================================================================== ** Method : RTT1_Init (component SeggerRTT) ** Description : ** Initializes the RTT Control Block. ** Parameters : None ** Returns : Nothing ** =================================================================== */ void RTT1_Init(void) { SEGGER_RTT_Init(); #if RTT1_RTT_CHANNEL_0_ENABLED (void)RTT1_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); (void)RTT1_ConfigDownBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); #endif }
int main(void) { /* USER CODE BEGIN 1 */ SCB->VTOR = FLASH_START_SECTOR_ADDR; SEGGER_RTT_Init(); /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_ADC1_Init(); MX_I2C1_Init(); MX_I2C2_Init(); MX_SPI1_Init(); MX_TIM3_Init(); MX_USART2_UART_Init(); MX_RTC_Init(); /* USER CODE BEGIN 2 */ //as7000_init(); /* USER CODE END 2 */ /* Call init function for freertos objects (in freertos.c) */ MX_FREERTOS_Init(); /* Start scheduler */ osKernelStart(); /* We should never get here as control is now taken by the scheduler */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }
/* ** =================================================================== ** Method : RTT1_Init (component SeggerRTT) ** Description : ** Initializes the RTT Control Block. ** Parameters : None ** Returns : Nothing ** =================================================================== */ void RTT1_Init(void) { SEGGER_RTT_Init(); #if 0 /* not doing this, as this might overwrite already configured channels, e.g. by Percepio */ for (i=0;i<SEGGER_RTT_MAX_NUM_UP_BUFFERS;i++) { /* configure channels with defaults */ (void)RTT1_ConfigUpBuffer(i, "", NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); } for (i=0;i<SEGGER_RTT_MAX_NUM_DOWN_BUFFERS;i++) { /* configure channels with defaults */ (void)RTT1_ConfigDownBuffer(i, "", NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); } #endif #if 0 && RTT1_RTT_CHANNEL_0_ENABLED (void)RTT1_ConfigUpBuffer(0, SEGGER_RTT_CHANNEL_0_NAME, NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); (void)RTT1_ConfigDownBuffer(0, SEGGER_RTT_CHANNEL_0_NAME, NULL, 0, SEGGER_RTT_MODE_NO_BLOCK_SKIP); #endif }
int main(void) { init_clock(); NVIC_SetPriority(SWI2_IRQn, 2); NVIC_EnableIRQ(SWI2_IRQn); __enable_irq(); #ifdef RTT_LOG SEGGER_RTT_Init(); __LOG("= START | %s | ===========================================================\n", __TIME__); #endif init_leds(); bootloader_init(); /* Wait for any ongoing bank transfers to finish. */ while (dfu_bank_transfer_in_progress()) { /* may safely while-loop here, as the bank-transfer finishes in an IRQ. */ __WFE(); } /* check whether we should go to application */ if (NRF_POWER->GPREGRET == RBC_MESH_GPREGRET_CODE_GO_TO_APP) { bootloader_abort(DFU_END_SUCCESS); } NRF_POWER->GPREGRET = RBC_MESH_GPREGRET_CODE_GO_TO_APP; bootloader_enable(); while (1) { __WFE(); } }
void nrf_log_backend_rtt_init(void) { SEGGER_RTT_Init(); }
void BSP_RTT_Init(void) { //SEGGER_RTT_ConfigUpBuffer(0, NULL, NULL, 0, SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL); SEGGER_RTT_Init(); }