Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsistent DFU #79

Closed
rusefillc opened this issue Jul 11, 2021 · 22 comments
Closed

inconsistent DFU #79

rusefillc opened this issue Jul 11, 2021 · 22 comments

Comments

@rusefillc
Copy link
Collaborator

We have reports of two or three kinds of Hellen boards failing to reboot into DFU via "reboot_dfu" command

Same reboot to DFU procedure could be initiated by rusEFI console using "Program" button while "Automatic DFU" is selected

This issue is NOT about "reset" or "PROD" button, the scope of this issue is ONLY software-based reboot to DFU

Steps to reproduce:

  1. have a Hellen board with 407 chip
  2. have Hellen board with 407 blink blue LED
  3. connect via USB
  4. hit "automatic DFU" in rusEFI console

expected result: DFU process starts

actual result: board reboots into normal operation

@BeerMoneyMotorsports
Copy link

BeerMoneyMotorsports commented Jul 11, 2021

Auto DFU tests USB power only.
-3 boards selected with different chips and build dates. Each board was power cycled and tested 5 times for Automatic DFU functionality.

H72c w/F429- Pass-5 Fail- 0
H64a w/F407- Pass-0 Fail- 5
H64b w/f407- Pass-1 Fail- 4

image

@BeerMoneyMotorsports
Copy link

H72c
44E61158-3E2E-489E-A862-68E442BA196B

H64a
804E2C99-916D-4B13-805A-3563D00B196A

H64b
5E097665-61C8-412F-9E22-09F75DF5B98F

@rusefillc
Copy link
Collaborator Author

IMG_20210711_185521

not hellen with old 407 SW dfu jump works!

that's inconclusive

i also have 2nd 176 407 from same pack of samples

that opens many possibilities but i would compare designs arounds caps etc before we go swapping parts

maybe up some caps?

@dron0gus

@mck1117
Copy link

mck1117 commented Jul 12, 2021

With the PROG button held (ie, MCU always enters system ROM at reset), the reset line is triggering every exactly 1 second, so something is triggering a hardware reset after ~1 second

Reset is low, not reset is high:

SDS00044

The large period at the left is me pressing the physical reset button, then the ~1 second spaced blips are the MCU resetting itself (internal resets are implemented on the STM32 by physically pulling the nRST pin low internally with a transistor).

@mck1117
Copy link

mck1117 commented Jul 12, 2021

image

@mck1117
Copy link

mck1117 commented Jul 12, 2021

When attaching a debugger to a completely blank chip when boot looping the bootloader, it says the software reset bit is set in RCC register CSR.

image

@mck1117
Copy link

mck1117 commented Jul 12, 2021

Here are an old MRE (f407), f4 disco, and hellen probed at the OSCOUT (PH1) pin:

hellen:

SDS00046

microRusEfi:

SDS00045

F4 discovery:

SDS00047

@rusefillc
Copy link
Collaborator Author

OMG

Image from iOS (4)

@rusefillc
Copy link
Collaborator Author

I replaced $0.2 part with a "crystal and caps" that is guaranteed to oscillate well within the allotted time (edited) 
the bootloader waits 800us for the clock to start
if the clock doesn't start in 800us, it triggers a system reset
our clock is locking in ~900us or so

@mck1117
Copy link

mck1117 commented Jul 12, 2021

The above photo is injecting an 8mhz sine wave in to the OSC_IN pin - so that we can guarantee the "crystal" will have locked

@mck1117
Copy link

mck1117 commented Jul 12, 2021

Evidently the F42x bootloader waits longer, because on a random proteus board it takes even longer, but the bootloader still works perfectly

@mck1117
Copy link

mck1117 commented Jul 12, 2021

With the F407 discovery's oscillator transplanted on to the hellen121a PCB:

image

SDS00049

...and of course DFU works perfectly, both with the button and software reset.

@andreika-git
Copy link
Owner

andreika-git commented Jul 12, 2021

There are some JLC drop-in alternatives to consider:

  • C122522 (2989 in stock)
  • C172361 (2468 in stock)
  • C111120 (2086 in stock)
  • C90881 (927 in stock)

@andreika-git
Copy link
Owner

@mck1117
Copy link

mck1117 commented Jul 12, 2021

This will add support for alternate crystal speeds without different firmware: rusefi/rusefi#2952

@rusefillc
Copy link
Collaborator Author

Also there are some JLC drop-in alternatives to consider:
C122522
C172361
C111120
C90881

You may also try fitting 3225-2pin package on 5032 footprint

NX3225GD-8MHZ-STD-CRA-3

higher freq crystals require less drive and are physically smaller, so should be able to start faster

@rusefillc
Copy link
Collaborator Author

520-200-12-30-AEM-TR

@rusefillc
Copy link
Collaborator Author

Maybe this is linked to the embedded bootloader version:

V3 on STM32F407 and STM32F401
V7 on STM32F427
V9 on STM32F446

Check AN2606 for details

https://www.st.com/resource/en/application_note/cd00167594-stm32-microcontroller-system-memory-boot-mode-stmicroelectronics.pdf

@rusefillc
Copy link
Collaborator Author

digikey stuff in stock

H130A-8.000-8-2030-TR‎ 8 MHz
‎2845-WTL5G60390VH-ND‎ 8 MHz
535-9105-1-ND (20 MHz ESR 30 Ohm)
CTX1436CT-ND (16 MHz, ESR 40 Ohm)
644-1037-1-ND (16 MHz, ESR 120 Ohm)

@mck1117
Copy link

mck1117 commented Jul 12, 2021

Ordered a stack of 16 and 20MHz options from digikey, will test soon on 121vw

@rusefillc
Copy link
Collaborator Author

@BeerMoneyMotorsports please order qty 20 of

ABM3-20.000MHZ-B2-T 535-9105-1-ND 20 MHz ESR 30 Ohm

I believe that we have major improvement in Hellen72 rev D behavior

@rusefillc
Copy link
Collaborator Author

@mck1117 says that 20MHz crystal ABM3-20.000MHZ-B2-T starts in ~250us

looks like minimal fix for Hellen MCU is to jump from 8MHz to 20MHz and move on?

@andreika-git @mck1117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants