Skip to content

Commit

Permalink
> #### Updates
Browse files Browse the repository at this point in the history
Fixed AGC firmware version check for sx1255/sx1257 based platforms (full-duplex
gateways...).

> #### Changes

* HAL: AGC firmware version for sx1255/sx1257 based gateways is v6.
* HAL: minor cosmetic changes & typo fixing.
  • Loading branch information
mcoracin committed Mar 10, 2021
1 parent 0541680 commit 6dff819
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.0.2
4 changes: 2 additions & 2 deletions libloragw/src/loragw_cal.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ int sx125x_cal_tx_dc_offset(uint8_t rf_chain, uint32_t freq_hz, uint8_t dac_gain
int16_t offset_i_tmp = 0;
int16_t offset_q_tmp = 0;

printf("IQ sequence:");
printf("IQ sequence:\n");
for (i = 0; i < 9; i++) {
if (index[i] == 0) {
offset_i_tmp = offset_i_tmp + 0;
Expand Down Expand Up @@ -613,7 +613,7 @@ int sx125x_cal_tx_dc_offset(uint8_t rf_chain, uint32_t freq_hz, uint8_t dac_gain
sx1302_agc_wait_status(0x0c + 20);

#if DEBUG_CAL == 1
printf("TX_SIG values returned by signal analyzer:\n");
printf("TX_SIG values returned by signal analyzer:");
for (i = 0; i < 40; i++) {
if (i%5 == 0) {
printf("\n");
Expand Down
20 changes: 13 additions & 7 deletions libloragw/src/loragw_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
/* -------------------------------------------------------------------------- */
/* --- PRIVATE CONSTANTS & TYPES -------------------------------------------- */

#define FW_VERSION_AGC 10 /* Expected version of AGC firmware */
#define FW_VERSION_ARB 2 /* Expected version of arbiter firmware */
#define FW_VERSION_AGC_SX1250 10 /* Expected version of AGC firmware for sx1250 based gateway */
/* v10 is same as v6 with improved channel check time for LBT */
#define FW_VERSION_AGC_SX125X 6 /* Expected version of AGC firmware for sx1255/sx1257 based gateway */
#define FW_VERSION_ARB 2 /* Expected version of arbiter firmware */

/* Useful bandwidth of SX125x radios to consider depending on channel bandwidth */
/* Note: the below values come from lab measurements. For any question, please contact Semtech support */
Expand Down Expand Up @@ -845,6 +847,7 @@ int lgw_debug_setconf(struct lgw_conf_debug_s * conf) {

int lgw_start(void) {
int i, err;
uint8_t fw_version_agc;

DEBUG_PRINTF(" --- %s\n", "IN");

Expand Down Expand Up @@ -892,7 +895,7 @@ int lgw_start(void) {
err = sx125x_setup(i, CONTEXT_BOARD.clksrc, true, CONTEXT_RF_CHAIN[i].type, CONTEXT_RF_CHAIN[i].freq_hz);
break;
default:
DEBUG_PRINTF("ERROR: RADIO TYPE NOT SUPPORTED (RF_CHAIN %d)\n", i);
printf("ERROR: RADIO TYPE NOT SUPPORTED (RF_CHAIN %d)\n", i);
return LGW_HAL_ERROR;
}
if (err != LGW_REG_SUCCESS) {
Expand Down Expand Up @@ -1009,6 +1012,7 @@ int lgw_start(void) {
printf("ERROR: failed to load AGC firmware for sx1250\n");
return LGW_HAL_ERROR;
}
fw_version_agc = FW_VERSION_AGC_SX1250;
break;
case LGW_RADIO_TYPE_SX1255:
case LGW_RADIO_TYPE_SX1257:
Expand All @@ -1018,11 +1022,13 @@ int lgw_start(void) {
printf("ERROR: failed to load AGC firmware for sx125x\n");
return LGW_HAL_ERROR;
}
fw_version_agc = FW_VERSION_AGC_SX125X;
break;
default:
break;
printf("ERROR: failed to load AGC firmware, radio type not supported (%d)\n", CONTEXT_RF_CHAIN[CONTEXT_BOARD.clksrc].type);
return LGW_HAL_ERROR;
}
err = sx1302_agc_start(FW_VERSION_AGC, CONTEXT_RF_CHAIN[CONTEXT_BOARD.clksrc].type, SX1302_AGC_RADIO_GAIN_AUTO, SX1302_AGC_RADIO_GAIN_AUTO, CONTEXT_BOARD.full_duplex, CONTEXT_SX1261.lbt_conf.enable);
err = sx1302_agc_start(fw_version_agc, CONTEXT_RF_CHAIN[CONTEXT_BOARD.clksrc].type, SX1302_AGC_RADIO_GAIN_AUTO, SX1302_AGC_RADIO_GAIN_AUTO, CONTEXT_BOARD.full_duplex, CONTEXT_SX1261.lbt_conf.enable);
if (err != LGW_REG_SUCCESS) {
printf("ERROR: failed to start AGC firmware\n");
return LGW_HAL_ERROR;
Expand Down Expand Up @@ -1098,7 +1104,7 @@ int lgw_start(void) {

err = stts751_configure(ts_fd, ts_addr);
if (err != LGW_I2C_SUCCESS) {
printf("INFO: no temeprature sensor found on port 0x%02X\n", ts_addr);
printf("INFO: no temperature sensor found on port 0x%02X\n", ts_addr);
i2c_linuxdev_close(ts_fd);
ts_fd = -1;
} else {
Expand All @@ -1107,7 +1113,7 @@ int lgw_start(void) {
}
}
if (i == sizeof I2C_PORT_TEMP_SENSOR) {
printf("ERROR: no temeprature sensor found.\n");
printf("ERROR: no temperature sensor found.\n");
return LGW_HAL_ERROR;
}

Expand Down
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ found in the `libtools` directory.

## 7. Changelog

### v2.0.2 ###

> #### Updates
Fixed AGC firmware version check for sx1255/sx1257 based platforms (full-duplex
gateways...).

> #### Changes
* HAL: AGC firmware version for sx1255/sx1257 based gateways is v6.
* HAL: minor cosmetic changes & typo fixing.

### v2.0.1 ###

> #### Updates
Expand Down

0 comments on commit 6dff819

Please sign in to comment.