Skip to content

Loading builds...

Changes

#2647 (Mar 12, 2026, 8:15:08 PM)

dfu: MANIFEST_SYNC: stay in MANIFEST_SYNC when manifestationIntolerant & completed

In theory a device which is manifestintolerant and completed the manifestation should
not reach MANIFEST_SYNC again.

Remove the state transistion to WAIT-RESET and stay in the current state and
wait for the main loop to change the state is safer.

Change-Id: I8c34a18e2336731126a8c01070d86e2547578e3d
lynxis at
dfu: protect USB_DFU_STATE_DFU_MANIFEST by a critical section

In the MANIFEST state, the IRQ won't move the state, but
to prevent incosistency between dfu_manifestation_complete &
dfu_state, use a critical section.

Change-Id: Idf5fb7d55b4051ba7e235dfa409a4de18a8f208c
lynxis at
Replace snprintf() to free 4 kb

Change-Id: Ide644648bda86d4ae77a6713d1e140a4b78ba835
lynxis at
dfu: download: flash the first block in manifest phase

To prevent half flashed applications, erase the first page
when dfu downloading starts and save the first block for later.
In manifest stage, flash the first block.
If the first 4 byte are 0xffffffff, the board won't boot
into application and go into the dfu bootloader.

Change-Id: I894f3ee71587ccb287e92d7025039954991c631f
lynxis at
dfu: flash: protect parsing of rc of flashing

Otherwise it is not guaranteed that both dfu_status and dfu_state
are in sync when the IRQ handler is running.

Change-Id: Ifc0d56d779ec31382855d6c367478104bc04e1e7
lynxis at
dfu: download: make variables between IRQ and main loop volatile

Both are access by IRQ and mainloop and are written by the IRQ handler.

Change-Id: Ic3dccd77eff7feb164f9f07047680eef3f7c2516
lynxis at
dfu: download: align download data buffer

The download data buffer is given to the usb stack.
Ensure the data buffer is dma capable to prevent an
additional memcpy() by the usb hal.

Change-Id: I01191a125aa62c2198e38d5e5fcd27d4e421c62e
lynxis at

#2644 (Mar 10, 2026, 10:05:07 AM)

Makefile: on clean: remove dfu & flash .o & .d files

Change-Id: I9705f15c41ea0df8b8486b6326264db36f797dd8
laforge at

#2643 (Mar 10, 2026, 9:45:07 AM)

dfu: make dfu_state/dfu_status volatile

Both variable might be changed from IRQ and from main loop.

Change-Id: I7ad5255064917c203cebe5ab54a5d457baa2f5ed
lynxis at
dfu: mainloop: work on a local copy of dfu_state

Prevent race conditions between main loop and irq.
Copy at the start of the loop the dfu state and work on it.

Change-Id: Ic146c8fa5ba25425cf785bae66f9c99b0faab944
lynxis at
dfu: irq: replace if(states) with a switch case

Improves the overview. No functional change.

Change-Id: Ic32fe16dff4b7bb933ec62e36a9c7c7829aece1b
lynxis at
dfu: usb_dfu() convert if() intos switch/case

Improves the overview of the handled states.
No functional change.

Change-Id: Ie0abcdb51612598e77cacf7772276919ded17d5a
lynxis at