DFU::isUbootDfuRunning(uint32_t msTimeout) - does not work for STM32MP1 devices with closed_device bit set in OTP

Aperta
#2 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cpp
Ambito
embedded-iot

Direzione di ricerca

Start by locating DFU::isUbootDfuRunning(uint32_t msTimeout) and inspect how it parses the DFU listing with the OTP regex. Reproduce the listing on an STM32MP1 device with the closed_device OTP bit set, then verify detection using the exposed @FlashLayout entry or another reliable DFU indicator. Confirm that detection still works for unlocked devices.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

After a long debugging session I have tracked down the cause for an issue that prevented me from flashing my STM32MP1 devices via fastboot using the STM32PRG-TOOLBOX. My devices have the OTP bit closed_device set to '1'. It seems this causes the device to restrict OTP exposure via DFU.

Routine DFU::isUbootDfuRunning(uint32_t msTimeout) checks for the regex std::regex pattern("name=(\"@OTP([^\\\"]*)\")"); to identify whether U-Boot has enabled the devices DFU after programming TF-A + FIP. However the locked devices do not expose the OTP here. For example my locked devices only expose the following:

Found DFU: [0483:df11] ver=0200, devnum=123, cfg=1, intf=0, path="1-1", alt=2, name="@PMIC/0xf4/1*8Be", serial="002300433231510331333437"
Found DFU: [0483:df11] ver=0200, devnum=123, cfg=1, intf=0, path="1-1", alt=1, name="@virtual/0xf1/1*512Be", serial="002300433231510331333437"
Found DFU: [0483:df11] ver=0200, devnum=123, cfg=1, intf=0, path="1-1", alt=0, name="@FlashLayout/0x00/1*256Ke", serial="002300433231510331333437"

As you can see, there is no OTP entry, that is only available for unlocked devices.

I suggest to change the routine to scan for something else e.g. std::regex pattern("name=(\"@FlashLayout([^\\\"]*)\")"); regex or use some entirely other means to determine whether the DFU is available.

Lingua principale
C++
Stelle
13
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.