-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
56 lines (52 loc) · 2.51 KB
/
README
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
FW uploader for iqrf devices.
More informations at: http://iqrf.com
Project page: http://open-nandra.com/?page_id=108
HOW TO COMPILE IDE:
1. clone repo : git clone git@github.com:nandra/liqrf.git
2. init and update submodule : git submodule init; git submodule update
3. make
4. change ownership of libusb in default udev rule (lib/udev/rules.d/*-default*)
from 664 to 666.
5. connect CK-USB and run binary.
6. Enjoy ;)
Additional informations:
SPI Packet structure:
The master can send two types of packets with the following structure:
Master checks the SPI status of the module:
Master SPI_CHECK
Slave SPISTAT
Master reads/writes a packet from/to the module:
Master SPI_CMD PTYPE DM1 DM2 --- DMSPIDLEN CRCM
Slave SPISTAT SPISTAT DS1 DS2 --- DSSPIDLEN CRCS
Where:
SPI_CHECK = 0x00
SPI_CMD = 0xF0
SPISTAT: SPI status of the module
hex value SPI status
00 SPI not working (disabled by the disableSPI() command)
07 SPI suspended by the stopSPI() command
3F SPI not ready (buffer full, last CRCM O.K.)
3E SPI not ready (buffer full, last CRCM error)
40 to 63 SPI data ready. Value - 0x40 = number of bytes to be sent from the slave (1 to Nmax )
80 SPI ready (communication mode)
81 SPI ready (programming mode)
82 SPI ready (debugging mode)
83 SPI not working in background (e.g. during receiving of RF packet) – Slow mode
Master should prolong the delay between individual bytes when this status is received.
See the T2 parameter in the table above.
FF SPI not working (HW error)
SPI status of the module is indicated by the IQRF IDE when used together with related IQRF development tools (e.g. CK-
USB-02):
PTYPE:
b7 b6 b5 b4 b3 b2 b1 b0
CTYPE SPIDLEN
CTYPE: communication type
10: full duplex (the master reads/writes from/to the module, bufferCOM changed)
00: half duplex (the master reads from the module, bufferCOM unchanged)
SPIDLEN: data length (from 1 to Nmax)
TR-xxx-xxA: Nmax = 35
TR-xxx-xxB: Nmax = 35
DM: data from the master
DS: data from the slave
CRCM = SPI_CMD xor PTYPE xor DM1 xor DM2 ... xor DMSPIDLEN xor 0x5F
CRCS = PTYPE xor DS1 xor DS2 ... xor DSSPIDLEN xor 0x5F