diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-12 17:49:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-12 17:49:47 +0000 |
commit | ec6b2a92400bf21f8b501d76b7cae54ac7a41381 (patch) | |
tree | 4f798fecb44a0a79183b734b1f6f8450871adeba /nuttx/arch/arm/src | |
parent | d9580c5a997f0d33b216956db4a05ad784aaa065 (diff) | |
download | px4-nuttx-ec6b2a92400bf21f8b501d76b7cae54ac7a41381.tar.gz px4-nuttx-ec6b2a92400bf21f8b501d76b7cae54ac7a41381.tar.bz2 px4-nuttx-ec6b2a92400bf21f8b501d76b7cae54ac7a41381.zip |
More apps/ related changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3372 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_start.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_start.c b/nuttx/arch/arm/src/stm32/stm32_start.c index 1ac753f5a..9deb19dd2 100644 --- a/nuttx/arch/arm/src/stm32/stm32_start.c +++ b/nuttx/arch/arm/src/stm32/stm32_start.c @@ -2,7 +2,7 @@ * arch/arm/src/stm32/stm32_start.c * arch/arm/src/chip/stm32_start.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,8 @@ #include "up_internal.h" #include "stm32_internal.h" +#include "stm32_gpio.h" + /**************************************************************************** * Private Definitions @@ -67,6 +69,31 @@ /**************************************************************************** * Private Functions ****************************************************************************/ + +void stm32_jtag_enable(void) +{ +#ifdef CONFIG_STM32_JTAG_FULL_ENABLE + +#elif CONFIG_STM32_JTAG_NOJNTRST_ENABLE + uint32_t val = getreg32(STM32_AFIO_MAPR); + val &= 0x00FFFFFF; // clear undefined readings ... + val |= AFIO_MAPR_SWJ; // enabled but without JNTRST + putreg32(val, STM32_AFIO_MAPR); + +#elif CONFIG_STM32_JTAG_SW_ENABLE + uint32_t val = getreg32(STM32_AFIO_MAPR); + val &= 0x00FFFFFF; // clear undefined readings ... + val |= AFIO_MAPR_SWDP; // set JTAG-DP disabled and SW-DP enabled + putreg32(val, STM32_AFIO_MAPR); + +#else + uint32_t val = getreg32(STM32_AFIO_MAPR); + val &= 0x00FFFFFF; // clear undefined readings ... + val |= AFIO_MAPR_DISAB; // set JTAG-DP and SW-DP Disabled + putreg32(val, STM32_AFIO_MAPR); + +#endif +} /**************************************************************************** * Name: showprogress @@ -103,6 +130,7 @@ void __start(void) stm32_clockconfig(); stm32_lowsetup(); + stm32_jtag_enable(); showprogress('A'); /* Clear .bss. We'll do this inline (vs. calling memset) just to be |