From 24ec55baa79ce6b76f65ef2dab8eee85e0dc703e Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Sat, 3 Jul 2021 13:50:03 +0200 Subject: [PATCH] Free B4 pin on Longan Nano Board By default B4 has the JTAG NJRST signal with a pull up enabled. On the longan Nano this PIN is broken out as a regular pin. So we just disable NJRST by default and make it available as a regular GPIO. --- os/hal/boards/SIPEED_LONGAN_NANO/board.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/hal/boards/SIPEED_LONGAN_NANO/board.c b/os/hal/boards/SIPEED_LONGAN_NANO/board.c index 6bf05ce0..36a27cb5 100644 --- a/os/hal/boards/SIPEED_LONGAN_NANO/board.c +++ b/os/hal/boards/SIPEED_LONGAN_NANO/board.c @@ -44,4 +44,6 @@ void __early_init(void) { * Board-specific initialization code. */ void boardInit(void) { + /* Free B4 pin by disabling JTAG NJTRST. */ + AFIO->PCF0 |= AFIO_PCF0_SWJ_CFG_NOJNTRST; }