Project

General

Profile

Gigaset C430 Hacking » History » Version 10

manawyrm, 12/23/2022 06:49 PM

1 1 manawyrm
h1. Gigaset C430 Hacking
2
3
{{>toc}}
4
5 2 manawyrm
h2. Overview
6
7 1 manawyrm
The C430HX/A phones use a Dialog/Renesas SC14441 SoC, which is a fully integrated DECT handset IC, with all peripherals built in.
8
The firmware is stored on an external Quad-SPI flash chip (MX25U1635E), 2 MByte.
9
10
The CPU inside the SC14441 is a CompactRISC CR16c plus-architecture.
11
12
{{thumbnail(IMG_2138.JPG)}}
13
14 10 manawyrm
There is the https://github.com/Manawyrm/Gigaset-Debug-Adapter#readme now, which uses the UART bootloader to directly read/write the flash without opening the phone.
15 2 manawyrm
16
h2. Documentation
17
18
Not much info is available about the SC14441 (except for a single page overview), but a datasheet for the similar SC14480 SoC is floating around online.
19
The SC14480 has many of the same registers and peripherals and the register maps are highly useful for looking at the SC14441/C430 firmware.
20
21
Gigaset also offers a GPL download .tar.gz for another product from their DECT lineup for one of their DECT base stations, which is running GPL software.
22
This tarball contains a full GNU toolchain and a bunch of other interesting things: https://cms.gigaset.com/opensource/GigasetElements/gigaset_elements_bl26_opensource.tar.gz
23
24
Ghidra can decompile the firmware image for the phones with the cr16c architecture.
25
You'll need to map the flash memory at 0xF0000 and some volatile peripheral registers at 0xFF4000 - 0xFFC00.
26 3 manawyrm
!xocetzhvijs.png!
27 2 manawyrm
28 9 manawyrm
https://www.displayfuture.com/Display/datasheet/controller/ST7735.pdf
29
Sitronix ST7735 - 262K Color Single-Chip TFT Controller/Driver
30
31 2 manawyrm
h2. Mods
32
33
h3. Custom ringtones
34
35 4 manawyrm
Ringtones on the C430 phones are standard MIDI files, being played by a software MIDI synthesizer implementation.
36
This implementation seems to be called "Sitel Midi Player", but no further info about that player/synth is publicly available. 
37 2 manawyrm
38 4 manawyrm
{{thumbnail(cgpmjvoeitb.jpg)}}
39
40
A video showing the custom ringtones is available on YouTube:  
41
https://www.youtube.com/watch?v=Dl5x1VhMqEg
42
43
The MIDI files are embedded into the firmware directly and can be found by looking for the MIDI header magic "MThd" (ascii).
44
From there the amount of tracks and then their length in bytes can be determined by looking at the MIDI track headers.
45
46
This script will look at a binary dump and extract any MIDI files (this script is not limited to Gigaset phones, useful in general):
47
https://github.com/Manawyrm/gigaset-c430-modding/blob/main/midi_dump.php
48
49
Running that script will result in a folder full of MIDI files like this:
50
<pre><code class="shell">
51
[gigaset-c430-modding]$ file *
52
extract-1662195.mid:    Standard MIDI data (format 0) using 1 track at 1/480
53
extract-1662318.mid:    Standard MIDI data (format 1) using 1 track at 1/480
54
extract-1662352.mid:    Standard MIDI data (format 0) using 1 track at 1/480
55
extract-1662462.mid:    Standard MIDI data (format 1) using 1 track at 1/480
56
extract-1662510.mid:    Standard MIDI data (format 1) using 1 track at 1/240
57
[...]
58
</code></pre>
59
60
The number in the filename is the offset of the MIDI file in the dump, in decimal notation.
61
62
As MIDI files are read from the start and contain their own length information, these files can be replaced by files that are the exact same length or shorter.
63
When trying to replace a ringtone, find a suitable stock ringtone and just replace the bytes starting at the same offset with your desired .mid file.
64
Take great care not to overwrite any other memory content (by overstepping the boundaries of the stock MIDI files, etc.), as this will lead to memory corruption and crashes.
65
66
An example shell script for modding 6 custom ringtones into the firmware can be found here:  
67
https://github.com/Manawyrm/gigaset-c430-modding/blob/main/mod.sh
68
69
This script also uses dd to patch the strings of the ringtone names. When doing this, ensure you don't overwrite the \0 null terminator, otherwise you'll end up with memory corruption again.
70 5 manawyrm
71 4 manawyrm
{{thumbnail(wqdiyzjfpvk.png)}}
72
73
Creating/editing MIDI files to fit onto the phone can be done with a free/open tool like "Rosegarden". The exported MIDI files seem to be very compatible with the Sitel player.
74 1 manawyrm
75 5 manawyrm
h3. NiMH battery charge configuration
76
77
By default, the C430 phones will not treat the NiMH batteries very carefully. When sitting in the charging cradle for a long time, the batteries will be hot and won't last a very long time until they need to be replaced. 
78
79
Both charging current and end-of-charge voltage are controlled by the SoC itself. The stock firmware will set no limit for the charge current and a end-of-charge voltage of 3.4V (1.7V per cell). 
80
This is out-of-spec for many NiMH cells and for casual desktop operation, a much lower voltage and current limit might be desirable to keep the cells alive longer.
81
82 7 manawyrm
*WARNING! This change is not well tested! It might cause your cells to explode, catch on fire, etc.!*
83
*Do _NOT_ apply this mod on your daily driver phone without keeping a close eye on the batteries!*
84
*If you do, please report back. The author has only ever bench-tested these mods!*
85 6 manawyrm
86
In the stock firmware, the BAT_CTRL2_REG (0xFF4814) will get written in 2 places:
87
<pre>
88
0011d508 b0 5a 62 08     MOVW       $0x862,R0
89
	SOC_TEST2 0 = Normal operation.
90
	SOC_TEST1 0 = Normal operation.
91
	SOC_CAL 0 = Normal operation of the state-of-charge counter
92
	SOC_ON 1 = State Of Charge counter is enabled.
93
	CHARGE_CUR 000 = no current limit, Hysteresis mode enabled
94
	NTC_DISABLE 1 = Charger NTC protection disable.
95
	CHARGE_ON 1 = Charger enabled
96
	CHARGE_LEVEL = 00010 // 3.4V
97
98
001157e0 b2 22 ff f8     ANDW       $0xf8ff,R2
99
	CHARGE_CUR to 000 = no current limit
100
</pre>
101
(offsets are including the 0xF0000 flash offset)
102
103
Changing this as follows:
104
<pre>
105
0011d508 b0 5a 60 09     MOVW       $0x960,R0
106
	CHARGE_CUR 001 = 65 mA
107
	CHARGE_LEVEL = 00000 // 3.0V
108
109
001157e0 b2 22 ff ff     ANDW       $0xffff,R2
110
	don't touch CHARGE_CUR register
111 1 manawyrm
</pre>
112
should limit the charging current to 65mA and the end-of-charge voltage to 3.0V (1.5V per cell).
113 7 manawyrm
114
In testing, it changed the current from ~430mA to ~100mA, which is much more reasonable (will also 4x the charging time, but that's acceptable for home-use):
115 1 manawyrm
116
{{thumbnail(hgtedmkcrfq.jpg)}} {{thumbnail(dwbaefchmtk.jpg)}} 
117
118
h3. Custom screensavers
119
120
The firmware contains a bunch of images of fish, which are being used as a (optional) screensaver.
121
It would be very nice to be able to replace these images with custom ones.
122
123
Unfortunately, the encoding and location of those images in the firmware is currently unknown.
124 10 manawyrm
125
h3. Manual flash interfacing
126
The firmware can also be modded by unsoldering the SPI flash chip and flashing it in an external programmer (like a MiniPro TL866):
127
128
{{thumbnail(IMG_6053.JPG)}}
129
130
*Be careful when trying to flash the SPI flash in-circuit! The phone runs at 1.8V I/O voltage! Do not apply 3.3V to any parts of the system externally!*
131
132
The SPI flash IC is being accessed at 82.944MHz, using Quad-SPI. 
133
Trying to run jumper wires from the SOIC footprint out to an external socket can be accomplished, but needs to be done very carefully, ideally with shielded wires, kept as short as possible. Even with a pretty reasonable setup, the phone will be unstable in this configuration.
134
It might be possible to lower the SPI clock frequency to a more reasonable value somehow.
Add picture from clipboard (Maximum size: 48.8 MB)