Acknowledgement button on Olimex STM32-H103

Ardavast Dayleryan ardavast at noiseoverip.com
Fri Oct 25 22:44:11 CEST 2019


Hello,

I'm trying to get the acknowledgement button feature  to work on an Olimex
STM32-H103 board: https://www.olimex.com/Products/ARM/ST/STM32-H103/
The schematic can be found on this link:
https://www.olimex.com/Products/ARM/ST/STM32-H405/resources/STM32-H405_sch.pdf

The schematic shows that the button is connected to PA0 with a 10k
pull-up.  After browsing through the code and the STM32 reference manual
I tried to create the patch listed below.  However it doesn't work - I
can sign files without any problem, but it doesn't wait for
confirmation.  I've never programmed anything on an STM32 before, so I
guess I'm missing something obvious.  Can anyone help me to get on the
right track with this?

diff --git a/board/board-olimex-stm32-h103.h
b/board/board-olimex-stm32-h103.h
index 348860d..05f9b8f 100644
--- a/board/board-olimex-stm32-h103.h
+++ b/board/board-olimex-stm32-h103.h
@@ -12,7 +12,7 @@
 #define GPIO_LED_CLEAR_TO_EMIT          12
 #define GPIO_USB_BASE   GPIOC_BASE
 #define GPIO_USB_CLEAR_TO_ENABLE        11
-#undef  GPIO_OTHER_BASE
+#define GPIO_OTHER_BASE GPIOA_BASE

 /*
  * Port C setup.
@@ -29,5 +29,9 @@
 #define VAL_GPIO_LED_CRL            0x44888888      /*  PC7...PC0 */
 #define VAL_GPIO_LED_CRH            0x88837888      /* PC15...PC8 */

+#define VAL_GPIO_OTHER_ODR          0xFFFFFFFF
+#define VAL_GPIO_OTHER_CRL          0x44444448      /*  PA7...PA0 */
+#define VAL_GPIO_OTHER_CRH          0x44444444      /* PA15...PA8 */
+
 #define RCC_ENR_IOP_EN      RCC_APB2ENR_IOPCEN
 #define RCC_RSTR_IOP_RST    RCC_APB2RSTR_IOPCRST
diff --git a/contrib/ackbtn-stm32f103.c b/contrib/ackbtn-stm32f103.c
index d06a5e2..0f3a448 100644
--- a/contrib/ackbtn-stm32f103.c
+++ b/contrib/ackbtn-stm32f103.c
@@ -65,6 +65,14 @@ ackbtn_init (chopstx_intr_t *intr)
       pin_config |= PINCFG_EDGE_RISING;
       break;

+    case BOARD_ID_OLIMEX_STM32_H103:
+      afio_exticr_index = 0;
+      afio_exticr_extiX_pY = AFIO_EXTICR1_EXTI0_PA;
+      irq_num = EXTI0_IRQ;
+      pin_config = 0x0001;
+      pin_config |= PINCFG_EDGE_RISING;
+      break;
+
     case BOARD_ID_FST_01SZ:
     default:
       /* PA3 is connected to a hall sensor DRV5032FA */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnuk-users/attachments/20191025/48a250b9/attachment.html>


More information about the Gnuk-users mailing list