@@ -86,7 +86,7 @@ am_devices_button_t am_bsp_psButtons[AM_BSP_NUM_BUTTONS] =
8686// Print interface tracking variable.
8787//
8888//*****************************************************************************
89- static uint32_t g_ui32PrintInterface = AM_BSP_PRINT_INFC_NONE ;
89+ static uint32_t g_ui32PrintInterface = AM_BSP_PRINT_INFC_UART0 ;
9090
9191//*****************************************************************************
9292//
@@ -172,12 +172,6 @@ static am_hal_uart_config_t g_sBspUartBufferedConfig =
172172void
173173am_bsp_low_power_init (void )
174174{
175- //
176- // Make sure SWO/ITM/TPIU is disabled.
177- // SBL may not get it completely shut down.
178- //
179- am_bsp_itm_printf_disable ();
180-
181175 //
182176 // Initialize for low power in the power control block
183177 //
@@ -194,9 +188,10 @@ am_bsp_low_power_init(void)
194188 am_hal_clkgen_control (AM_HAL_CLKGEN_CONTROL_XTAL_STOP , 0 );
195189
196190 //
197- // Disable the RTC.
191+ // Make sure SWO/ITM/TPIU is disabled.
192+ // SBL may not get it completely shut down.
198193 //
199- am_hal_rtc_osc_disable ();
194+ am_bsp_itm_printf_disable ();
200195
201196#ifdef AM_BSP_NUM_LEDS
202197 //
@@ -241,7 +236,9 @@ am_bsp_debug_printf_enable(void)
241236{
242237 if (g_ui32PrintInterface == AM_BSP_PRINT_INFC_SWO )
243238 {
239+ #ifdef AM_BSP_GPIO_ITM_SWO
244240 am_bsp_itm_printf_enable ();
241+ #endif
245242 }
246243 else if (g_ui32PrintInterface == AM_BSP_PRINT_INFC_UART0 )
247244 {
@@ -284,7 +281,11 @@ am_bsp_debug_printf_disable(void)
284281//
285282//*****************************************************************************
286283void
284+ #ifdef AM_BSP_GPIO_ITM_SWO
287285am_bsp_itm_printf_enable (void )
286+ #else
287+ am_bsp_itm_printf_enable (uint32_t ui32Pin , am_hal_gpio_pincfg_t sPincfg )
288+ #endif
288289{
289290 am_hal_tpiu_config_t TPIUcfg ;
290291
@@ -297,22 +298,40 @@ am_bsp_itm_printf_enable(void)
297298 // Enable the ITM interface and the SWO pin.
298299 //
299300 am_hal_itm_enable ();
300- // am_hal_gpio_pinconfig(AM_BSP_GPIO_ITM_SWO, g_AM_BSP_GPIO_ITM_SWO);
301301
302302 //
303303 // Enable the ITM and TPIU
304304 // Set the BAUD clock for 1M
305305 //
306- TPIUcfg .ui32SetItmBaud = AM_HAL_TPIU_BAUD_1M ;
306+ TPIUcfg .ui32SetItmBaud = AM_HAL_TPIU_BAUD_2M ;
307307 am_hal_tpiu_enable (& TPIUcfg );
308- // am_hal_gpio_pinconfig(AM_BSP_GPIO_ITM_SWO, g_AM_BSP_GPIO_ITM_SWO);
308+ #ifdef AM_BSP_GPIO_ITM_SWO
309+ am_hal_gpio_pinconfig (AM_BSP_GPIO_ITM_SWO , g_AM_BSP_GPIO_ITM_SWO );
310+ #else
311+ am_hal_gpio_pinconfig (ui32Pin , sPincfg );
312+ #endif
309313
310314 //
311315 // Attach the ITM to the STDIO driver.
312316 //
313317 am_util_stdio_printf_init (am_hal_itm_print );
314318} // am_bsp_itm_printf_enable()
315319
320+ //*****************************************************************************
321+ //
322+ //! @brief ITM-based string print function.
323+ //!
324+ //! This function is used for printing a string via the ITM.
325+ //!
326+ //! @return None.
327+ //
328+ //*****************************************************************************
329+ void
330+ am_bsp_itm_string_print (char * pcString )
331+ {
332+ am_hal_itm_print (pcString );
333+ }
334+
316335//*****************************************************************************
317336//
318337// @brief Disable printing over ITM.
0 commit comments