Skip to content

Loading builds...

Changes

#128 (Mar 6, 2026, 9:31:16 AM)

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

#127 (Mar 6, 2026, 9:18:10 AM)

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

#126 (Mar 5, 2026, 10:18:46 PM)

Replace snprintf() to free 4 kb

Change-Id: Ide644648bda86d4ae77a6713d1e140a4b78ba835
lynxis at

#125 (Mar 5, 2026, 10:18:41 PM)

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

#124 (Mar 5, 2026, 10:15:20 PM)

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

Change-Id: I9705f15c41ea0df8b8486b6326264db36f797dd8
lynxis at

#123 (Mar 5, 2026, 10:14:32 PM)

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

#122 (Mar 5, 2026, 10:14:30 PM)

Replace snprintf() to free 4 kb

Change-Id: Ide644648bda86d4ae77a6713d1e140a4b78ba835
lynxis at

#121 (Mar 5, 2026, 11:55:13 AM)

WIP: dfu-download: flash the first block into 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.

TODO: Needs testing.

Change-Id: I894f3ee71587ccb287e92d7025039954991c631f
lynxis at

#120 (Mar 3, 2026, 12:30:34 PM)

Implement a blinking LED using Timer Counter 0

Sadly the LED is connected to a GPIO doesn't have useful functions.
The only other function is ETM tracing.
The GPIO can't be controlled by a Timer Counter (TC) or
Timer Counter for Control (TCC) because only certain GPIOs
are able to be controlled by it.

Use a Timer Counter to count the time in one-shot mode
and trigger the LED from the main main loop.
This has the advantage of keeping the interference to a minimum in difference
to a Timer Counter interrupt.
Additional by using the ARM core to change the LED, it can be used as heart beat,
if the LED blinks, the ARM core is still 'alive'.

There are other possibilities to trigger the LED:
- use a TC to trigger the Event System, which toggles the GPIO.
- use a TC to trigger the DMA engine, which transfer 1 byte toggles the GPIO.

Change-Id: I8144120d07f73356855d084016edcb77d202da7f
lynxis at

#119 (Mar 3, 2026, 12:29:48 PM)

Implement a blinking LED using Timer Counter 0

Sadly the LED is connected to a GPIO doesn't have useful functions.
The only other function is ETM tracing.
The GPIO can't be controlled by a Timer Counter (TC) or
Timer Counter for Control (TCC) because only certain GPIOs
are able to be controlled by it.

Use a Timer Counter to count the time in one-shot mode
and trigger the LED from the main main loop.
This has the advantage of keeping the interference to a minimum in difference
to a Timer Counter interrupt.
Additional by using the ARM core to change the LED, it can be used as heart beat,
if the LED blinks, the ARM core is still 'alive'.

There are other possibilities to trigger the LED:
- use a TC to trigger the Event System, which toggles the GPIO.
- use a TC to trigger the DMA engine, which transfer 1 byte toggles the GPIO.

Change-Id: I8144120d07f73356855d084016edcb77d202da7f
lynxis at

#118 (Mar 3, 2026, 12:04:23 PM)

Implement a blinking LED using Timer Counter 0

Sadly the LED is connected to a GPIO doesn't have useful functions.
The only other function is ETM tracing.
The GPIO can't be controlled by a Timer Counter (TC) or
Timer Counter for Control (TCC) because only certain GPIOs
are able to be controlled by it.

Use a Timer Counter to count the time in one-shot mode
and trigger the LED from the main main loop.
This has the advantage of keeping the interference to a minimum in difference
to a Timer Counter interrupt.
Additional by using the ARM core to change the LED, it can be used as heart beat,
if the LED blinks, the ARM core is still 'alive'.

There are other possibilities to trigger the LED:
- use a TC to trigger the Event System, which toggles the GPIO.
- use a TC to trigger the DMA engine, which transfer 1 byte toggles the GPIO.

Change-Id: I8144120d07f73356855d084016edcb77d202da7f
lynxis at

#117 (Feb 24, 2026, 8:41:24 PM)

dfu: make dfu_state/dfu_status volatile

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

Change-Id: I7ad5255064917c203cebe5ab54a5d457baa2f5ed
lynxis at

#116 (Feb 24, 2026, 8:41:24 PM)

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

#115 (Feb 24, 2026, 8:41:24 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

#114 (Feb 24, 2026, 8:41:24 PM)

dfu: usb_dfu() convert if() intos switch/case

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

Change-Id: Ie0abcdb51612598e77cacf7772276919ded17d5a
lynxis at

#113 (Feb 24, 2026, 8:41:24 PM)

dfu: rewrite firmware downloading

Improve handling of dfu_state by moving more state changing towards the
IRQ handler. Having both the main loop and IRQ changes dfu_state within
the same state could lead to races.

The main loop is now only a simple worker which reports back via dfu_flash_done &
dfu_flash_status.

Change-Id: I345d5948455b25cd8a2efb1abfd9d0986ebd8cef
lynxis at

#112 (Feb 24, 2026, 8:41:24 PM)

dfu: irq: replace if(states) with a switch case

Improves the overview. No functional change.

Change-Id: Ic32fe16dff4b7bb933ec62e36a9c7c7829aece1b
lynxis at

#111 (Feb 24, 2026, 8:41:24 PM)

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

#110 (Feb 24, 2026, 2:40:55 PM)

dfu: usb_dfu() convert if() intos switch/case

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

Change-Id: Ie0abcdb51612598e77cacf7772276919ded17d5a
lynxis at

#109 (Feb 24, 2026, 2:40:55 PM)

dfu: irq: GET_STATUS: set state before sending it

The DFU spec, v1.1: "6.1.2 DFU_GETSTATUS Request" states the
GET_STATUS should contain the state,
to which the device transistions to after processing this message.

Change-Id: I6d28404d6936f7ea79fcee90f0c8191f0f623ad8
lynxis at

#108 (Feb 24, 2026, 2:40:55 PM)

dfu: irq: replace if(states) with a switch case

Improves the overview. No functional change.

Change-Id: Ic32fe16dff4b7bb933ec62e36a9c7c7829aece1b
lynxis at

#107 (Feb 24, 2026, 2:40:54 PM)

dfu: rewrite firmware downloading

Improve handling of dfu_state by moving more state changing towards the
IRQ handler. Having both the main loop and IRQ changes dfu_state within
the same state could lead to races.

The main loop is now only a simple worker which reports back via dfu_flash_done &
dfu_flash_status.

Change-Id: I345d5948455b25cd8a2efb1abfd9d0986ebd8cef
lynxis at

#106 (Feb 24, 2026, 2:40:54 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

#105 (Feb 24, 2026, 2:40:54 PM)

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

#104 (Feb 24, 2026, 2:40:53 PM)

dfu: make dfu_state/dfu_status volatile

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

Change-Id: I7ad5255064917c203cebe5ab54a5d457baa2f5ed
lynxis at

#103 (Feb 24, 2026, 2:40:53 PM)

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

#102 (Feb 23, 2026, 11:35:26 AM)

dfu: do not reset itself

In theory USB_DFU_ATTRIBUTES_WILL_DETACH is nice, in practice
not so much, because usb uses control transfers and "waiting" for
status response completion after finishing flashing is cumbersome.
There is basically no advantage if the device resets itself, and
just waiting for the host to do it like most DFU devices work
(and what the BL used to do in the beginning) works
around the status issue.

Change-Id: I1b9e48470083597640918a8a1126922b31150153
ewild at

#101 (Feb 23, 2026, 10:02:29 AM)

dfu: fix bState transition/reporting order as per dfu spec

DFU spec wants the next state, not the current one.

Change-Id: I06519c73cdb0b082002632da9cfe7436c63f52b0
ewild at

#100 (Feb 23, 2026, 10:02:28 AM)

dfu: make resp buffer static

USB dma uses a buffer depending on alignment, so this can be safe,
but it should not be depend on reading and knowing the asf source code...

Change-Id: I2f9336143190350817e6352b00751b35b1600b62
ewild at

#99 (Feb 23, 2026, 10:02:28 AM)

dfu: do not reset itself

In theory USB_DFU_ATTRIBUTES_WILL_DETACH is nice, in practice
not so much, because usb uses control transfers and "waiting" for
status response completion after finishing flashing is cumbersome.
There is basically no advantage if the device resets itself, and
just waiting for the host to do it like most DFU devices work
(and what the BL used to do in the beginning) works
around the status issue.

Change-Id: I1b9e48470083597640918a8a1126922b31150153
ewild at

#98 (Feb 22, 2026, 8:44:41 PM)

dfu: usb_dfu() convert if() intos switch/case

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

Change-Id: Ie0abcdb51612598e77cacf7772276919ded17d5a
lynxis at

#97 (Feb 22, 2026, 8:44:40 PM)

dfu: irq: replace if(states) with a switch case

Improves the overview. No functional change.

Change-Id: Ic32fe16dff4b7bb933ec62e36a9c7c7829aece1b
lynxis at

#96 (Feb 22, 2026, 8:44:40 PM)

dfu: irq: GET_STATUS: set state before sending it

The DFU spec, v1.1: "6.1.2 DFU_GETSTATUS Request" states the
GET_STATUS should contain the state,
to which the device transistions to after processing this message.

Change-Id: I6d28404d6936f7ea79fcee90f0c8191f0f623ad8
lynxis at

#95 (Feb 22, 2026, 8:44:40 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

#94 (Feb 22, 2026, 8:44:40 PM)

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

#93 (Feb 22, 2026, 8:44:40 PM)

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

#92 (Feb 22, 2026, 8:44:39 PM)

dfu: rewrite firmware downloading

Improve handling of dfu_state by moving more state changing towards the
IRQ handler. Having both the main loop and IRQ changes dfu_state within
the same state could lead to races.

The main loop is now only a simple worker which reports back via dfu_flash_done &
dfu_flash_status.

Change-Id: I345d5948455b25cd8a2efb1abfd9d0986ebd8cef
lynxis at

#91 (Feb 22, 2026, 8:44:39 PM)

dfu: MANIFEST: mainloop: wait 5 ms before handling the state

Gives the USB stack some time to deliver the last USB message before
going through the state machine which might end in a too quick system reset.

Change-Id: If9178120eed46f75089abf1898db3176cce93df2
lynxis at

#90 (Feb 22, 2026, 8:36:03 PM)

dfu: MANIFEST: mainloop: wait 5 ms before handling the state

Gives the USB stack some time to deliver the last USB message before
going through the state machine which might end in a too quick system reset.

Change-Id: If9178120eed46f75089abf1898db3176cce93df2
lynxis at

#89 (Feb 22, 2026, 8:36:02 PM)

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

#88 (Feb 22, 2026, 8:36:02 PM)

Improve comments on errata 2.6.10

Errata 2.6.10 affects Rev A, D, F: The cache lines
of AHB0 and AHB1 might not reset properly on Power up
resulting in courrupted data in rare cases.

The errata recommends fixing this by:
- for AHB0: WDT enable & disable
- for AHB1: disable and re-enable cache line

Change-Id: I3c35f590a4e43d778e70f2f377e0d470c3a652b2
lynxis at

#87 (Feb 22, 2026, 8:36:01 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

#86 (Feb 22, 2026, 8:36:01 PM)

dfu: usb_dfu() convert if() intos switch/case

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

Change-Id: Ie0abcdb51612598e77cacf7772276919ded17d5a
lynxis at

#85 (Feb 22, 2026, 8:36:01 PM)

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

#84 (Feb 22, 2026, 8:36:00 PM)

dfu: make dfu_state/dfu_status volatile

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

Change-Id: I7ad5255064917c203cebe5ab54a5d457baa2f5ed
lynxis at

#83 (Feb 22, 2026, 8:36:00 PM)

dfu: irq: replace if(states) with a switch case

Improves the overview. No functional change.

Change-Id: Ic32fe16dff4b7bb933ec62e36a9c7c7829aece1b
lynxis at

#82 (Feb 22, 2026, 8:36:00 PM)

dfu: irq: GET_STATUS: set state before sending it

The DFU spec, v1.1: "6.1.2 DFU_GETSTATUS Request" states the
GET_STATUS should contain the state,
to which the device transistions to after processing this message.

Change-Id: I6d28404d6936f7ea79fcee90f0c8191f0f623ad8
lynxis at

#81 (Feb 22, 2026, 8:35:59 PM)

dfu: rewrite firmware downloading

Improve handling of dfu_state by moving more state changing towards the
IRQ handler. Having both the main loop and IRQ changes dfu_state within
the same state could lead to races.

The main loop is now only a simple worker which reports back via dfu_flash_done &
dfu_flash_status.

Change-Id: I345d5948455b25cd8a2efb1abfd9d0986ebd8cef
lynxis at