Change in simtrace2[master]: DFU: restart bootloader when USB conf failed

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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Dec 3 15:51:54 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/simtrace2/+/16432 )

Change subject: DFU: restart bootloader when USB conf failed
......................................................................

DFU: restart bootloader when USB conf failed

when starting the DFU bootloader, but USB configuration (e.g.
enumeration) failed, the MCU restarted in the main application.
this occured after a DFU detach and were the USB host missed the
USB reset.
now after MCU reset, the bootloader is started again, since this
is what was requested to begin with.
the bootloader will always restart in the bootloader until USB
enumeration succeeded.
this boot loop can be stopped by unplugging/removing power from
the device.

Change-Id: I4062a7d8a7934af2119c169759b614dc45990651
---
M firmware/apps/dfu/main.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c
index 36f80a8..3d0cc1e 100644
--- a/firmware/apps/dfu/main.c
+++ b/firmware/apps/dfu/main.c
@@ -318,8 +318,8 @@
 		check_exec_dbg_cmd();
 #if 1
 		if (i >= MAX_USB_ITER * 3) {
-			TRACE_ERROR("Resetting board (USB could "
-				    "not be configured)\n\r");
+			TRACE_ERROR("Resetting board (USB could not be configured)\n\r");
+			g_dfu->magic = USB_DFU_MAGIC; // start the bootloader after reboot
 			USBD_Disconnect();
 			NVIC_SystemReset();
 		}

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

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I4062a7d8a7934af2119c169759b614dc45990651
Gerrit-Change-Number: 16432
Gerrit-PatchSet: 2
Gerrit-Owner: tsaitgaist <kredon at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191203/253977df/attachment.htm>


More information about the gerrit-log mailing list