Change in simtrace2[master]: add DFU enter override capability

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

tsaitgaist gerrit-no-reply at lists.osmocom.org
Mon Nov 18 21:36:08 UTC 2019


tsaitgaist has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/16096 )


Change subject: add DFU enter override capability
......................................................................

add DFU enter override capability

in case flashing the main application firmware using DFU failed,
the main application might be broken and not allow to switch again
to DFU mode to re-flash it correctly.
the other board have a way to force entering (e.g. staying in) the
bootloader using an external signal (e.g. a switch on the SIMtrace
board).
the OWHW DFU firmware did not have this functionality implemented.
the design (e.g. schematic) already has the SIMTRACE_BOOTLOADER
signal (on PA31) for this purpose.
now the DFU bootloader will start the DFU mode when the
SIMTRACE_BOOTLOADER is high.

this change has been tested on OWHWv2.

Change-Id: Iefff51a811ad0f3bf3a46b8e256b905d11344bea
---
M firmware/libboard/owhw/include/board.h
M firmware/libboard/owhw/source/owhw.c
2 files changed, 17 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/96/16096/1

diff --git a/firmware/libboard/owhw/include/board.h b/firmware/libboard/owhw/include/board.h
index 44472d0..f929771 100644
--- a/firmware/libboard/owhw/include/board.h
+++ b/firmware/libboard/owhw/include/board.h
@@ -46,6 +46,9 @@
 /** index for green LED in LEDs pin definition array */
 #define LED_NUM_GREEN   1
 
+/* pin connected to the SIMTRACE_BOOTLOADER signal. set high to force DFU bootloader start */
+#define PIN_BOOTLOADER		{PIO_PA31, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
+
 /* USIM 2 interface (USART) */
 #define PIN_USIM2_CLK		{PIO_PA2, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
 #define PIN_USIM2_IO		{PIO_PA6, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
diff --git a/firmware/libboard/owhw/source/owhw.c b/firmware/libboard/owhw/source/owhw.c
index 3bf51ec..516d592 100644
--- a/firmware/libboard/owhw/source/owhw.c
+++ b/firmware/libboard/owhw/source/owhw.c
@@ -1,7 +1,7 @@
 /* Card simulator specific functions
  *
  * (C) 2015-2017 by Harald Welte <hwelte at hmw-consulting.de>
- * (C) 2018, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon <kredon at sysmocom.de>
+ * (C) 2018-2019, sysmocom -s.f.m.c. GmbH, Author: Kevin Redon <kredon at sysmocom.de>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -65,3 +65,16 @@
 {
 	PIO_Configure(pins_cardsim, ARRAY_SIZE(pins_cardsim));
 }
+
+int board_override_enter_dfu(void)
+{
+	const Pin bl_pin = PIN_BOOTLOADER;
+
+	PIO_Configure(&bl_pin, 1);
+
+	if (PIO_Get(&bl_pin) == 0) { // signal low
+		return 0; // do not override enter DFU
+	} else {
+		return 1; // override enter DFU
+	}
+}

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/16096
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Iefff51a811ad0f3bf3a46b8e256b905d11344bea
Gerrit-Change-Number: 16096
Gerrit-PatchSet: 1
Gerrit-Owner: tsaitgaist <kredon at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191118/d4830f24/attachment.htm>


More information about the gerrit-log mailing list