aboutsummaryrefslogtreecommitdiff
path: root/write-stm-device/readme
blob: 8b91297d856b99713769aa2a3b78c547a490ff10 (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
Before compiling the program, you must change the items below accroding to your environment:

- 'CROSS_COMPILE' in Makefile
- STM device name in stm_user_api.h
- TMC device name in stm_user_api.h

If you don't care what channel(s) will the trace data be written on, you don't need to read the following words.
But if not, there will be two ways for you you to create and set a policy for the application program:

1) Set a policy in the program via ioctl() system call like [1] is doing, in this way you can use more than one channel,
since the channel number you want to use can be set by ioctl().

2) Simply use the first available channel selected from a policy named "default" which has to be created via sysfs:

Mount configfs manually with:
/ # mount -t configfs none /config

Create policy directory for STM device:
/ # mkdir /config/stp-policy/20100000.stm.abc

NOTE: 
The directory name consists of the STM device name to which the policy applies and the policy name separated by a dot.
The device name (say 20100000.stm) have to be matched the name of STM device which can be found under /dev.
The suffix is a arbitrary string without dot.

Create policy:
/ # mkdir /config/stp-policy/20100000.stm.abc/default

The range of channels and masters of default policy can be changed according to your requirement.

[1] https://git.linaro.org/people/zhang.chunyan/sample-app.git branch stm-mmap-sample