This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:loraloc_hal-4.0.1 [2017/08/28 11:25] bdu created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== iBTS Semtech HALv2 v4.0.1 - Instructions ====== | ||
- | ===== Compilation ===== | ||
- | |||
- | ==== Prerequisites ==== | ||
- | |||
- | Required packages / tools to build the HALv2: | ||
- | |||
- | * ''build-essential'' | ||
- | * ''tar'' | ||
- | * ''opkg-build'' (which can be downloaded from https://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/plain/opkg-build) | ||
- | |||
- | Please ensure that these file are in your ''$PATH''. | ||
- | |||
- | ==== Compilation ==== | ||
- | |||
- | To compile the HALv2, please use following commands: | ||
- | |||
- | <code bash> | ||
- | tar xzf libloragw2-4.0.1-klk3.tar.gz | ||
- | cd lora_gateway_v2_4.0.1-klk3 | ||
- | source /opt/toolchains/lpbs/environment-setup-cortexa9hf-neon-poky-linux-gnueabi | ||
- | ./configure --host=arm-poky-linux-gnueabi --prefix=/user/libloragw2 | ||
- | </code> | ||
- | |||
- | This should show something similar to: | ||
- | |||
- | <code> | ||
- | checking for... | ||
- | ... | ||
- | configure: creating ./config.status | ||
- | config.status: creating ... | ||
- | config.status: executing depfiles commands | ||
- | </code> | ||
- | |||
- | Please ensure that you don't have errors. Then you can compile the tools: | ||
- | |||
- | <code bash> | ||
- | make | ||
- | make ipk # this is optional and generates the ipk required to upgrade the FPGA to v58 | ||
- | </code> | ||
- | |||
- | ===== Usage ===== | ||
- | |||
- | The main modification in tools since HALv1 is the '-d' argument. | ||
- | |||
- | As this HAL is mainly designed to handle multiple RF chips, this optional argument allows to specify which spidevice to use. | ||
- | |||
- | Kerlink provides a automatic discovery script at startup to handle correctly plugged boards. | ||
- | |||
- | By default, if a WAN module is provided, loraloc modules are mapped from slot 2. | ||
- | |||
- | So to use tools with this Loraloc module, please specify on tool's command-line ''-d /dev/slot/2/spidev0''. | ||
- | |||
- | For example: | ||
- | <code bash> | ||
- | ./pkt_logger -d /dev/slot/2/spidev0 | ||
- | </code> | ||
- | |||
- | ===== Configuration ===== | ||
- | |||
- | Due to architecture, the configuration is quite more complex than HAL v1: | ||
- | * **board** keyword means "Loraloc board" or "LoraLoc module" (one "board" by slot) | ||
- | * each board includes 2 **chip** configs (i.e. sx1301 configs) | ||
- | * each board includes 2 **rfchain** configs | ||
- | |||
- | ==== Chip config ==== | ||
- | |||
- | This configuration must include SX1301 channel config. | ||
- | |||
- | These channels can be configured through ''sx1301ar_conf_chan'' function. | ||
- | |||
- | Please note that this function takes as "channel number" the concatenation of chip number and channel. (see function description in ''sx1301ar_hal.h'') | ||
- | |||
- | ==== RF Chain config ==== | ||
- | |||
- | This configuration is mainly used to correct RSSI and TX power values. | ||
- | |||
- | Corresponding calibration values are set in Production by Kerlink and extracted during board startup in ''/tmp/calib_loraloc.json'' file. | ||
- | |||
- | Thanks to ad9361 transceiver chip. We are able to get +-0.25 dBm precision on real TX power. | ||
- | |||
- | As a consequence, up to 32 power steps (''tx_lut'') are generated and calibrated in production. | ||
- | |||
- | ==== JSON Config ==== | ||
- | |||
- | The JSON configuration file has been improved to simplify software by using JSON tables. | ||
- | |||
- | Indeed: | ||
- | * The main Radio config object ''SX1301_array_conf'' is now a table to support multiple boards | ||
- | * ''rf_chain_conf'' is also a 2-objects-sized table | ||
- | * ''SX1301_conf'' is a 2-objects-sized table | ||
- | * ''tx_lut'' is a variable table (up to 32 objects) |