summaryrefslogtreecommitdiffstats
path: root/oncology/dpfhack_display/fw/README
blob: 46ffa999fb5384abe66d59d97da5096001b46a91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
This is rudimentary code to inject your own source into the AX206 based DPFs.
Since this chip is very much undocumented and no information about the internal
firmware is available, the following strategy was chosen:

- Leave original firmware as intact as possible (NEVER touch sector 0)
- Allow to manually put unit into "Developer Mode"
- Allow to return to default state using the RESET button

Note that the Developer Mode uses two sectors at the end of the internal
flash. Therefore, DO NOT fill up the frame with images to the maximum,
or weird things may happen.

When the DPF is hacked using the scripts described below, the Developer Mode
is simply entered by connecting the DPF to a PC via the USB cable and holding
the MENU button for approx. 2 seconds.

See more about the Developer Mode below.

----------------------------------------------------------------------------

The tar file contents are merely:

- simple (yet unfinished and quirky) library to access the DPF flash and
  the extended functionality when in "Developer Mode".
- Python wrapper around the above library
- Python scripts to patch various DPFs (listed in profiles.py) and other
  auxiliaries

Description of a few tools
---------------------------

app_detect.s, detect.py: Simple rudimentary detection for Sitronix/NXP
                         compatible LCD controllers and SPI flash chip.
fulldump.py:             Performs a dump of the flash according to detected
                         flash size (often specified wrong by vendor)

Developer Mode
---------------

When the unit is in Developer Mode, it registers itself as USB device with
the same VID:PID, but not as USB storage. This allows much faster access using
libusb and as non-root. However, the unit will still use USB storage SCSI
commands, see dpflib for the wrapping over libusb.

Specific commands are implemented using the handler for the SCSI command
0xcd, mode 6. These commands are handled on the DPF by cmdhandler.s
(up to v0.1alpha) and by dpflib/dpflib.c on the target.

Note that the protocol may change in future, once the internal firmware
is fully replaced by something more structured. Thus, you should implement
extras on the dpflib level only, never access USB directly.

Prerequisites
--------------

You need:

- A proper Linux system with GCC, python-dev (libraries and headers to
  compilee your own modules)
Optionally:
- Possibly some knowledge of the 8051, if you want to mess around
- A working sdcc distribution including asx8051, aslink, etc.

Usage
------

1. run 'make' to build the tools and patches
2. Initiate USB connection from the DPF via the menu
3. Wait a while and check dmesg for the /dev/sgX assignment
4. Run 'python hackit.py /dev/sgX' as root (CAREFUL!!!) to probe for
   known DPFs and confirm that you wish to patch the DPF according to the
   instructions.

The hackit.py script checks for a valid DPF, so you can not accidentally
damage your hard disk. Also, it runs a crc32 check on critical modules
for more safety. DO NOT CHANGE the existing checksums. Only *add* new
profiles in profiles.py, don't EVER change existing ones.

Before messing around, you might want to dump the entire flash using the
fulldump.py script.

For those desiring to try adding hacks for other frame models, there is
now a short howto in the reverse/ folder.

----------------------------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WARNING: Do not modify the script unless you REALLY know what you are doing.

DISCLAIMER: There is no guarantee that you will not brick your DPF.
The Author(s) of this code take no responsibilities. You are completely on
your own there!
If you bricked your DPF, check the URL below for information how to restore
the flash image.

LICENSE:
You are allowed to modify and distribute the code, as long as you keep it
OpenSource. We just trust you that you have a notion of fair usage :-)

TODO:
1. Windows support, fully featured lcd4linux support via generic DPF library
   (I leave this to others. I hate Windows.)
2. Replace flash firmware with improved opensource environment

----------------------------------------------------------------------------

Find updates and documentation here:

http://picframe.spritesserver.nl/wiki/index.php/DPF_with_AppoTech_AX206

or here:

http://tech.section5.ch/news/?p=68

----------------------------------------------------------------------------