Junsun V1 - TWRP, Root, Discussion and more. (AC8227L) (Android 8.1) (2GB + 32GB)

maxou2

Member
May 15, 2012
37
1
28
Nadie tiene un firmware o mcu actualizado de la junsun v1 1g 16g de los que se actualizan con ficheros update-ty.zip y ms51_update.bin?????
Ask your vendor or try in some other place.... I think you can find forums where varios MCU type are identified ad discussed somewehere...
BTW did you check the BT antenna? Keep in mind that is just a short wire, check for short circuit or ground contact...
IMG_20201222_141215.jpg
 
Dec 8, 2020
16
0
11
[QUOTE = "maxou2, publicación: 84151783, miembro: 4643209"]
Pregúntele a su proveedor o pruebe en algún otro lugar ... Creo que puede encontrar foros donde se identifican varios tipos de MCU y se discuten en algún lugar ...
Por cierto, ¿revisaste la antena BT? Tenga en cuenta que es solo un cable corto, verifique si hay cortocircuito o contacto a tierra ...
View attachment 5164787
[/CITAR]

Es una buena idea, pero no sé si podré identificarlo. Gracias
 
Dec 8, 2020
16
0
11
[QUOTE = "maxou2, publicación: 84151783, miembro: 4643209"]
Pregúntele a su proveedor o pruebe en algún otro lugar ... Creo que puede encontrar foros donde se identifican varios tipos de MCU y se discuten en algún lugar ...
Por cierto, ¿revisaste la antena BT? Tenga en cuenta que es solo un cable corto, verifique si hay cortocircuito o contacto a tierra ...
View attachment 5164787
[/CITAR]

It's a good idea, but I don't know if I'll be able to identify it. Thank you
 

maxou2

Member
May 15, 2012
37
1
28
Okay, I've been digging through the firmware to see where the f*** the programmers set most apps to fullscreen mode, and finally found it. In case any of you, like me, does not want to force fullscreen for all apps, you have to set this setting in /vendor/build.prop or /system/build.prop:

forfan.force_fullscreen=0

It took me a few hours to find, so hopefully nobody else has to go through the pain again :p
Did not work for me... First try: i modified the /system/build.prop,;after a reboot nothing changed.. Next try was to modify ALSO the /vendor/build.prop , after a reboot the system had a weird behaivior, some apps crashed, the keyboard did not respond properly and so on... In the end i put back the original build.prop in both dirs and the system was ok again. I've noticed in the /system and the /vendor dir the presence of a file named "build.prop~" but i did not have enough time to check its content, only its size was slightly different from the build.prop one.
 

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
I've been reverse engineering the native library which controls the MCU, DSP and gets CAN messages. MCU is on /dev/ttyMT2, DSP is on /dev/ttyMT3.

Both serial ports use 38400 baudrate.

The Android -> MCU packet format is:

0x23 (1 byte)
Command (1 byte)
Data length (1 byte)
Data ("Data length" bytes)
Checksum (1 byte, XOR of all previous bytes except first byte)

The MCU -> Android format should be the same, but I'm still not 100% sure.

My goal is to write a completely new MainUI apk, since the current one uses a lot of system resources. I'll only focus on making it work on my Junsun V1 2GB + 32GB.
 

maxou2

Member
May 15, 2012
37
1
28
I've been reverse engineering the native library which controls the MCU, DSP and gets CAN messages. MCU is on /dev/ttyMT2, DSP is on /dev/ttyMT3.

....

My goal is to write a completely new MainUI apk, since the current one uses a lot of system resources. I'll only focus on making it work on my Junsun V1 2GB + 32GB.
Good Job, I'm not an Andoird programmer neither an app architecture expert but anyway this MainUi.apk seems to be a big mess...
Your reverse engineering is really interesting, unfortunately my unit is in the car otherwise i'd really liked play with it to check all this and discover more... Pls let us know about your future achievements if yuo don't mind.
 

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
Well I've got some updates.

I've posted my current progress to GitHub. Currently it basically does nothing by itself, but the code to communicate with the touchscreen works perfectly. Also, the code for the MCU seems to be partially working, but I could not get it to do anything, even something as simple as turning off the backlight.

In case any of you want to dig into the code, here it is:

It's quite messy right now, and some parts are directly copy-paste from ghidra. However, nothing crashes, which is good to see too.

Feel free to make suggestions and even pull requests if you feel like doing so. To be able to run the .apk, it has to be signed with system certificates and installed as a normal .apk as an update, or replacing the apk into /system/priv-app/MainUI.

I chose to sign it with system certificates directly so that I can just click "play" on Android Studio.
 

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
Good news!

I got MCU communication working! Actually, the communitacion was always working, what failed was the initialization sequence, which is quite weird.

Anyway, it now works and at least I can adjust the screen brightness :D

All the code is in github, as always.
 

maxou2

Member
May 15, 2012
37
1
28
Well I've got some updates.

I've posted my current progress to GitHub. Currently it basically does nothing by itself, but the code to communicate with the touchscreen works perfectly. Also, the code for the MCU seems to be partially working, but I could not get it to do anything, even something as simple as turning off the backlight.

In case any of you want to dig into the code, here it is:

It's quite messy right now, and some parts are directly copy-paste from ghidra. However, nothing crashes, which is good to see too.

Feel free to make suggestions and even pull requests if you feel like doing so. To be able to run the .apk, it has to be signed with system certificates and installed as a normal .apk as an update, or replacing the apk into /system/priv-app/MainUI.

I chose to sign it with system certificates directly so that I can just click "play" on Android Studio.
I'm quite busy at the moment and i also can't user the unit as lab test, anyway i really appreciate your work and i really hope to have spare time and knowledge so i can help you ASAP... BTW the worst about our unit is about the responsiveness, sometimes it really sucks... On my other car i have a YT9217 unit ( that has the same SOC but with only 1 GB RAM ) and it really beats our in almost everything ( except radio and DSP ), it's really a pleasure to use it... unfortunately the fw is not compatible ( i suppose ) but it seems to be optimized for the HW.
 

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
I'm quite busy at the moment and i also can't user the unit as lab test, anyway i really appreciate your work and i really hope to have spare time and knowledge so i can help you ASAP... BTW the worst about our unit is about the responsiveness, sometimes it really sucks... On my other car i have a YT9217 unit ( that has the same SOC but with only 1 GB RAM ) and it really beats our in almost everything ( except radio and DSP ), it's really a pleasure to use it... unfortunately the fw is not compatible ( i suppose ) but it seems to be optimized for the HW.
Wow really? I thought the bad performance was mostly because of the SOC... This is the only AC8227L radio I own, I have three more but those are running MT6852, Allwinner T3 and MStar Cedric. The snappiest one is the MT6582, then 8227L, then T3, and then MStar.

I will look into it now that you have mentioned it. It's true that the firmware in the Junsun is crap, log is full of debug output which only speeds thing down more. My goal is to speed it up even if it's just a bit more.

Regarding my work, I'm now working on the DSP, and some functions will be hard to reverse engineer like reverb, fad/bal, mixer/channel selection (bluetooth, radio or android, or a mix of the three).

As always, the code is on github :)
 

Proff55

Member
Feb 21, 2021
9
2
13
Padova
Hello, I would like to ask a question to the TWRP experts, about my HU AC8227L with system YT9216C_AHD_000005_V004_20190807
I have installed the TWRP vers. 3.0.2.0, which seems to be the only one working on these radios.
I can't make a backup even of the system partition.
After less than a minute, the video freezes, the monitor wobbles and the system restarts.
Screen timeout is disabled.
Backing up small partitions like boot - lk - recovery etc does it without any problems, zip file installations ok
Has anyone happened the same thing?
Thank you all for the work you are doing.
 

arcadilius

New member
Aug 29, 2020
3
0
1
Gents, you are doing impressive work here however I have different question. Maybe it's wrong place to ask but you look like you know your stuff, not to mention I've tried elsewhere without success. During playing with different softwares and making my own changes I've managed to brick my V1 2/32 and I can't re-flash it back without knowing where the "TEST POINT" is in the board. Maybe you could shed some light. Any clue would be appreciated. Pics of my board attached. Thank you!
 

Attachments

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
Gents, you are doing impressive work here however I have different question. Maybe it's wrong place to ask but you look like you know your stuff, not to mention I've tried elsewhere without success. During playing with different softwares and making my own changes I've managed to brick my V1 2/32 and I can't re-flash it back without knowing where the "TEST POINT" is in the board. Maybe you could shed some light. Any clue would be appreciated. Pics of my board attached. Thank you!
It's not getting detected by the computer at all?
 

arcadilius

New member
Aug 29, 2020
3
0
1
No, I have no response at all. No physical buttons as well. As described in some flashing posts, I need to press (short) Volume Button before the board is plugged to computer. Below pic is just an example found for different board...
 

Attachments

iscle

Senior Member
Apr 19, 2014
211
478
108
22
Barcelona
No, I have no response at all. No physical buttons as well. As described in some flashing posts, I need to press (short) Volume Button before the board is plugged to computer. Below pic is just an example found for different board...
You can try those two points with a very thin and long cable (or with a 1k resistor if you have one, to avoid shorting something if it's not the correct ones)

1615052039099.png