1 Memory Organisation {#ChaMemory}
4 libpruio uses memory to exchange data between the host (ARM) and PRU
5 subsystem. Parameters need to be passed to the PRU subsystem, data get
6 exchanged in both directions. The kernel driver allocates memory areas
7 for that purpose. libpruio uses
9 - the PRU specific DRam in IO mode and
10 - both DRam areas and the external memory in MM mode.
12 In IO mode the driver uses DRam-0 when running on PRU-0 and DRam-1 when
13 running on PRU-1 (default). In MM mode further memory is needed to
14 store the measurement data. Therefor libpruio uses the external memory
21 The following table shows the memory usage in the DRam area (DRam-0
for
22 PRU-0 or DRam-1
for PRU-1). Some context changes, depending on the
23 current driver
function.
25 | Offset | Size | Mode | Context |
26 | -----------------------------------: | :-------------------------------: | :----: | :-------------------------- |
27 | 0 | 4 | all | Status |
28 | 4 | 4 | init | offset ADC config |
29 | 4 | 4 | IO | ball# config update |
33 | PRUIO_PIN_OFFS = 256 |
PRUIO_BALL_AZ + 1 = 110 | all | PinConf array |
39 |
PRUIO_ADC_OFFS = 512 | (max) 2 * Samples * ChAz | MM | sort buffer
for pre-trigger |
41 Check file pruio.hp
for the definition of the symbols in
this table.
44 External Ram {#SubERam}
47 The external ram is used in MM mode to store the sampled data from the
48 ADC device. Currently, the number of samples in MM mode is limited by
49 the size of the external ram, which is a block of 256 kByte (by
50 default). You can customize the size of the external ram by setting an
51 option in the kernel driver call
54 /sbin/modprobe uio_pruss extram_pool_sz=0x800000
57 The mximum size is 8 Mb.
59 In
case of a pre-trigger the starting area of the erternal ram is used
60 as ring buffer. Its datas are invalid during measurement. Don
't read
61 them before the function \ref PruIo::mm_start() finished.
63 The ring buffer gets sorted after measurement and libpruio shifts some
64 data to the DRam area, starting at offset &h200. In worst case, both
65 DRam areas are used for that purpose (depending on the fill level of
66 the ring buffer when the trigger event happens).