[Samsung Gear S] biktor_gj:
A word about the Bootloops

Okay, there seems to be a lot of people falling into the bootloops when coming back to Tizen, so I thought I would try to explain, again, what causes it, and how I got out of them every time.

The reason for the bootloops

The reasons for falling into the bootloop is a combination of some factors:

1. The bootloader in this watch is poorly coded The bootloader resets the power key status on each reboot, unlike most of other ODIN based bootloaders, so when the watch reboots, the key gets released and then reattached.

2. The kernel panic reboot time is set to 0 on stock kernel. The kernel is configured in a way when there's a critical error (a kernel panic), it automatically reboots without spending the DEFAULT 5 second delay before rebooting

3. When moving from Android to Tizen, or from Tizen to Android, the init binary is moved from one partition to another The way I'm building this ROM, moves /sbin/init from the 25th partition (/dev/mmcblk0p25 -rootfs- ) to the 19th partition (/dev/block/mmcblk0p19 -boot-). The thing is, if you, for example, mix and run the stock tizen kernel with the Android Root FS, it will look for the init binary in partition #25 instead of #19. As it won't find it there, it will panic and reboot endlessly. That means that if Odin fails after flashing the Tizen Kernel, but *before* the rootfs, you might end up in a boot loop.

Ways I've fallen into the bootloop

When modifying boot images and not setting correct permissions and/or making mistakes in permissions in boot files. If you're playing with the boot image for Android, and you set the wrong permissions to /init or /sbin/init, or you make a big mistake inside the init.*.rc, the kernel will panic just after mounting the boot partition, forcing a reboot.

When corrupting the rootfs partition in Tizen: If you took a backup of it and it wasn't in good condition, after you restore it if the Kernel cannot correctly mount it, it will panic and reboot all the time. Since the kernel needs about 2 seconds before mounting the partition, it will panic before you have your 5 seconds to force the hard-reboot

When flash process failed at the wrong time. You're there, reflashing Tizen, and the dock misbehaves and drops the USB connection, or your PC halts, or the watch reboots (all of them happened to me at some point). The flash process fails when it's in the middle of flashing the rootfs but the Gear's bootloader doesn't notice it. The rootfs partition gets corrupt, but when you reboot the watch, instead of automatically entering download mode and showing a screen saying "There was an error, connect to Kies to recover" the watch bootloops when trying to mount the root partition.

When flashing the wrong kernel It's possible that some kernels from some firmware don't contain the needed DTB board definition for the revision of your watch. Happened to me with some older firmwares.

HOW I GOT OUT OF THEM

So, you're stuck. You're pretty much f***d up, aren't you? Let's try some things.

1. Check if you're really f****d.

Let the battery drain, so the watch will shut down completely, and let it cool down. Depending on the battery you had it might get quite warm.

Got it? Good. Clean both the dock's pogoplugs (the connector), and the charging contacts on your Gear S.

If you have a backup battery equiped dock, have it with some charge, if you don't, have a wall charger available.

YOU HAVE A BATTERY BACKED DOCK:

Connect it to the watch, without connecting the dock itself to anything. If you see the battery logo, you're good.

YOU HAVE A DUMMY DOCK:

Connect the dock to the wall adapter, then connect it to the watch. If you see the battery logo, you're good.

*IF IN ANY CASE YOU CONNECT IT TO A USB PORT ON A COMPUTER, THIS WON'T WORK* The watch will detect it's connected to a computer and will start in a different boot mode.

*IF, WITH THE BATTERY BACKED DOCK, IT GOES STRAIGHT TO THE GEAR S LOGO, I DON'T HAVE A CLUE ON WHAT YOU CAN DO, NEVER GOT INTO THAT*

Let's say it's not as f****d up as to not show the battery logo, proceed to step 2.

1. Measure the time it takes, between the moment you connect the dock/charger and the moment the screen turns on to show the battery logo. Once you have it:

2. Disconnect it and let it shut down again.

3. Connect again, and start pressing the power button JUST BEFORE THE SCREEN TURNS ON. Timing is key, and IT IS HARD TO FIND. As I said numerous time, the first time I got it, I spent about four hours trying to get it right. I finally found the exact time, but I can't measure it in miliseconds. You will need a lot of patiente. Once you've been there once, if it happens again you will get out of it faster.

WAYS WE CAN HELP AVOID THE SITUATION.

My Android images are safe. No Android firmware I've posted should leave you in a bootloop. But, depending on your bootloader, and your model, my Tizen Restore Firmware can cause you issues while flashing which might end up in a boot loop.

1. Know your device

. My Tizen Restore Firmware is based off R750XXU1BOA7. This means it's designed for SM-R750 / SM-R750Z. *THIS IS THE ONLY DEVICE I HAVE TESTED WITH, WHICH IS MY OWN*. A lot of other people has restored their watches with this same firmware, but obviously, there's a bunch of people who's having issues with it.

2. Backup your system-data partition

You can use others' backup, but keep in mind you're exposing your data with it. Also keep in mind that your system-data partition is tied to the Tizen release you were running at the point of backup, so it might get messy when you restore another firmware on top of it.

3. Have a known full flash that you know works for your watch

. I only provided my Tizen restore package as an emergency in the early days. People shouldn't flash it blindly. You should have a good full firmware package which you *have already flashed* before even trying to flash Android, so you know you have a good set to come back.

4. Clean the USB/Charging contacts before you begin, on both the watch and the dock

. This is a watch, and has constant contact with your skin. It gets dirty. Before you do something sensible as wiping the NAND and flashing something over it, do your best to ensure that the connection to the computer will be stable while it's in this process. Numerous times Odin has failed on me because of this.

5. If you find this hard to handle, you shouldn't be doing it!

This watch wasn't correctly made. You need to know what you're doing and in case you have problems you will need to have the necessary knowledge to fix it. This is not your average flashing, this is not a Nexus phone. This is a buggy watch made for a different OS, and might present different issues than those you may have found playing with other watches/phones.

WE CAN MAKE TIZEN RESTORE FIRMWARE VARIANTS TO HELP OTHERS, BUT I NEED YOUR HELP.

I can make recovery firmwares for the different watch variants, but I will need you to provide me with:

* Your Watch Model

* A backup of your system-data partition (better if it's a clean backup, with the watch unpaired and the least amount of settings configured)

* A Full firmware that you know runs on your device: You can know if it's a full flash if you open the TAR package and it has at least, some of the following files:

- dzImage

- aboot.mbn

- modem.bin

- rpm.mbn

- tz.mbn

- rootfs.img

You can post them in this thread and I will do my best to package them and post them in the first post.

I WON'T ANSWER PRIVATE MESSAGES REGARDING THIS ISSUE. If you want to PM me for helping me on development related stuff, feel free to do it. If you want to thank me, it's okay. If you're going to ask me for help because you didn't read the warnings, the instructions, or didn't do your job I won't reply. You have the Q&A section for Q&A related questions, and I have explained this quite some times already. I won't tell this everytime someone f*cks up. I simply don't have time to do that, and the little time I have I'd rather use it on actually working with the watch to make it run Android better.