Updates via DFU #1

Open
opened 2024-10-03 16:14:48 +02:00 by sebastian · 1 comment
Owner

Aim: Trigger a reset into the dfu bootloader inside the system memory and upload an new firmware image.

Notes:

Aim: Trigger a reset into the dfu bootloader inside the system memory and upload an new firmware image. Notes: - [cargo-dfu flash_bin()](https://github.com/dfu-rs/cargo-dfu/blob/main/src/utils.rs#L60) - [dfu_core DfuSync::download_from_slice](https://docs.rs/dfu-core/latest/dfu_core/sync/struct.DfuSync.html#method.download_from_slice) - Jump into the system memory bootloader: https://forgejo.zenerdio.de/sebastian/stm32f4-jump-dfu
Author
Owner

Serialnumber generation:
https://community.st.com/t5/stm32-mcus-products/usb-bootloader-serial-number/td-p/432148

In Rust:

        let serial = unsafe {
            let u_id0 = 0x1FFF_7A10 as *const u32;
            let u_id2 = 0x1FFF_7A18 as *const u32;

            defmt::debug!("UID0: {:x}", u_id0.read());
            defmt::debug!("UID2: {:x}", u_id2.read());

            // See https://community.st.com/t5/stm32-mcus-products/usb-bootloader-serial-number/td-p/432148
            (u_id0.read() as u64 + u_id2.read() as u64) << 16
                | (u_id2.read() as u64 & 0xFF00) >> 8
                | (u_id2.read() as u64 & 0x00FF) << 8
        };
Serialnumber generation: https://community.st.com/t5/stm32-mcus-products/usb-bootloader-serial-number/td-p/432148 In Rust: ```rust let serial = unsafe { let u_id0 = 0x1FFF_7A10 as *const u32; let u_id2 = 0x1FFF_7A18 as *const u32; defmt::debug!("UID0: {:x}", u_id0.read()); defmt::debug!("UID2: {:x}", u_id2.read()); // See https://community.st.com/t5/stm32-mcus-products/usb-bootloader-serial-number/td-p/432148 (u_id0.read() as u64 + u_id2.read() as u64) << 16 | (u_id2.read() as u64 & 0xFF00) >> 8 | (u_id2.read() as u64 & 0x00FF) << 8 }; ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AFG/radomctld#1
No description provided.