bishopdynamics / superbird-tool Goto Github PK
View Code? Open in Web Editor NEWCross-Platform Spotify Car Thing (superbird) hacking toolkit
Cross-Platform Spotify Car Thing (superbird) hacking toolkit
when trying to do anything except entering burn mode and finding device, i get "bulkcmd timed out!"
here is the output:
PS C:\Users\****\******\superbird-tool-main> python superbird_tool.py --boot_adb_kernel a
Spotify Car Thing (superbird) toolkit, v0.0.8, by bishopdynamics
https://github.com/bishopdynamics/superbird-tool
Found device booted in USB Burn Mode (ready for commands)
Booting adb kernel on slot a
Booting images/env_a.txt, images/superbird.kernel.img, images/superbird.initrd.img
initializing env subsystem
executing bulkcmd: "amlmmc env"
Error: bulkcmd timed out!
This can happen if the device ends up in a strange state, like as the result of a previously failed command
Try power cycling the device by pulling the cable, and then boot up and try again
You might need to do this multiple times
If the device is connected through a USB hub, try connecting it directly to a port on your machine
Is there a recommended driver for the "GX-Chip" device that shows up in device manager? I found a few links on google for amlogic drivers however they all appear to be from sketchy sites and include executables.
After going through the code, and the dump/restore/ADB process a handful of times, I've gathered a few ideas on optimising the processes:
While it is great to have full partition dumps, due to the speed limit imposed by the lack of mread
in pyamlboot, it's not the best way forward to dump both A/B partitions and userdata as well.
My proposal to fix this is to make the dumping logic a bit smarter:
env
and parsing it to TXTenv
This altogether would reduce dump sizes by:
Making the dumping process from 4GB to ~863MB, while also reducing the dumping time from nearly two hours (or in my case, since on macOS the maximum bandwidth seems to be around 94kBps, from around 12 hours!) to around 30 minutes (or, in my case, "only" 3 hours).
Therefore, a future dump would look like this:
firmware_dump/
├─ boot.dump
├─ bootloader.dump
├─ dtbo.dump
├─ env.dump (and/or env.txt)
├─ fip.dump
├─ logo.dump
├─ misc.dump
├─ vbmeta.dump
├─ system.ext2 (or system.dump)
├─ settings.ext4 (or settings.dump)
This also reduces duplicate/unnecessary data, as well as personally identifying stuff (I've seen a few people in the community share their dumps with a full data partition dump, containing their phone MAC addresses, etc.).
Similarly to the above approach, restoration could be optimised by not restoring all partitions, instead:
env
env
)data
's partition headers)As by the looks of it, Android's A/B tooling is used, the handling of the inactive slot partitions is automatic - upon receiving an update, if an invalid/faulty partition (in our case, zeroed out) is detected, the current slot's appropriate partition is copied over before the OTA delta patch is applied. This means that zeroing out these partitions is perfectly fine.
This would similarly reduce the time needed to restore a device (especially since the nulling can be done by writing zeros to the memory once, then issuing the copy command from the same memory region again and again, speeding up things) as number 1 above.
This is where you'll hate me. The current ADB process uses a prebuilt boot.img with ADB enabled. This poses a number of compatibility issues, as Spotify, to date, is issuing firmware updates to the CarThing, often patching the kernel/initrd, which can sometimes cause boot issues.
Therefore I'd like to propose a more dynamic approach to enabling ADB, by integrating mkbootimg
and possibly abootimg
into the process. Instead of booting a prepared boot.img, the ADB option should:
env
and get current boot slotboot_{activeSlot}
and save locallyI am having some issues with usb net on pop os, it won't forward the internet nor certain ports. Can you please elaborate on if there is any setup that needs to be done besides usb-gadget on the car thing?
P.S Sending a pull request eventually I noticed some issues that I know how to solve.
Since we have access to an older Amlogic update
utility's source code (https://github.com/yangfl/update/), I was wondering if it would be feasible to port over the mread
comment in its whole instead of relying on the incredibly slow flash->memory->host pipeline of the current version.
The above utility seems to be using considerably different commands with the Burn Mode peripheral/gadget, so I think the best approach would be to write completely new methods for this specific purpose.
I know it's somewhat out of scope for this project, but it would be nice to see a completely open source and cross-platform Python implementation that can be used on any host machine.
This is the command I used sudo ./superbird_tool.py --boot_adb_kernel
it shows a blank grey screen
If you replace line 129 in superbird_tool.py with this:
dev.bulkcmd(r'setenv storeargs "${storeargs} if gpio input GPIOA_3; then run update; fi;"')
It'll make it to where the car thing only goes into burn mode when preset 4 is held down while booting. You could also make it to where the user can choose which button should be held down by changing GPIOA_3 to one of the following:
Preset 1: GPIOA_0
Preset 2: GPIOA_1
Preset 3: GPIOA_2
Preset 4: GPIOA_3
Back: GPIOA_5
Select: GPIOZ_7
Power/Menu: GPIOAO_3
I have identified that setting the auto burn mode env setting with this tool https://github.com/frederic/superbird-bulkcmd then trying to adb boot does work but(after restoring the env) trying to use --enable_burn_mode then adb boot does not work and I am wondering if it's changing a setting it does not need to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.