Am Sonntag, 28. Oktober 2018 schrieb Dr. Nikolaus Klepp:
> Hi all!
>
> Today I tried to get bluetooth working on the PRiW0, which led me down a different rabbithole in the lands of "devuan vs. raspbian". First the findings:
>
> Devuan:
> - /dev/ttyACM0 appears always, either accessable on GPIO14/15 or via something unknown (should be bt).
> - /dev/ttyS0 apperars only, when the "pi3-miniuart-bt" overlay is loaded. ttyS0 is then on gpio14/15, ttyACM0 is visible but connected to someting unknown (should be bt).
> - Whatever device shoud be connected to bt, it is not: htcattach always times out.
> - "enable_uart=1" crashes the bootloader (not the kernel - that is not even loaded at that point). In fact, anything "enable=XXX" crashes the bootloder.
>
> Raspbian:
> - both devices work as documented by the raspbianpi foundation either on gpio14/15 or bt.
> - hciattach initializes bluetooth.
> - "enable_uart=1" prevents the diappearance of "/dev/ttyS0" (which is renamed to serial0 by systemd)
>
> Both systems run the same kernel, the same firmware (updated with "rpi-update" and firmware tree copied over from raspbien).
>
> The only differences in the system layout (apart from systemd vs. sysv) I found were these:
> - Raspbian has an extra file /boot/LICENSE.oracle
> - Raspbian FAT partition starts at block 8192, while Devuan starts at 2048. But only the first block is used, all other are zero.
>
> Running out of ideas I copied all files from the devuan root partition over to the raspbian root partition and booted the system. Guess what: The boot process without systemd is 10 seconds faster AND bluetooth is working!
>
> But this fishy: all binary files in /boot are identical (devuan/rasbian), so the bootloader and kernel sould have shown the same behaviour, i.e. either crash or work on both systems when "enable_uart=1". And ttyS0 and ttyAMA0 sould behave identical, but they don't. Why? Where's the difference that matters?
>
> And the more pressing question: As now devuan is installed over the cops of raspbian, who can I figure out what files are used on startup? The bluetooth init probram is definitly a resurrected part of raspbian, but what else?
>
>
> Nik
>
>
>
>
Forget the last questions ... I just deleted the canibalized root and transpanted my devuan rootfs (2. partion on image). Guss what? It boots, "enable_uart=1" works, I have now ttyS0 on gpio14/15 and ttyAMA0 on bluetooth without any overlay.
So it comes down to this: on the RPiW0, the first partitio absolutely must start at 8192, or bluetooth won't work. My Layout is now is this:
/dev/mmcblk0p1 8192 97889 89698 43.8M c W95 FAT32 (LBA)
/dev/mmcblk0p2 98304 3872767 3774464 1.8G 83 Linux
I'm quite sure that the first partition must be exact that size and type. Most likely that is also true for RPi3+ (and that's why I did not get the devuan image running).
I think it would be a good idea to create a devuan image for rpi0 with exactly these changes :-)
Nik
--
Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...