shell: jtag: add command to enable/disable JTAG

master
S.J.R. van Schaik 7 years ago
parent efb5a23859
commit 3484a7b3f6
  1. 4
      source/main.c
  2. 3
      source/platform/stm32f1/gpio.c
  3. 4
      source/shell/Makefile

@ -17,6 +17,7 @@
#include <shell/boot.h>
#include <shell/buzzer.h>
#include <shell/echo.h>
#include <shell/jtag.h>
#include <shell/led.h>
#include <shell/mufs.h>
#include <shell/rtc.h>
@ -45,6 +46,9 @@ struct cmd user_cmds[] = {
struct cmd admin_cmds[] = {
{ "echo", shell_echo },
#ifdef STM32F1
{ "jtag", shell_jtag },
#endif
{ "buzzer", shell_buzzer },
{ "led", shell_led },
{ "reset", shell_alarm },

@ -30,7 +30,8 @@ int gpio_init(void)
GPIO1);
/* Set up GPIOs for timers. */
gpio_primary_remap(0, AFIO_MAPR_TIM2_REMAP_PARTIAL_REMAP1);
gpio_primary_remap(AFIO_MAPR_SWJ_CFG_JTAG_OFF_SW_ON,
AFIO_MAPR_TIM2_REMAP_PARTIAL_REMAP1);
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_50_MHZ,
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_TIM2_PR1_CH1_ETR);

@ -11,3 +11,7 @@ obj-y += source/shell/mufs.o
obj-y += source/shell/progress.o
obj-y += source/shell/rtc.o
obj-y += source/shell/version.o
ifeq (${TARGET},stm32f1)
obj-y += source/shell/jtag.o
endif

Loading…
Cancel
Save