Project

General

Profile

Gigaset C430 Hacking » History » Version 7

manawyrm, 11/22/2022 01:40 AM

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 2 manawyrm
The firmware can be modded by unsoldering the SPI flash chip and flashing it in an external programmer (like a MiniPro TL866):
15 1 manawyrm
16
{{thumbnail(IMG_6053.JPG)}}
17 2 manawyrm
18
*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!*
19
20
The SPI flash IC is being accessed at 82.944MHz, using Quad-SPI. 
21
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.
22
It might be possible to lower the SPI clock frequency to a more reasonable value somehow.
23
24
h2. Documentation
25
26
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.
27
The SC14480 has many of the same registers and peripherals and the register maps are highly useful for looking at the SC14441/C430 firmware.
28
29
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.
30
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
31
32
Ghidra can decompile the firmware image for the phones with the cr16c architecture.
33
You'll need to map the flash memory at 0xF0000 and some volatile peripheral registers at 0xFF4000 - 0xFFC00.
34 3 manawyrm
!xocetzhvijs.png!
35 2 manawyrm
36
h2. Mods
37
38
h3. Custom ringtones
39
40 4 manawyrm
Ringtones on the C430 phones are standard MIDI files, being played by a software MIDI synthesizer implementation.
41
This implementation seems to be called "Sitel Midi Player", but no further info about that player/synth is publicly available. 
42 2 manawyrm
43 4 manawyrm
{{thumbnail(cgpmjvoeitb.jpg)}}
44
45
A video showing the custom ringtones is available on YouTube:  
46
https://www.youtube.com/watch?v=Dl5x1VhMqEg
47
48
The MIDI files are embedded into the firmware directly and can be found by looking for the MIDI header magic "MThd" (ascii).
49
From there the amount of tracks and then their length in bytes can be determined by looking at the MIDI track headers.
50
51
This script will look at a binary dump and extract any MIDI files (this script is not limited to Gigaset phones, useful in general):
52
https://github.com/Manawyrm/gigaset-c430-modding/blob/main/midi_dump.php
53
54
Running that script will result in a folder full of MIDI files like this:
55
<pre><code class="shell">
56
[gigaset-c430-modding]$ file *
57
extract-1662195.mid:    Standard MIDI data (format 0) using 1 track at 1/480
58
extract-1662318.mid:    Standard MIDI data (format 1) using 1 track at 1/480
59
extract-1662352.mid:    Standard MIDI data (format 0) using 1 track at 1/480
60
extract-1662462.mid:    Standard MIDI data (format 1) using 1 track at 1/480
61
extract-1662510.mid:    Standard MIDI data (format 1) using 1 track at 1/240
62
[...]
63
</code></pre>
64
65
The number in the filename is the offset of the MIDI file in the dump, in decimal notation.
66
67
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.
68
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.
69
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.
70
71
An example shell script for modding 6 custom ringtones into the firmware can be found here:  
72
https://github.com/Manawyrm/gigaset-c430-modding/blob/main/mod.sh
73
74
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.
75 5 manawyrm
76 4 manawyrm
{{thumbnail(wqdiyzjfpvk.png)}}
77
78
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.
79 1 manawyrm
80 5 manawyrm
h3. NiMH battery charge configuration
81
82
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. 
83
84
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). 
85
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.
86
87 7 manawyrm
*WARNING! This change is not well tested! It might cause your cells to explode, catch on fire, etc.!*
88
*Do _NOT_ apply this mod on your daily driver phone without keeping a close eye on the batteries!*
89
*If you do, please report back. The author has only ever bench-tested these mods!*
90 6 manawyrm
91
In the stock firmware, the BAT_CTRL2_REG (0xFF4814) will get written in 2 places:
92
<pre>
93
0011d508 b0 5a 62 08     MOVW       $0x862,R0
94
	SOC_TEST2 0 = Normal operation.
95
	SOC_TEST1 0 = Normal operation.
96
	SOC_CAL 0 = Normal operation of the state-of-charge counter
97
	SOC_ON 1 = State Of Charge counter is enabled.
98
	CHARGE_CUR 000 = no current limit, Hysteresis mode enabled
99
	NTC_DISABLE 1 = Charger NTC protection disable.
100
	CHARGE_ON 1 = Charger enabled
101
	CHARGE_LEVEL = 00010 // 3.4V
102
103
001157e0 b2 22 ff f8     ANDW       $0xf8ff,R2
104
	CHARGE_CUR to 000 = no current limit
105
</pre>
106
(offsets are including the 0xF0000 flash offset)
107
108
Changing this as follows:
109
<pre>
110
0011d508 b0 5a 60 09     MOVW       $0x960,R0
111
	CHARGE_CUR 001 = 65 mA
112
	CHARGE_LEVEL = 00000 // 3.0V
113
114
001157e0 b2 22 ff ff     ANDW       $0xffff,R2
115
	don't touch CHARGE_CUR register
116 1 manawyrm
</pre>
117
should limit the charging current to 65mA and the end-of-charge voltage to 3.0V (1.5V per cell).
118 7 manawyrm
119
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):
120
{{thumbnail(hgtedmkcrfq.jpg)}} {{thumbnail(dwbaefchmtk.jpg)}} 
121 6 manawyrm
122
h3. Custom screensavers
123
124
The firmware contains a bunch of images of fish, which are being used as a (optional) screensaver.
125
It would be very nice to be able to replace these images with custom ones.
126
127
Unfortunately, the encoding and location of those images in the firmware is currently unknown.
Add picture from clipboard (Maximum size: 48.8 MB)