Closed jonasius closed 4 months ago
Hello 👋🏼 Thanks for moving over here; just helps keep things more organised and easier to find later.
Is the update file a .hex
file?
If so, if you open it in a text editor the first few lines gives the offset.
For example
The first line sets the start of the address to 0x0800 (last 4 digits ignoring the very last 2 which are a checksum) Then the next line gives the lower half of the address as the 3rd-6th digits (0x4000 in this example).
We then merge those to know the runtime code runs at 0x08004000 in this example. If you dump the first few lines here I can open a PR to get a draft build for that address for you to test with?
Hey,
perfect. Yes, .hex
File.
Thanks for the explanation. Good to know in general! If i got it right the offset should be 0x08004C00. VSCode Plugin helps for better visual overview ;-)
:020000040800F2
:104C000050160020014D000895B10008C99A00080F
:104C100091B100083959000805C9000800000000DA
I can open a PR to get a draft build for that address for you to test with?
Would love to test it. Then I flash the runtime.hex from the draft build and backup the bootloader with the dfu-util?!
Alrighty,
Very first test version is building here (Actions tab)
So if you grab the file "S99" at the bottom of that page, inside you will have runtime and bootloader files.
Noting that we dont know if buttons are wired up the same, or if OLED is wired up the same. So if no display or buttons dont work, lmk and dont go further. Also please read all the steps and notes before going beyond.
Order of steps to do:
sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x4C00
to dump the bootloaderStart of file appearance
Now that you have the bootloader backed up; you can try flashing the bootloader file (to replace theirs) if you want to. You do NOT need to for IronOS. This is mostly provided for people who find dfu easier than the virtual flash drive. Please note, historically Sequre has set the lock bits for the start of flash. This means when you try to flash this, it will instead trigger a full flash erase (wiping all bootloaders). So you will likely need to use a SWD programmer to then flash either their bootloader or this one back onto it (with the bits now cleared, so should be safe for future).
I will repeat, please read that paragraph again before flashing the bootloader.dfu
file 🙇🏼 . I hold no warranty over this, of course I will do everything I can to help if anything goes wrong, but please understand the risk first 😁 It can be hard to solder SWD wires if this is your only soldering iron 😉 .
IF you do flash the bootloader file, plug it in while holding the bootloader button;either it will boot and you get a blank screen and nothing on USB. Then likely you hit ^. If you get no screen but USB then the OLED I2C or reset pins might be pinned out differently. Best solution here is multimeter to buzz them out. If you get a screen fantastic. Depending on what screen you get we will know if the button is mapped correctly or not 🤣
Thanks for your detailed instructions!
I was able to flash the runtime and bootloader, got an backup of the initial bootloader. Needed to restore it because at some point it would not let me into the dfu-mode. But I already had SWD connected and I was able to reflash it.
Afterwards I tried again with:
dfu-util -D bootloader.dfu
Version of the initial bootloader as shown in the Display was V12.00, MD5 of the binary with original bootloader and IronOS runtime is MD5 (backup.bin) = ca373fe47f4d3f736479e671c481fd6e
I duplicated the settings from the S60P besides the bootloader offsets. I was able to build and flash the Firmware for S99. I have some problems with entering the right PD mode. But I think we should discuss this in the IronOS repo.
Going to close this as done, and then continue discussion over in IronOS. Great to see this worked for you.
Hi there, I just got a Sequre S99, which seems to be very similar to the S60P in terms of hardware. As @Ralim mentioned in a discussion here, we need to find out the starting address for the bootloader. I have a firmware upgrade file which I can analyze.