Merged in pnb990/nuttx-kernel-arch (pull request #15)

add swo for stm32F4xxx
This commit is contained in:
Gregory Nutt 2015-09-23 14:58:15 -06:00
commit f16c3fd763
2 changed files with 32 additions and 0 deletions

View File

@ -100,6 +100,10 @@ CMN_CSRCS += up_copyarmstate.c
endif
endif
ifeq ($(CONFIG_ARMV7M_ITMSYSLOG),y)
CMN_CSRCS += up_itm_syslog.c
endif
CHIP_ASRCS =
CHIP_CSRCS = stm32_allocateheap.c stm32_start.c stm32_rcc.c stm32_lse.c

View File

@ -38,7 +38,10 @@
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include "chip.h"
#include "stm32_pwr.h"
#include "itm_syslog.h"
/****************************************************************************
* Pre-processor Definitions
@ -789,6 +792,30 @@ static void stm32_stdclockconfig(void)
}
#endif
/****************************************************************************
* Name: efm32_itm_syslog
*
* Description:
* Enable Serial wire output pin, configure debug clocking, and enable
* ITM syslog support.
*
****************************************************************************/
#if defined(CONFIG_SYSLOG) || defined(CONFIG_ARMV7M_ITMSYSLOG)
static inline void rcc_itm_syslog(void)
{
/* Enable SWO output */
modifyreg32(STM32_DBGMCU_CR, DBGMCU_CR_TRACEMODE_MASK, DBGMCU_CR_ASYNCH|\
DBGMCU_CR_TRACEIOEN);
itm_syslog_initialize();
}
#else
# define rcc_itm_syslog()
#endif
/****************************************************************************
* Name: rcc_enableperiphals
****************************************************************************/
@ -800,6 +827,7 @@ static inline void rcc_enableperipherals(void)
rcc_enableahb3();
rcc_enableapb1();
rcc_enableapb2();
rcc_itm_syslog();
}
/****************************************************************************