Skip to content

Commit a4d1906

Browse files
committed
Fix invalid PEP 440 version string from nRF51 bootloader dirty bit
When the nRF51 bootloader reports a dirty build (bit 0x80 set in the version data), cflib constructed a version string ending in bare "+", e.g. "2024.1.0+". This is invalid PEP 440 and causes packaging.version.Version() to raise an error during flashing. This likely started failing when the packaging library tightened its PEP 440 validation in a newer release. Reproducible with any Crazyflie running custom-built nRF51 firmware (which sets the dirty bit). Fix changes the suffix from "+" to "+dirty" which is valid PEP 440. Tested by flashing a Crazyflie with dirty nRF51 bootloader firmware.
1 parent e780010 commit a4d1906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cflib/bootloader/cloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _update_info(self, target_id):
204204
if len(answer.data) > 23 and len(answer.data) > 26:
205205
code_state = ''
206206
if answer.data[24] & 0x80 != 0:
207-
code_state = '+'
207+
code_state = '+dirty'
208208
answer.data[24] &= 0x7F
209209
major = struct.unpack('H', answer.data[23:25])[0]
210210
minor = answer.data[25]

0 commit comments

Comments
 (0)