Compare commits

..

No commits in common. "master" and "v1.4.7" have entirely different histories.

85 changed files with 950 additions and 4473 deletions

1
.gitignore vendored
View file

@ -5,4 +5,3 @@ bin/
GitVersion\.h GitVersion\.h
.vscode/

View file

@ -1,7 +1,6 @@
/* /*
* Copyright (C) 2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM * Copyright (C) 2016 by Jim McLaughlin KI6ZUM
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
* *
* Some of the code is based on work of Guus Van Dooren PE1PLM: * Some of the code is based on work of Guus Van Dooren PE1PLM:
@ -49,13 +48,14 @@ uint16_t m_dmrDev;
uint16_t m_ysfDev; uint16_t m_ysfDev;
uint16_t m_p25Dev; uint16_t m_p25Dev;
uint16_t m_nxdnDev; uint16_t m_nxdnDev;
uint16_t m_m17Dev;
uint16_t m_pocsagDev; uint16_t m_pocsagDev;
static void Send_AD7021_control_shift() static void Send_AD7021_control_shift()
{ {
for (int AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) { int AD7021_counter;
if (bitRead(AD7021_control_word, AD7021_counter) == HIGH)
for(AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) {
if(bitRead(AD7021_control_word, AD7021_counter) == HIGH)
io.SDATA_pin(HIGH); io.SDATA_pin(HIGH);
else else
io.SDATA_pin(LOW); io.SDATA_pin(LOW);
@ -65,7 +65,6 @@ static void Send_AD7021_control_shift()
io.dlybit(); io.dlybit();
io.SCLK_pin(LOW); io.SCLK_pin(LOW);
} }
// to keep SDATA signal at defined level when idle (not required) // to keep SDATA signal at defined level when idle (not required)
io.SDATA_pin(LOW); io.SDATA_pin(LOW);
} }
@ -81,8 +80,9 @@ void Send_AD7021_control(bool doSle)
{ {
Send_AD7021_control_shift(); Send_AD7021_control_shift();
if (doSle) if (doSle) {
Send_AD7021_control_slePulse(); Send_AD7021_control_slePulse();
}
} }
#if defined(DUPLEX) #if defined(DUPLEX)
@ -97,8 +97,9 @@ void Send_AD7021_control2(bool doSle)
{ {
Send_AD7021_control_shift(); Send_AD7021_control_shift();
if (doSle) if (doSle) {
Send_AD7021_control_sle2Pulse(); Send_AD7021_control_sle2Pulse();
}
} }
#endif #endif
@ -107,14 +108,15 @@ uint16_t CIO::readRSSI()
{ {
uint32_t AD7021_RB; uint32_t AD7021_RB;
uint16_t RB_word = 0U; uint16_t RB_word = 0U;
int AD7021_counter;
uint8_t RB_code, gain_code, gain_corr; uint8_t RB_code, gain_code, gain_corr;
// Register 7, readback enable, ADC RSSI mode // Register 7, readback enable, ADC RSSI mode
AD7021_RB = 0x0147; AD7021_RB = 0x0147;
// Send control register // Send control register
for (int AD7021_counter = 8; AD7021_counter >= 0; AD7021_counter--) { for(AD7021_counter = 8; AD7021_counter >= 0; AD7021_counter--) {
if (bitRead(AD7021_RB, AD7021_counter) == HIGH) if(bitRead(AD7021_RB, AD7021_counter) == HIGH)
SDATA_pin(HIGH); SDATA_pin(HIGH);
else else
SDATA_pin(LOW); SDATA_pin(LOW);
@ -126,38 +128,23 @@ uint16_t CIO::readRSSI()
} }
SDATA_pin(LOW); SDATA_pin(LOW);
#if defined(DUPLEX)
if (m_duplex || m_calState == STATE_RSSICAL)
SLE2_pin(HIGH);
else
SLE_pin(HIGH);
#else
SLE_pin(HIGH); SLE_pin(HIGH);
#endif
dlybit(); dlybit();
// Read SREAD pin // Read SREAD pin
for (int AD7021_counter = 17; AD7021_counter >= 0; AD7021_counter--) { for(AD7021_counter = 17; AD7021_counter >= 0; AD7021_counter--) {
SCLK_pin(HIGH); SCLK_pin(HIGH);
dlybit(); dlybit();
if ((AD7021_counter != 17) && (AD7021_counter != 0)) if( (AD7021_counter != 17) && (AD7021_counter != 0) )
RB_word |= ((SREAD_pin() & 0x01) << (AD7021_counter - 1)); RB_word |= ( (SREAD_pin() & 0x01) << (AD7021_counter-1) );
SCLK_pin(LOW); SCLK_pin(LOW);
dlybit(); dlybit();
} }
#if defined(DUPLEX)
if (m_duplex || m_calState == STATE_RSSICAL)
SLE2_pin(LOW);
else
SLE_pin(LOW);
#else
SLE_pin(LOW); SLE_pin(LOW);
#endif
// Process RSSI code // Process RSSI code
RB_code = RB_word & 0x7f; RB_code = RB_word & 0x7f;
@ -213,12 +200,8 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
m_frequency_rx = m_pocsag_freq_tx; m_frequency_rx = m_pocsag_freq_tx;
} }
#if defined (ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS)
io.checkBand(m_frequency_rx, m_frequency_tx);
#endif
// Toggle CE pin for ADF7021 reset // Toggle CE pin for ADF7021 reset
if (reset) { if(reset) {
CE_pin(LOW); CE_pin(LOW);
delay_reset(); delay_reset();
CE_pin(HIGH); CE_pin(HIGH);
@ -226,24 +209,28 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
} }
// Check frequency band // Check frequency band
if ((m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX)) { if( (m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX)) { }
else if( (m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX)) { }
else if( (m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX)) { }
else if( (m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO
div2 = 2U; div2 = 2U;
} else { }
else {
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
div2 = 1U; div2 = 1U;
} }
if (div2 == 1U) if(div2 == 1U)
f_div = 2U; f_div = 2U;
else else
f_div = 1U; f_div = 1U;
@ -266,17 +253,14 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
case STATE_NXDN: case STATE_NXDN:
AFC_OFFSET = AFC_OFFSET_NXDN; AFC_OFFSET = AFC_OFFSET_NXDN;
break; break;
case STATE_M17:
AFC_OFFSET = AFC_OFFSET_M17;
break;
default: default:
break; break;
} }
if (div2 == 1U) if( div2 == 1U )
divider = (m_frequency_rx - 100000 + AFC_OFFSET) / (ADF7021_PFD / 2U); divider = (m_frequency_rx - 100000 + AFC_OFFSET) / (ADF7021_PFD / 2U);
else else
divider = (m_frequency_rx - 100000 + (2 * AFC_OFFSET)) / ADF7021_PFD; divider = (m_frequency_rx - 100000 + (2*AFC_OFFSET)) / ADF7021_PFD;
m_RX_N_divider = floor(divider); m_RX_N_divider = floor(divider);
divider = (divider - m_RX_N_divider) * 32768; divider = (divider - m_RX_N_divider) * 32768;
@ -293,7 +277,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
ADF7021_RX_REG0 |= (uint32_t) m_RX_N_divider << 19; // frequency; ADF7021_RX_REG0 |= (uint32_t) m_RX_N_divider << 19; // frequency;
ADF7021_RX_REG0 |= (uint32_t) m_RX_F_divider << 4; // frequency; ADF7021_RX_REG0 |= (uint32_t) m_RX_F_divider << 4; // frequency;
if (div2 == 1U) if( div2 == 1U )
divider = m_frequency_tx / (ADF7021_PFD / 2U); divider = m_frequency_tx / (ADF7021_PFD / 2U);
else else
divider = m_frequency_tx / ADF7021_PFD; divider = m_frequency_tx / ADF7021_PFD;
@ -415,7 +399,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
break; break;
case STATE_YSF: case STATE_YSF:
// Dev: +1 symb 900/450 Hz, symb rate = 4800 // Dev: +1 symb 900 Hz, symb rate = 4800
ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H); ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H);
ADF7021_REG10 = ADF7021_REG10_YSF; ADF7021_REG10 = ADF7021_REG10_YSF;
@ -495,33 +479,6 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
#endif #endif
break; break;
case STATE_M17:
// Dev: +1 symb 800 Hz, symb rate = 4800
ADF7021_REG3 = ADF7021_REG3_M17;
ADF7021_REG10 = ADF7021_REG10_M17;
// K=32
ADF7021_REG4 = (uint32_t) 0b0100 << 0; // register 4
ADF7021_REG4 |= (uint32_t) 0b011 << 4; // mode, 4FSK
ADF7021_REG4 |= (uint32_t) 0b0 << 7;
ADF7021_REG4 |= (uint32_t) 0b11 << 8;
ADF7021_REG4 |= (uint32_t) ADF7021_DISC_BW_M17 << 10; // Disc BW
ADF7021_REG4 |= (uint32_t) ADF7021_POST_BW_M17 << 20; // Post dem BW
ADF7021_REG4 |= (uint32_t) 0b10 << 30; // IF filter (25 kHz)
ADF7021_REG13 = (uint32_t) 0b1101 << 0; // register 13
ADF7021_REG13 |= (uint32_t) ADF7021_SLICER_TH_M17 << 4; // slicer threshold
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
ADF7021_REG2 |= (uint32_t) (m_m17Dev / div2) << 19; // deviation
#if defined(ADF7021_DISABLE_RC_4FSK)
ADF7021_REG2 |= (uint32_t) 0b011 << 4; // modulation (4FSK)
#else
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
#endif
break;
default: default:
break; break;
} }
@ -614,7 +571,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
} }
#if defined(DUPLEX) #if defined(DUPLEX)
if (m_duplex && (modemState != STATE_CWID && modemState != STATE_POCSAG)) if(m_duplex && (modemState != STATE_CWID && modemState != STATE_POCSAG))
ifConf2(modemState); ifConf2(modemState);
#endif #endif
} }
@ -676,7 +633,7 @@ void CIO::ifConf2(MMDVM_STATE modemState)
break; break;
case STATE_YSF: case STATE_YSF:
// Dev: +1 symb 900/450 Hz, symb rate = 4800 // Dev: +1 symb 900 Hz, symb rate = 4800
ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H); ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H);
ADF7021_REG10 = ADF7021_REG10_YSF; ADF7021_REG10 = ADF7021_REG10_YSF;
@ -744,29 +701,6 @@ void CIO::ifConf2(MMDVM_STATE modemState)
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK) ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
break; break;
case STATE_M17:
// Dev: +1 symb 800 Hz, symb rate = 4800
ADF7021_REG3 = ADF7021_REG3_M17;
ADF7021_REG10 = ADF7021_REG10_M17;
// K=32
ADF7021_REG4 = (uint32_t) 0b0100 << 0; // register 4
ADF7021_REG4 |= (uint32_t) 0b011 << 4; // mode, 4FSK
ADF7021_REG4 |= (uint32_t) 0b0 << 7;
ADF7021_REG4 |= (uint32_t) 0b11 << 8;
ADF7021_REG4 |= (uint32_t) ADF7021_DISC_BW_M17 << 10; // Disc BW
ADF7021_REG4 |= (uint32_t) ADF7021_POST_BW_M17 << 20; // Post dem BW
ADF7021_REG4 |= (uint32_t) 0b10 << 30; // IF filter (25 kHz)
ADF7021_REG13 = (uint32_t) 0b1101 << 0; // register 13
ADF7021_REG13 |= (uint32_t) ADF7021_SLICER_TH_M17 << 4; // slicer threshold
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
ADF7021_REG2 |= (uint32_t) (m_m17Dev / div2) << 19; // deviation
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
break;
default: default:
break; break;
} }
@ -853,23 +787,25 @@ void CIO::interrupt()
// possibly this is a design problem of the RF7021 board or too long wires // possibly this is a design problem of the RF7021 board or too long wires
// on the breadboard build // on the breadboard build
// but normally this will not hurt too much // but normally this will not hurt too much
if (clk == last_clk) if (clk == last_clk) {
return; return;
else } else {
last_clk = clk; last_clk = clk;
}
// we set the TX bit at TXD low, sampling of ADF7021 happens at rising clock // we set the TX bit at TXD low, sampling of ADF7021 happens at rising clock
if (m_tx && clk == 0U) { if (m_tx && clk == 0U) {
m_txBuffer.get(bit, m_control); m_txBuffer.get(bit, m_control);
even = !even; even = !even;
#if defined(BIDIR_DATA_PIN) #if defined(BIDIR_DATA_PIN)
if (bit) if(bit)
RXD_pin_write(HIGH); RXD_pin_write(HIGH);
else else
RXD_pin_write(LOW); RXD_pin_write(LOW);
#else #else
if (bit) if(bit)
TXD_pin(HIGH); TXD_pin(HIGH);
else else
TXD_pin(LOW); TXD_pin(LOW);
@ -901,7 +837,7 @@ void CIO::interrupt()
// we sample the RX bit at rising TXD clock edge, so TXD must be 1 and we are not in tx mode // we sample the RX bit at rising TXD clock edge, so TXD must be 1 and we are not in tx mode
if (!m_tx && clk == 1U && !m_duplex) { if (!m_tx && clk == 1U && !m_duplex) {
if (RXD_pin()) if(RXD_pin())
bit = 1U; bit = 1U;
else else
bit = 0U; bit = 0U;
@ -909,7 +845,7 @@ void CIO::interrupt()
m_rxBuffer.put(bit, m_control); m_rxBuffer.put(bit, m_control);
} }
if (torx_request && even == ADF7021_EVEN_BIT && m_tx && clk == 0U) { if (torx_request == true && even == ADF7021_EVEN_BIT && m_tx && clk == 0U) {
// that is absolutely crucial in 4FSK, see datasheet: // that is absolutely crucial in 4FSK, see datasheet:
// enable sle after 1/4 tBit == 26uS when sending MSB (even == false) and clock is low // enable sle after 1/4 tBit == 26uS when sending MSB (even == false) and clock is low
delay_us(26U); delay_us(26U);
@ -933,12 +869,11 @@ void CIO::interrupt()
m_watchdog++; m_watchdog++;
m_modeTimerCnt++; m_modeTimerCnt++;
m_int1counter++;
if (m_scanPauseCnt >= SCAN_PAUSE) if(m_scanPauseCnt >= SCAN_PAUSE)
m_scanPauseCnt = 0U; m_scanPauseCnt = 0U;
if (m_scanPauseCnt != 0U) if(m_scanPauseCnt != 0U)
m_scanPauseCnt++; m_scanPauseCnt++;
} }
@ -947,16 +882,14 @@ void CIO::interrupt2()
{ {
uint8_t bit = 0U; uint8_t bit = 0U;
if (m_duplex) { if(m_duplex) {
if (RXD2_pin()) if(RXD2_pin())
bit = 1U; bit = 1U;
else else
bit = 0U; bit = 0U;
m_rxBuffer.put(bit, m_control); m_rxBuffer.put(bit, m_control);
} }
m_int2counter++;
} }
#endif #endif
@ -992,7 +925,7 @@ void CIO::setRX(bool doSle)
Data_dir_out(false); // Data pin input mode Data_dir_out(false); // Data pin input mode
#endif #endif
if (!doSle) { if(!doSle) {
torx_request = true; torx_request = true;
while(torx_request) { asm volatile ("nop"); } while(torx_request) { asm volatile ("nop"); }
} }
@ -1003,7 +936,7 @@ void CIO::setPower(uint8_t power)
m_power = power >> 2; m_power = power >> 2;
} }
void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t m17TXLevel, uint8_t pocsagTXLevel, bool ysfLoDev) void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t pocsagTXLevel, bool ysfLoDev)
{ {
m_dstarDev = uint16_t((ADF7021_DEV_DSTAR * uint16_t(dstarTXLevel)) / 128U); m_dstarDev = uint16_t((ADF7021_DEV_DSTAR * uint16_t(dstarTXLevel)) / 128U);
m_dmrDev = uint16_t((ADF7021_DEV_DMR * uint16_t(dmrTXLevel)) / 128U); m_dmrDev = uint16_t((ADF7021_DEV_DMR * uint16_t(dmrTXLevel)) / 128U);
@ -1015,7 +948,6 @@ void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXL
m_p25Dev = uint16_t((ADF7021_DEV_P25 * uint16_t(p25TXLevel)) / 128U); m_p25Dev = uint16_t((ADF7021_DEV_P25 * uint16_t(p25TXLevel)) / 128U);
m_nxdnDev = uint16_t((ADF7021_DEV_NXDN * uint16_t(nxdnTXLevel)) / 128U); m_nxdnDev = uint16_t((ADF7021_DEV_NXDN * uint16_t(nxdnTXLevel)) / 128U);
m_m17Dev = uint16_t((ADF7021_DEV_M17 * uint16_t(m17TXLevel)) / 128U);
m_pocsagDev = uint16_t((ADF7021_DEV_POCSAG * uint16_t(pocsagTXLevel)) / 128U); m_pocsagDev = uint16_t((ADF7021_DEV_POCSAG * uint16_t(pocsagTXLevel)) / 128U);
} }
@ -1025,24 +957,28 @@ void CIO::updateCal()
float divider; float divider;
// Check frequency band // Check frequency band
if ((m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX)) { if( (m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX)) { }
else if( (m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX)) { }
else if( (m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
div2 = 1U; div2 = 1U;
} else if ((m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX)) { }
else if( (m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX) ) {
ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO
div2 = 2U; div2 = 2U;
} else { }
else {
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
div2 = 1U; div2 = 1U;
} }
if (div2 == 1U) if(div2 == 1U)
f_div = 2U; f_div = 2U;
else else
f_div = 1U; f_div = 1U;
@ -1052,15 +988,8 @@ void CIO::updateCal()
Send_AD7021_control(); Send_AD7021_control();
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5) ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
ADF7021_REG2 |= (uint32_t) (m_dmrDev / div2) << 19; // deviation
if (m_modemState == STATE_DMR) { ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
ADF7021_REG2 |= (uint32_t) (m_dmrDev / div2) << 19; // DMR deviation
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
} else if (m_modemState == STATE_POCSAG) {
ADF7021_REG2 |= (uint32_t) (m_pocsagDev / div2) << 19; // POCSAG deviation
ADF7021_REG2 |= (uint32_t) 0b000 << 4; // modulation (2FSK)
}
ADF7021_REG2 |= (uint32_t) 0b0010; // register 2 ADF7021_REG2 |= (uint32_t) 0b0010; // register 2
ADF7021_REG2 |= (uint32_t) m_power << 13; // power level ADF7021_REG2 |= (uint32_t) m_power << 13; // power level
ADF7021_REG2 |= (uint32_t) 0b110001 << 7; // PA ADF7021_REG2 |= (uint32_t) 0b110001 << 7; // PA
@ -1068,7 +997,7 @@ void CIO::updateCal()
AD7021_control_word = ADF7021_REG2; AD7021_control_word = ADF7021_REG2;
Send_AD7021_control(); Send_AD7021_control();
if (div2 == 1U) if( div2 == 1U )
divider = m_frequency_tx / (ADF7021_PFD / 2U); divider = m_frequency_tx / (ADF7021_PFD / 2U);
else else
divider = m_frequency_tx / ADF7021_PFD; divider = m_frequency_tx / ADF7021_PFD;
@ -1131,11 +1060,6 @@ uint16_t CIO::devNXDN()
return (uint16_t)((ADF7021_PFD * m_nxdnDev) / (f_div * 65536)); return (uint16_t)((ADF7021_PFD * m_nxdnDev) / (f_div * 65536));
} }
uint16_t CIO::devM17()
{
return (uint16_t)((ADF7021_PFD * m_m17Dev) / (f_div * 65536));
}
uint16_t CIO::devPOCSAG() uint16_t CIO::devPOCSAG()
{ {
return (uint16_t)((ADF7021_PFD * m_pocsagDev) / (f_div * 65536)); return (uint16_t)((ADF7021_PFD * m_pocsagDev) / (f_div * 65536));
@ -1152,7 +1076,6 @@ void CIO::printConf()
DEBUG2("YSF +1 sym dev (Hz):", devYSF()); DEBUG2("YSF +1 sym dev (Hz):", devYSF());
DEBUG2("P25 +1 sym dev (Hz):", devP25()); DEBUG2("P25 +1 sym dev (Hz):", devP25());
DEBUG2("NXDN +1 sym dev (Hz):", devNXDN()); DEBUG2("NXDN +1 sym dev (Hz):", devNXDN());
DEBUG2("M17 +1 sym dev (Hz):", devM17());
DEBUG2("POCSAG dev (Hz):", devPOCSAG()); DEBUG2("POCSAG dev (Hz):", devPOCSAG());
} }

View file

@ -1,5 +1,4 @@
/* /*
* Copyright (C) 2020 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM * Copyright (C) 2016 by Jim McLaughlin KI6ZUM
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
@ -53,7 +52,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
// Support for ADF7021-N version: // Support for ADF7021-N version:
// #define ADF7021_N_VER // #define ADF7021_N_VER
// Enable AFC support for DMR, YSF, P25, and M17 (experimental): // Enable AFC support for DMR, YSF and P25 (experimental):
// (AFC is already enabled by default in D-Star) // (AFC is already enabled by default in D-Star)
// #define ADF7021_ENABLE_4FSK_AFC // #define ADF7021_ENABLE_4FSK_AFC
@ -66,7 +65,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
// R = 4 // R = 4
// DEMOD_CLK = 2.4576 MHz (DSTAR) // DEMOD_CLK = 2.4576 MHz (DSTAR)
// DEMOD_CLK = 4.9152 MHz (DMR, YSF_L, P25) // DEMOD_CLK = 4.9152 MHz (DMR, YSF_L, P25)
// DEMOD_CLK = 7.3728 MHz (YSF_H, M17) // DEMOD_CLK = 7.3728 MHz (YSF_H)
// DEMOD CLK = 3.6864 MHz (NXDN) // DEMOD CLK = 3.6864 MHz (NXDN)
// DEMOD_CLK = 7.3728 MHz (POCSAG) // DEMOD_CLK = 7.3728 MHz (POCSAG)
#define ADF7021_PFD 3686400.0 #define ADF7021_PFD 3686400.0
@ -88,7 +87,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_DEV_P25 22U #define ADF7021_DEV_P25 22U
#endif #endif
#define ADF7021_DEV_NXDN 13U #define ADF7021_DEV_NXDN 13U
#define ADF7021_DEV_M17 28U
#define ADF7021_DEV_POCSAG 160U #define ADF7021_DEV_POCSAG 160U
// TX/RX CLOCK register (REG 03) // TX/RX CLOCK register (REG 03)
@ -99,14 +97,12 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_REG3_YSF_H 0x2A4C0493 #define ADF7021_REG3_YSF_H 0x2A4C0493
#define ADF7021_REG3_P25 0x2A4C04D3 #define ADF7021_REG3_P25 0x2A4C04D3
#define ADF7021_REG3_NXDN 0x2A4C04D3 #define ADF7021_REG3_NXDN 0x2A4C04D3
#define ADF7021_REG3_M17 0x2A4C04D3
#else #else
#define ADF7021_REG3_DMR 0x2A4C80D3 #define ADF7021_REG3_DMR 0x2A4C80D3
#define ADF7021_REG3_YSF_L 0x2A4C80D3 #define ADF7021_REG3_YSF_L 0x2A4C80D3
#define ADF7021_REG3_YSF_H 0x2A4CC093 #define ADF7021_REG3_YSF_H 0x2A4CC093
#define ADF7021_REG3_P25 0x2A4C80D3 #define ADF7021_REG3_P25 0x2A4C80D3
#define ADF7021_REG3_NXDN 0x2A4CC113 #define ADF7021_REG3_NXDN 0x2A4CC113
#define ADF7021_REG3_M17 0x2A4CC093
#endif #endif
#define ADF7021_REG3_POCSAG 0x2A4F0093 #define ADF7021_REG3_POCSAG 0x2A4F0093
@ -118,7 +114,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_DISC_BW_YSF_H 516U // K=28 #define ADF7021_DISC_BW_YSF_H 516U // K=28
#define ADF7021_DISC_BW_P25 394U // K=32 #define ADF7021_DISC_BW_P25 394U // K=32
#define ADF7021_DISC_BW_NXDN 295U // K=32 #define ADF7021_DISC_BW_NXDN 295U // K=32
#define ADF7021_DISC_BW_M17 590U // K=32
#define ADF7021_DISC_BW_POCSAG 406U // K=22 #define ADF7021_DISC_BW_POCSAG 406U // K=22
// Post demodulator bandwith (REG 04) // Post demodulator bandwith (REG 04)
@ -127,7 +122,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_POST_BW_YSF 20U #define ADF7021_POST_BW_YSF 20U
#define ADF7021_POST_BW_P25 6U #define ADF7021_POST_BW_P25 6U
#define ADF7021_POST_BW_NXDN 7U #define ADF7021_POST_BW_NXDN 7U
#define ADF7021_POST_BW_M17 7U // Test
#define ADF7021_POST_BW_POCSAG 1U #define ADF7021_POST_BW_POCSAG 1U
// IF filter (REG 05) // IF filter (REG 05)
@ -145,31 +139,26 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_REG10_YSF 0x01FE473A #define ADF7021_REG10_YSF 0x01FE473A
#define ADF7021_REG10_P25 0x01FE473A #define ADF7021_REG10_P25 0x01FE473A
#define ADF7021_REG10_NXDN 0x01FE473A #define ADF7021_REG10_NXDN 0x01FE473A
#define ADF7021_REG10_M17 0x01FE473A
#if defined(ADF7021_AFC_POS) #if defined(ADF7021_AFC_POS)
#define AFC_OFFSET_DMR -250 #define AFC_OFFSET_DMR -250
#define AFC_OFFSET_YSF -250 #define AFC_OFFSET_YSF -250
#define AFC_OFFSET_P25 -250 #define AFC_OFFSET_P25 -250
#define AFC_OFFSET_NXDN -250 #define AFC_OFFSET_NXDN -250
#define AFC_OFFSET_M17 -250
#else #else
#define AFC_OFFSET_DMR 250 #define AFC_OFFSET_DMR 250
#define AFC_OFFSET_YSF 250 #define AFC_OFFSET_YSF 250
#define AFC_OFFSET_P25 250 #define AFC_OFFSET_P25 250
#define AFC_OFFSET_NXDN 250 #define AFC_OFFSET_NXDN 250
#define AFC_OFFSET_M17 250
#endif #endif
#else #else
#define ADF7021_REG10_DMR 0x049E472A #define ADF7021_REG10_DMR 0x049E472A
#define ADF7021_REG10_YSF 0x049E472A #define ADF7021_REG10_YSF 0x049E472A
#define ADF7021_REG10_P25 0x049E472A #define ADF7021_REG10_P25 0x049E472A
#define ADF7021_REG10_NXDN 0x049E472A #define ADF7021_REG10_NXDN 0x049E472A
#define ADF7021_REG10_M17 0x049E472A
#define AFC_OFFSET_DMR 0 #define AFC_OFFSET_DMR 0
#define AFC_OFFSET_YSF 0 #define AFC_OFFSET_YSF 0
#define AFC_OFFSET_P25 0 #define AFC_OFFSET_P25 0
#define AFC_OFFSET_NXDN 0 #define AFC_OFFSET_NXDN 0
#define AFC_OFFSET_M17 0
#endif #endif
/****** Support for 12.2880 MHz TCXO ******/ /****** Support for 12.2880 MHz TCXO ******/
@ -177,7 +166,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
// R = 2 // R = 2
// DEMOD_CLK = 2.4576 MHz (DSTAR) // DEMOD_CLK = 2.4576 MHz (DSTAR)
// DEMOD_CLK = 6.1440 MHz (DMR, YSF_H, YSF_L, P25, M17) // DEMOD_CLK = 6.1440 MHz (DMR, YSF_H, YSF_L, P25)
// DEMOD_CLK = 3.0720 MHz (NXDN) // DEMOD_CLK = 3.0720 MHz (NXDN)
// DEMOD_CLK = 6.1440 MHz (POCSAG) // DEMOD_CLK = 6.1440 MHz (POCSAG)
#define ADF7021_PFD 6144000.0 #define ADF7021_PFD 6144000.0
@ -199,7 +188,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_DEV_P25 13U #define ADF7021_DEV_P25 13U
#endif #endif
#define ADF7021_DEV_NXDN 8U #define ADF7021_DEV_NXDN 8U
#define ADF7021_DEV_M17 17U
#define ADF7021_DEV_POCSAG 96U #define ADF7021_DEV_POCSAG 96U
// TX/RX CLOCK register (REG 03) // TX/RX CLOCK register (REG 03)
@ -210,14 +198,12 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_REG3_YSF_H 0x29EC0493 #define ADF7021_REG3_YSF_H 0x29EC0493
#define ADF7021_REG3_P25 0x29EC0493 #define ADF7021_REG3_P25 0x29EC0493
#define ADF7021_REG3_NXDN 0x29EC0493 #define ADF7021_REG3_NXDN 0x29EC0493
#define ADF7021_REG3_M17 0x29EC0493
#else #else
#define ADF7021_REG3_DMR 0x29ECA093 #define ADF7021_REG3_DMR 0x29ECA093
#define ADF7021_REG3_YSF_L 0x29ECA093 #define ADF7021_REG3_YSF_L 0x29ECA093
#define ADF7021_REG3_YSF_H 0x29ECA093 #define ADF7021_REG3_YSF_H 0x29ECA093
#define ADF7021_REG3_P25 0x29ECA093 #define ADF7021_REG3_P25 0x29ECA093
#define ADF7021_REG3_NXDN 0x29ECA113 #define ADF7021_REG3_NXDN 0x29ECA113
#define ADF7021_REG3_M17 0x29ECA093
#endif #endif
#define ADF7021_REG3_POCSAG 0x29EE8093 #define ADF7021_REG3_POCSAG 0x29EE8093
@ -229,7 +215,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_DISC_BW_YSF_H 430U // K=28 #define ADF7021_DISC_BW_YSF_H 430U // K=28
#define ADF7021_DISC_BW_P25 493U // K=32 #define ADF7021_DISC_BW_P25 493U // K=32
#define ADF7021_DISC_BW_NXDN 246U // K=32 #define ADF7021_DISC_BW_NXDN 246U // K=32
#define ADF7021_DISC_BW_M17 492U // K=32
#define ADF7021_DISC_BW_POCSAG 338U // K=22 #define ADF7021_DISC_BW_POCSAG 338U // K=22
// Post demodulator bandwith (REG 04) // Post demodulator bandwith (REG 04)
@ -238,7 +223,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_POST_BW_YSF 20U #define ADF7021_POST_BW_YSF 20U
#define ADF7021_POST_BW_P25 6U #define ADF7021_POST_BW_P25 6U
#define ADF7021_POST_BW_NXDN 8U #define ADF7021_POST_BW_NXDN 8U
#define ADF7021_POST_BW_M17 8U // Test
#define ADF7021_POST_BW_POCSAG 1U #define ADF7021_POST_BW_POCSAG 1U
// IF filter (REG 05) // IF filter (REG 05)
@ -256,31 +240,26 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_REG10_YSF 0x01FE557A #define ADF7021_REG10_YSF 0x01FE557A
#define ADF7021_REG10_P25 0x01FE557A #define ADF7021_REG10_P25 0x01FE557A
#define ADF7021_REG10_NXDN 0x01FE557A #define ADF7021_REG10_NXDN 0x01FE557A
#define ADF7021_REG10_M17 0x01FE557A
#if defined(ADF7021_AFC_POS) #if defined(ADF7021_AFC_POS)
#define AFC_OFFSET_DMR -250 #define AFC_OFFSET_DMR -250
#define AFC_OFFSET_YSF -250 #define AFC_OFFSET_YSF -250
#define AFC_OFFSET_P25 -250 #define AFC_OFFSET_P25 -250
#define AFC_OFFSET_NXDN -250 #define AFC_OFFSET_NXDN -250
#define AFC_OFFSET_M17 -250
#else #else
#define AFC_OFFSET_DMR 250 #define AFC_OFFSET_DMR 250
#define AFC_OFFSET_YSF 250 #define AFC_OFFSET_YSF 250
#define AFC_OFFSET_P25 250 #define AFC_OFFSET_P25 250
#define AFC_OFFSET_NXDN 250 #define AFC_OFFSET_NXDN 250
#define AFC_OFFSET_M17 250
#endif #endif
#else #else
#define ADF7021_REG10_DMR 0x049E556A #define ADF7021_REG10_DMR 0x049E556A
#define ADF7021_REG10_YSF 0x049E556A #define ADF7021_REG10_YSF 0x049E556A
#define ADF7021_REG10_P25 0x049E556A #define ADF7021_REG10_P25 0x049E556A
#define ADF7021_REG10_NXDN 0x049E556A #define ADF7021_REG10_NXDN 0x049E556A
#define ADF7021_REG10_M17 0x049E556A
#define AFC_OFFSET_DMR 0 #define AFC_OFFSET_DMR 0
#define AFC_OFFSET_YSF 0 #define AFC_OFFSET_YSF 0
#define AFC_OFFSET_P25 0 #define AFC_OFFSET_P25 0
#define AFC_OFFSET_NXDN 0 #define AFC_OFFSET_NXDN 0
#define AFC_OFFSET_M17 0
#endif #endif
#endif #endif
@ -294,7 +273,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_SLICER_TH_YSF_H 69U #define ADF7021_SLICER_TH_YSF_H 69U
#define ADF7021_SLICER_TH_P25 43U #define ADF7021_SLICER_TH_P25 43U
#define ADF7021_SLICER_TH_NXDN 26U #define ADF7021_SLICER_TH_NXDN 26U
#define ADF7021_SLICER_TH_M17 59U // Test
#else #else
@ -304,7 +282,6 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
#define ADF7021_SLICER_TH_YSF_H 75U #define ADF7021_SLICER_TH_YSF_H 75U
#define ADF7021_SLICER_TH_P25 47U #define ADF7021_SLICER_TH_P25 47U
#define ADF7021_SLICER_TH_NXDN 26U #define ADF7021_SLICER_TH_NXDN 26U
#define ADF7021_SLICER_TH_M17 59U // Test
#endif #endif

100
BUILD.md
View file

@ -169,19 +169,23 @@ Install the USB bootloader to STM32F103. Follow the instructions:
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/stm32duino-bootloader https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/stm32duino-bootloader
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file (you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation): Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file
(you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
My Documents/Arduino/hardware/Arduino_STM32/drivers/win/install_drivers.bat My Documents/Arduino/hardware/Arduino_STM32/drivers/win/install_drivers.bat
You have to be sure that Windows detect your ZUMspot as an USB serial device COMx (please see Windows Device Manager). You have to be sure that Windows detect your ZUMspot as an USB serial device COMx (please
see Windows Device Manager).
Download the source (zip file) of MMDVM_HS from: Download the source (zip file) of MMDVM_HS from:
https://github.com/juribeparada/MMDVM_HS https://github.com/juribeparada/MMDVM_HS
Do not download or install the STM32F103 library (STM32F10X_Lib) this is not necessary under STM32duino. Do not download or install the STM32F103 library (STM32F10X_Lib) this is not necessary
under STM32duino.
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this folder can't have spaces. Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this
folder can't have spaces.
Start the Arduino IDE. Open the MMDVM_HS.ino file in the MMDVM_HS folder. Start the Arduino IDE. Open the MMDVM_HS.ino file in the MMDVM_HS folder.
@ -203,7 +207,9 @@ Edit Config.h:
Click the Upload button in the IDE and wait for the transfer. Click the Upload button in the IDE and wait for the transfer.
Once the transfer is completed, press the RESET button of the board or disconnect and connect the USB cable. You will see the LED (PC13) of the blue pill blinking. Once you connect with MMDVMHost, the LED will blink fast. Once the transfer is completed, press the RESET button of the board or disconnect and
connect the USB cable. You will see the LED (PC13) of the blue pill blinking. Once you connect
with MMDVMHost, the LED will blink fast.
For further help with STM32duino and STM32F103 blue pill boards, please see the STM32duino [forum](http://www.stm32duino.com). For further help with STM32duino and STM32F103 blue pill boards, please see the STM32duino [forum](http://www.stm32duino.com).
@ -213,25 +219,29 @@ Download the source code (zip file) of MMDVM_HS from:
https://github.com/juribeparada/MMDVM_HS https://github.com/juribeparada/MMDVM_HS
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this folder can't have spaces. Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this
folder can't have spaces.
Download the ST libraries STM32F10X_Lib-master.zip from: Download the ST libraries STM32F10X_Lib-master.zip from:
https://github.com/juribeparada/STM32F10X_Lib/ https://github.com/juribeparada/STM32F10X_Lib/
Extract the STM32F10X_Lib-master folder into the same folder as the MMDVM_HS. Change the folder name to "STM32F10X_Lib". Extract the STM32F10X_Lib-master folder into the same folder as the MMDVM_HS. Change the folder
name to "STM32F10X_Lib".
Download the GNU make utility: Download the GNU make utility:
http://gnuwin32.sourceforge.net/packages/make.htm http://gnuwin32.sourceforge.net/packages/make.htm
Download the binaries zip file and extract make.exe and put it in the same directory MMDVM_HS. Download the dependencies zip file and extract libintl3.dll and libiconv2.dll and put them in the same directory MMDVM_HS. Download the binaries zip file and extract make.exe and put it in the same directory MMDVM_HS. Download
the dependencies zip file and extract libintl3.dll and libiconv2.dll and put them in the same directory MMDVM_HS.
Download the GNU ARM embedded toolchain from here: Download the GNU ARM embedded toolchain from here:
https://launchpad.net/gcc-arm-embedded/+download https://launchpad.net/gcc-arm-embedded/+download
Currently the direct link to the installer is here: Currently the direct link to the installer is here:
https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-win32.exe https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-win32.exe
Download STM32duino (Arduino for STM32) from this URL (only for USB drivers): Download STM32duino (Arduino for STM32) from this URL (only for USB drivers):
@ -242,7 +252,8 @@ Unzip and copy Arduino_STM32-ZUMspot folder in (for example):
C:\Arduino_STM32-ZUMspot C:\Arduino_STM32-ZUMspot
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file (you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation): Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file
(you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
C:\Arduino_STM32-ZUMspot\drivers\win\install_drivers.bat C:\Arduino_STM32-ZUMspot\drivers\win\install_drivers.bat
@ -310,7 +321,9 @@ If you are using Pi-Star, stop services:
sudo systemctl stop mmdvmhost.timer sudo systemctl stop mmdvmhost.timer
sudo systemctl stop mmdvmhost.service sudo systemctl stop mmdvmhost.service
Upload bootloader and firmware to ZUMspot Libre Kit, using serial port first (you are using an USB-serial converter with device name /dev/ttyUSB0). Move BOOT0 jumper to 1, next press and release RESET and execute: Upload bootloader and firmware to ZUMspot Libre Kit, using serial port first (you
are using an USB-serial converter with device name /dev/ttyUSB0). Move BOOT0
jumper to 1, next press and release RESET and execute:
sudo make serial-bl devser=/dev/ttyUSB0 sudo make serial-bl devser=/dev/ttyUSB0
@ -483,39 +496,25 @@ Please check here for detailed instructions:
- make mmdvm_hs_hat: upload the firmware to MMDVM_HS_Hat board (using internal RPi serial port) - make mmdvm_hs_hat: upload the firmware to MMDVM_HS_Hat board (using internal RPi serial port)
- make nano-hotspot: upload the firmware to Nano hotSPOT board (using internal serial port) - make dfu [devser=/dev/ttyXXX]: upload firmware using USB bootloader. "devser" is optional,
and it corresponds to the USB serial port device name. This option permits to perform a reset
- make nano-dv: upload the firmware to NanoDV board (using internal serial port) to enter to booloader mode (DFU). If you don't use "devser", you have to press the reset button
of the ZUMspot just before using this command.
- make d2rg_mmdvm_hs: upload the firmware to D2RG MMDVM_HS board (using internal serial port)
- make skybridge: upload the firmware to SkyBridge HotSpot board (using internal serial port)
- make dfu [devser=/dev/ttyXXX]: upload firmware using USB bootloader. "devser" is optional, and it corresponds to the USB serial port device name. This option permits to perform a reset to enter to booloader mode (DFU). If you don't use "devser", you have to press the reset button of the ZUMspot just before using this command.
- make serial devser=/dev/ttyXXX: upload standard firmware using serial port bootloader method. - make serial devser=/dev/ttyXXX: upload standard firmware using serial port bootloader method.
- make serial-bl devser=/dev/ttyXXX: upload firmware with USB bootloader support using serial port bootloader method. - make serial-bl devser=/dev/ttyXXX: upload firmware with USB bootloader support using serial
port bootloader method.
- make serial-nobl devser=/dev/ttyXXX: upload firmware with USB support using serial port bootloader method, but without USB bootloader installation.
- make serial-bl-old devser=/dev/ttyXXX: same as "make serial-bl" but using bootloader with short reset pulse.
- make stlink: upload standard firmware using ST-Link interface. - make stlink: upload standard firmware using ST-Link interface.
- make stlink-bl: upload firmware with USB bootloader support using ST-Link interface. - make stlink-bl: upload firmware with USB bootloader support using ST-Link interface.
- make stlink-nobl: upload firmware with USB support using ST-Link interface, but without USB bootloader. - make ocd: upload standard firmware using ST-Link interface. This method uses a local
openocd installation.
- make stlink-bl-old: same as "make stlink-bl" but using bootloader with short reset pulse. - make ocd-bl: upload firmware with USB bootloader support using ST-Link interface. This
method uses a local openocd installation.
- make ocd: upload standard firmware using ST-Link interface. This method uses a local openocd installation.
- make ocd-nobl: upload firmware with USB support using ST-Link interface, but without USB bootloader. This method uses a local openocd installation.
- make ocd-bl: upload firmware with USB bootloader support using ST-Link interface. This method uses a local openocd installation.
- make ocd-bl-old: same as "make ocd-bl" but using bootloader with short reset pulse.
## Common Makefile commands ## Common Makefile commands
@ -540,9 +539,11 @@ ZUMspot RPi (no USB support needed):
# Config.h options # Config.h options
- #define ZUMSPOT_ADF7021: enable pinouts support for ZUMspot RPi or ZUMspot USB. You have to enable this option if you have one of these products. - #define ZUMSPOT_ADF7021: enable pinouts support for ZUMspot RPi or ZUMspot USB. You have
to enable this option if you have one of these products.
- #define LIBRE_KIT_ADF7021: enable this option if you have a ZUMspot Libre Kit (Board with modified RF7021SE and Blue Pill STM32F103). - #define LIBRE_KIT_ADF7021: enable this option if you have a ZUMspot Libre Kit (Board with
modified RF7021SE and Blue Pill STM32F103).
- #define MMDVM_HS_HAT_REV12: enable this option if you have a MMDVM_HS_Hat board for RPi. - #define MMDVM_HS_HAT_REV12: enable this option if you have a MMDVM_HS_Hat board for RPi.
@ -560,11 +561,16 @@ ZUMspot RPi (no USB support needed):
- #define ADF7021_12_2880: select this option if your board uses a 12.2880 MHz. - #define ADF7021_12_2880: select this option if your board uses a 12.2880 MHz.
- #define STM32_USART1_HOST: enable direct serial host communication with ZUMspot (using USART1 PA9 and PA10 pins). Disable STM32_USB_HOST if you enable this option. Enable this if you have a ZUMspot RPi. You don't need to enable this option if you will transfer the bootloader. - #define STM32_USART1_HOST: enable direct serial host communication with ZUMspot (using USART1
PA9 and PA10 pins). Disable STM32_USB_HOST if you enable this option. Enable this if you have
a ZUMspot RPi. You don't need to enable this option if you will transfer the bootloader.
- #define STM32_USB_HOST: enable USB host communication with ZUMspot (using STM32F103 USB interface). Disable STM32_USART1_HOST if you enable this option. Enable this if you have a ZUMspot USB or ZUMspot Libre Kit. - #define STM32_USB_HOST: enable USB host communication with ZUMspot (using STM32F103 USB
interface). Disable STM32_USART1_HOST if you enable this option. Enable this if you have
a ZUMspot USB or ZUMspot Libre Kit.
- #define ENABLE_SCAN_MODE: enable automatic mode detection in ZUMspot. This is based on scanning over all enabled modes, and you could have some detection delay. Enabled by default. - #define ENABLE_SCAN_MODE: enable automatic mode detection in ZUMspot. This is based on
scanning over all enabled modes, and you could have some detection delay. Enabled by default.
- #define SEND_RSSI_DATA: enable RSSI reports to MMDVMHost. It is already converted to dBm. - #define SEND_RSSI_DATA: enable RSSI reports to MMDVMHost. It is already converted to dBm.
@ -630,7 +636,8 @@ Misc pins:
PIN_LED PC13 (status led) PIN_LED PC13 (status led)
PIN_DEB PB9 (debugging pin) PIN_DEB PB9 (debugging pin)
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI. You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
reducing EMI.
## Pinout definitions for Arduino Due/Zero + RF7021SE ## Pinout definitions for Arduino Due/Zero + RF7021SE
@ -669,7 +676,8 @@ Misc pins:
PIN_LED 13 PIN_LED 13
PIN_DEB 11 PIN_DEB 11
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI. You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
reducing EMI.
## Pinout definitions for Teensy (3.1, 3.2, 3.5 or 3.6) + RF7021SE: ## Pinout definitions for Teensy (3.1, 3.2, 3.5 or 3.6) + RF7021SE:
@ -710,7 +718,8 @@ Misc pins:
PIN_LED 13 PIN_LED 13
PIN_DEB 23 PIN_DEB 23
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI. You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
reducing EMI.
# Hidden functions # Hidden functions
@ -724,9 +733,11 @@ Also in ADF7021.h:
- #define ADF7021_N_VER: enable support for narrow band version of ADF7021 (ADF7021N). Disabled by default, in general all boards will have just ADF7021. - #define ADF7021_N_VER: enable support for narrow band version of ADF7021 (ADF7021N). Disabled by default, in general all boards will have just ADF7021.
- #define ADF7021_ENABLE_4FSK_AFC: enable AFC support for DMR, YSF and P25. This is experimental, depending on your frequency offset this option will improve or not your BER reception. - #define ADF7021_ENABLE_4FSK_AFC: enable AFC support for DMR, YSF and P25. This is experimental,
depending on your frequency offset this option will improve or not your BER reception.
- #define ADF7021_AFC_POS: enable this option if you can not receive any signal after enable the ADF7021_ENABLE_4FSK_AFC option. - #define ADF7021_AFC_POS: enable this option if you can not receive any signal after enable the
ADF7021_ENABLE_4FSK_AFC option.
- #define ADF7021_DISABLE_RC_4FSK: disable TX Raised Cosine filter for 4FSK modulation in ADF7021. Default TX pulse shaping filter for 4FSK is not optimum for DMR, YSF and P25. Activating this option might improve audio in 4FSK digital modes. - #define ADF7021_DISABLE_RC_4FSK: disable TX Raised Cosine filter for 4FSK modulation in ADF7021. Default TX pulse shaping filter for 4FSK is not optimum for DMR, YSF and P25. Activating this option might improve audio in 4FSK digital modes.
@ -737,3 +748,4 @@ In Globals.h:
In IOSTM.cpp: In IOSTM.cpp:
- #define PI_HAT_7021_REV_02: enable pinouts for first revision of ZUMspot RPi. In general is not used. - #define PI_HAT_7021_REV_02: enable pinouts for first revision of ZUMspot RPi. In general is not used.

View file

@ -78,7 +78,6 @@ const struct {
{',', 0xEEAEE000U, 22U}, {',', 0xEEAEE000U, 22U},
{'-', 0xEAAE0000U, 18U}, {'-', 0xEAAE0000U, 18U},
{'=', 0xEAB80000U, 16U}, {'=', 0xEAB80000U, 16U},
{'.', 0xBAEB8000U, 20U},
{' ', 0x00000000U, 4U}, {' ', 0x00000000U, 4U},
{0U, 0x00000000U, 0U} {0U, 0x00000000U, 0U}
}; };

View file

@ -1,7 +1,7 @@
/* /*
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Colin Durbridge G4EML * Copyright (C) 2016 by Colin Durbridge G4EML
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -53,8 +53,7 @@ CCalDMR::CCalDMR() :
m_transmit(false), m_transmit(false),
m_state(DMRCAL1K_IDLE), m_state(DMRCAL1K_IDLE),
m_dmr1k(), m_dmr1k(),
m_audioSeq(0), m_audioSeq(0)
m_count(0)
{ {
::memcpy(m_dmr1k, VOICE_1K, DMR_FRAME_LENGTH_BYTES + 1U); ::memcpy(m_dmr1k, VOICE_1K, DMR_FRAME_LENGTH_BYTES + 1U);
} }
@ -73,17 +72,6 @@ void CCalDMR::process()
case STATE_DMRDMO1K: case STATE_DMRDMO1K:
dmrdmo1k(); dmrdmo1k();
break; break;
case STATE_INTCAL:
// Simple interrupt counter for board diagnostics (TCXO, connections, etc)
// Not intended for precise interrupt frequency measurements
m_count++;
if (m_count >= CAL_DLY_LOOP) {
m_count = 0U;
uint16_t int1, int2;
io.getIntCounter(int1, int2);
DEBUG3("Counter INT1/INT2:", int1 >> 1U, int2);
}
break;
default: default:
break; break;
} }
@ -144,7 +132,7 @@ uint8_t CCalDMR::write(const uint8_t* data, uint8_t length)
if (m_transmit && m_state == DMRCAL1K_IDLE && m_calState == STATE_DMRDMO1K) if (m_transmit && m_state == DMRCAL1K_IDLE && m_calState == STATE_DMRDMO1K)
m_state = DMRCAL1K_VH; m_state = DMRCAL1K_VH;
if (m_transmit) if (!m_transmit)
io.ifConf(STATE_DMR, true); io.ifConf(STATE_DMR, true);
return 0U; return 0U;

View file

@ -47,7 +47,6 @@ private:
DMRCAL1K m_state; DMRCAL1K m_state;
uint8_t m_dmr1k[DMR_FRAME_LENGTH_BYTES + 1U]; uint8_t m_dmr1k[DMR_FRAME_LENGTH_BYTES + 1U];
uint8_t m_audioSeq; uint8_t m_audioSeq;
uint32_t m_count;
}; };
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,12 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// 9) LoneStar USB Stick ADF7071
// #define LONESTAR_USB
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -64,10 +58,6 @@
// Host communication selection: // Host communication selection:
// #define STM32_USART1_HOST // #define STM32_USART1_HOST
#define STM32_USB_HOST #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -77,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -97,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2009-2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2009-2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -25,23 +25,23 @@
const unsigned int MAX_SYNC_BITS = 100U * DSTAR_DATA_LENGTH_BITS; const unsigned int MAX_SYNC_BITS = 100U * DSTAR_DATA_LENGTH_BITS;
// D-Star preamble sequence (only 32 bits of 101010...) // D-Star preamble sequence (only 32 bits of 101010...)
const uint64_t PREAMBLE_MASK = 0x00000000FFFFFFFFU; const uint32_t PREAMBLE_MASK = 0xFFFFFFFFU;
const uint64_t PREAMBLE_DATA = 0x00000000AAAAAAAAU; const uint32_t PREAMBLE_DATA = 0xAAAAAAAAU;
const uint8_t PREAMBLE_ERRS = 2U; const uint8_t PREAMBLE_ERRS = 2U;
// D-Star bit order version of 0x55 0x55 0x6E 0x0A // D-Star bit order version of 0x55 0x55 0x6E 0x0A
const uint64_t FRAME_SYNC_DATA = 0x0000000000557650U; const uint32_t FRAME_SYNC_DATA = 0x00557650U;
const uint64_t FRAME_SYNC_MASK = 0x0000000000FFFFFFU; const uint32_t FRAME_SYNC_MASK = 0x00FFFFFFU;
const uint8_t FRAME_SYNC_ERRS = 2U; const uint8_t FRAME_SYNC_ERRS = 2U;
// D-Star bit order version of 0x55 0x2D 0x16 // D-Star bit order version of 0x55 0x2D 0x16
const uint64_t DATA_SYNC_DATA = 0x0000000000AAB468U; const uint32_t DATA_SYNC_DATA = 0x00AAB468U;
const uint64_t DATA_SYNC_MASK = 0x0000000000FFFFFFU; const uint32_t DATA_SYNC_MASK = 0x00FFFFFFU;
const uint8_t DATA_SYNC_ERRS = 3U; const uint8_t DATA_SYNC_ERRS = 3U;
// D-Star bit order version of 0x55 0x55 0xC8 0x7A // D-Star bit order version of 0x55 0x55 0xC8 0x7A
const uint64_t END_SYNC_DATA = 0x0000AAAAAAAA135EU; const uint32_t END_SYNC_DATA = 0xAAAA135EU;
const uint64_t END_SYNC_MASK = 0x0000FFFFFFFFFFFFU; const uint32_t END_SYNC_MASK = 0xFFFFFFFFU;
const uint8_t END_SYNC_ERRS = 1U; const uint8_t END_SYNC_ERRS = 1U;
const uint8_t BIT_MASK_TABLE0[] = {0x7FU, 0xBFU, 0xDFU, 0xEFU, 0xF7U, 0xFBU, 0xFDU, 0xFEU}; const uint8_t BIT_MASK_TABLE0[] = {0x7FU, 0xBFU, 0xDFU, 0xEFU, 0xF7U, 0xFBU, 0xFDU, 0xFEU};
@ -284,7 +284,7 @@ void CDStarRX::processNone(bool bit)
m_patternBuffer |= 0x01U; m_patternBuffer |= 0x01U;
// Fuzzy matching of the preamble sync sequence // Fuzzy matching of the preamble sync sequence
if (countBits64((m_patternBuffer & PREAMBLE_MASK) ^ PREAMBLE_DATA) <= PREAMBLE_ERRS) { if (countBits32((m_patternBuffer & PREAMBLE_MASK) ^ PREAMBLE_DATA) <= PREAMBLE_ERRS) {
// Extend scan period in D-Star, once preamble is detected // Extend scan period in D-Star, once preamble is detected
m_modeTimerCnt = 0; m_modeTimerCnt = 0;
@ -295,7 +295,7 @@ void CDStarRX::processNone(bool bit)
} }
// Fuzzy matching of the frame sync sequence // Fuzzy matching of the frame sync sequence
if (countBits64((m_patternBuffer & FRAME_SYNC_MASK) ^ FRAME_SYNC_DATA) <= FRAME_SYNC_ERRS) { if (countBits32((m_patternBuffer & FRAME_SYNC_MASK) ^ FRAME_SYNC_DATA) <= FRAME_SYNC_ERRS) {
DEBUG1("DStarRX: found frame sync in None, fuzzy"); DEBUG1("DStarRX: found frame sync in None, fuzzy");
::memset(m_rxBuffer, 0x00U, DSTAR_FEC_SECTION_LENGTH_BYTES); ::memset(m_rxBuffer, 0x00U, DSTAR_FEC_SECTION_LENGTH_BYTES);
@ -306,7 +306,7 @@ void CDStarRX::processNone(bool bit)
} }
// Exact matching of the data sync bit sequence // Exact matching of the data sync bit sequence
if (countBits64((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) == 0U) { if (countBits32((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) == 0U) {
DEBUG1("DStarRX: found data sync in None, exact"); DEBUG1("DStarRX: found data sync in None, exact");
io.setDecode(true); io.setDecode(true);
@ -330,10 +330,7 @@ void CDStarRX::processHeader(bool bit)
m_patternBuffer |= 0x01U; m_patternBuffer |= 0x01U;
WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit); WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit);
m_rxBufferBits++; m_rxBufferBits++;
if (m_rxBufferBits > DSTAR_BUFFER_LENGTH_BITS)
reset();
// A full FEC header // A full FEC header
if (m_rxBufferBits == DSTAR_FEC_SECTION_LENGTH_BITS) { if (m_rxBufferBits == DSTAR_FEC_SECTION_LENGTH_BITS) {
@ -364,13 +361,10 @@ void CDStarRX::processData(bool bit)
m_patternBuffer |= 0x01U; m_patternBuffer |= 0x01U;
WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit); WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit);
m_rxBufferBits++; m_rxBufferBits++;
if (m_rxBufferBits > DSTAR_BUFFER_LENGTH_BITS)
reset();
// Fuzzy matching of the end frame sequences // Fuzzy matching of the end frame sequences
if (countBits64((m_patternBuffer & END_SYNC_MASK) ^ END_SYNC_DATA) <= END_SYNC_ERRS) { if (countBits32((m_patternBuffer & END_SYNC_MASK) ^ END_SYNC_DATA) <= END_SYNC_ERRS) {
DEBUG1("DStarRX: Found end sync in Data"); DEBUG1("DStarRX: Found end sync in Data");
io.setDecode(false); io.setDecode(false);
@ -383,7 +377,7 @@ void CDStarRX::processData(bool bit)
// Fuzzy matching of the data sync bit sequence // Fuzzy matching of the data sync bit sequence
bool syncSeen = false; bool syncSeen = false;
if (m_rxBufferBits >= (DSTAR_DATA_LENGTH_BITS - 3U)) { if (m_rxBufferBits >= (DSTAR_DATA_LENGTH_BITS - 3U)) {
if (countBits64((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) <= DATA_SYNC_ERRS) { if (countBits32((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) <= DATA_SYNC_ERRS) {
m_rxBufferBits = DSTAR_DATA_LENGTH_BITS; m_rxBufferBits = DSTAR_DATA_LENGTH_BITS;
m_dataBits = MAX_SYNC_BITS; m_dataBits = MAX_SYNC_BITS;
syncSeen = true; syncSeen = true;
@ -393,9 +387,9 @@ void CDStarRX::processData(bool bit)
// Check to see if the sync is arriving late // Check to see if the sync is arriving late
if (m_rxBufferBits == DSTAR_DATA_LENGTH_BITS && !syncSeen) { if (m_rxBufferBits == DSTAR_DATA_LENGTH_BITS && !syncSeen) {
for (uint8_t i = 1U; i <= 3U; i++) { for (uint8_t i = 1U; i <= 3U; i++) {
uint64_t syncMask = DATA_SYNC_MASK >> i; uint32_t syncMask = DATA_SYNC_MASK >> i;
uint64_t syncData = DATA_SYNC_DATA >> i; uint32_t syncData = DATA_SYNC_DATA >> i;
if (countBits64((m_patternBuffer & syncMask) ^ syncData) <= DATA_SYNC_ERRS) { if (countBits32((m_patternBuffer & syncMask) ^ syncData) <= DATA_SYNC_ERRS) {
m_rxBufferBits -= i; m_rxBufferBits -= i;
break; break;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -22,8 +22,6 @@
#include "DStarDefines.h" #include "DStarDefines.h"
const uint16_t DSTAR_BUFFER_LENGTH_BITS = 800U;
enum DSRX_STATE { enum DSRX_STATE {
DSRXS_NONE, DSRXS_NONE,
DSRXS_HEADER, DSRXS_HEADER,
@ -40,8 +38,8 @@ public:
private: private:
DSRX_STATE m_rxState; DSRX_STATE m_rxState;
uint64_t m_patternBuffer; uint32_t m_patternBuffer;
uint8_t m_rxBuffer[DSTAR_BUFFER_LENGTH_BITS / 8U]; uint8_t m_rxBuffer[100U];
unsigned int m_rxBufferBits; unsigned int m_rxBufferBits;
unsigned int m_dataBits; unsigned int m_dataBits;
unsigned int m_mar; unsigned int m_mar;

View file

@ -36,7 +36,7 @@
#define DEBUG1(a) #define DEBUG1(a)
#define DEBUG2(a,b) #define DEBUG2(a,b)
#define DEBUG2I(a,b) #define DEBUG2I(a,b)
#define DEBUG3(a,b,c) serial.writeDebug((a),(b),(c)) #define DEBUG3(a,b,c)
#define DEBUG4(a,b,c,d) #define DEBUG4(a,b,c,d)
#define DEBUG5(a,b,c,d,e) #define DEBUG5(a,b,c,d,e)

View file

@ -1,7 +1,6 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* Copyright (C) 2019 by Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -42,16 +41,13 @@ enum MMDVM_STATE {
STATE_P25 = 4, STATE_P25 = 4,
STATE_NXDN = 5, STATE_NXDN = 5,
STATE_POCSAG = 6, STATE_POCSAG = 6,
STATE_M17 = 7,
// Dummy states start at 90 // Dummy states start at 90
STATE_DMRDMO1K = 92, STATE_DMRDMO1K = 92,
STATE_RSSICAL = 96, STATE_RSSICAL = 96,
STATE_CWID = 97, STATE_CWID = 97,
STATE_DMRCAL = 98, STATE_DMRCAL = 98,
STATE_DSTARCAL = 99, STATE_DSTARCAL = 99
STATE_INTCAL = 100,
STATE_POCSAGCAL = 101
}; };
const uint8_t MARK_SLOT1 = 0x08U; const uint8_t MARK_SLOT1 = 0x08U;
@ -78,8 +74,6 @@ const uint8_t MARK_NONE = 0x00U;
#include "YSFTX.h" #include "YSFTX.h"
#include "P25RX.h" #include "P25RX.h"
#include "P25TX.h" #include "P25TX.h"
#include "M17RX.h"
#include "M17TX.h"
#include "NXDNRX.h" #include "NXDNRX.h"
#include "NXDNTX.h" #include "NXDNTX.h"
#include "POCSAGTX.h" #include "POCSAGTX.h"
@ -88,7 +82,6 @@ const uint8_t MARK_NONE = 0x00U;
#include "CalDMR.h" #include "CalDMR.h"
#include "Debug.h" #include "Debug.h"
#include "Utils.h" #include "Utils.h"
#include "I2CHost.h"
extern MMDVM_STATE m_modemState; extern MMDVM_STATE m_modemState;
extern MMDVM_STATE m_calState; extern MMDVM_STATE m_calState;
@ -106,7 +99,6 @@ extern bool m_dmrEnable;
extern bool m_ysfEnable; extern bool m_ysfEnable;
extern bool m_p25Enable; extern bool m_p25Enable;
extern bool m_nxdnEnable; extern bool m_nxdnEnable;
extern bool m_m17Enable;
extern bool m_pocsagEnable; extern bool m_pocsagEnable;
extern bool m_duplex; extern bool m_duplex;
@ -137,9 +129,6 @@ extern CYSFTX ysfTX;
extern CP25RX p25RX; extern CP25RX p25RX;
extern CP25TX p25TX; extern CP25TX p25TX;
extern CM17RX m17RX;
extern CM17TX m17TX;
extern CNXDNRX nxdnRX; extern CNXDNRX nxdnRX;
extern CNXDNTX nxdnTX; extern CNXDNTX nxdnTX;
@ -153,9 +142,5 @@ extern CCalRSSI calRSSI;
extern CCWIdTX cwIdTX; extern CCWIdTX cwIdTX;
#if defined(STM32_I2C_HOST)
extern CI2CHost i2c;
#endif
#endif #endif

View file

@ -1,201 +0,0 @@
/*
* Copyright (C) 2019 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "Config.h"
#if defined(STM32_I2C_HOST)
#include "Globals.h"
#include "I2CHost.h"
extern "C" {
void I2C2_EV_IRQHandler(void) {
i2c.I2C_EVHandler();
}
void I2C2_ER_IRQHandler(void) {
if (I2C_GetITStatus(I2C2, I2C_IT_AF)) {
I2C_ClearITPendingBit(I2C2, I2C_IT_AF);
}
}
}
CI2CHost::CI2CHost()
{
}
void CI2CHost::Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
I2C_InitTypeDef I2C_InitStructure;
RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C2, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
// Configure I2C GPIOs
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;
GPIO_Init(GPIOB, &GPIO_InitStructure);
// Configure the I2C event interrupt
NVIC_InitStructure.NVIC_IRQChannel = I2C2_EV_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 15;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 15;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
// Configure the I2C error interrupt
NVIC_InitStructure.NVIC_IRQChannel = I2C2_ER_IRQn;
NVIC_Init(&NVIC_InitStructure);
// I2C configuration
I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
I2C_InitStructure.I2C_OwnAddress1 = I2C_ADDR << 1;
I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
I2C_InitStructure.I2C_ClockSpeed = I2C_CLK_FREQ;
// Enable I2C
I2C_Cmd(I2C2, ENABLE);
// Apply I2C configuration
I2C_Init(I2C2, &I2C_InitStructure);
I2C_ITConfig(I2C2, I2C_IT_EVT, ENABLE);
I2C_ITConfig(I2C2, I2C_IT_BUF, ENABLE);
I2C_ITConfig(I2C2, I2C_IT_ERR, ENABLE);
// Initialize the FIFOs
txFIFO_head = 0U;
txFIFO_tail = 0U;
rxFIFO_head = 0U;
rxFIFO_tail = 0U;
}
void CI2CHost::I2C_EVHandler(void) {
uint32_t event = I2C_GetLastEvent(I2C2);
switch (event) {
case I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED:
break;
case I2C_EVENT_SLAVE_BYTE_RECEIVED:
if (rxFIFO_level() < I2C_RX_FIFO_SIZE) {
rxFIFO[rxFIFO_head] = I2C_ReceiveData(I2C2);
rxFIFO_head++;
if (rxFIFO_head >= I2C_RX_FIFO_SIZE)
rxFIFO_head = 0U;
} else
I2C_ReceiveData(I2C2);
break;
case I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED:
case I2C_EVENT_SLAVE_BYTE_TRANSMITTED:
if (txFIFO_level() > 0) {
I2C_SendData(I2C2, txFIFO[txFIFO_tail]);
txFIFO_tail++;
if (txFIFO_tail >= I2C_TX_FIFO_SIZE)
txFIFO_tail = 0U;
} else
I2C_SendData(I2C2, 0U);
break;
case I2C_EVENT_SLAVE_STOP_DETECTED:
I2C2_ClearFlag();
break;
}
}
void CI2CHost::I2C2_ClearFlag(void) {
// Clear ADDR flag
while((I2C2->SR1 & I2C_SR1_ADDR) == I2C_SR1_ADDR) {
I2C2->SR1;
I2C2->SR2;
}
// Clear STOPF flag
while((I2C2->SR1 & I2C_SR1_STOPF) == I2C_SR1_STOPF) {
I2C2->SR1;
I2C2->CR1 |= 0x1;
}
}
uint16_t CI2CHost::txFIFO_level(void)
{
uint32_t tail = txFIFO_tail;
uint32_t head = txFIFO_head;
if (tail > head)
return I2C_TX_FIFO_SIZE + head - tail;
else
return head - tail;
}
uint16_t CI2CHost::rxFIFO_level(void)
{
uint32_t tail = rxFIFO_tail;
uint32_t head = rxFIFO_head;
if (tail > head)
return I2C_RX_FIFO_SIZE + head - tail;
else
return head - tail;
}
uint8_t CI2CHost::txFIFO_put(uint8_t next)
{
if (txFIFO_level() < I2C_TX_FIFO_SIZE) {
txFIFO[txFIFO_head] = next;
txFIFO_head++;
if (txFIFO_head >= I2C_TX_FIFO_SIZE)
txFIFO_head = 0U;
return 1U;
} else {
return 0U;
}
}
uint8_t CI2CHost::AvailI2C(void)
{
if (rxFIFO_level() > 0U)
return 1U;
else
return 0U;
}
uint8_t CI2CHost::ReadI2C(void)
{
uint8_t data_c = rxFIFO[rxFIFO_tail];
rxFIFO_tail++;
if (rxFIFO_tail >= I2C_RX_FIFO_SIZE)
rxFIFO_tail = 0U;
return data_c;
}
void CI2CHost::WriteI2C(const uint8_t* data, uint16_t length)
{
for (uint16_t i = 0U; i < length; i++)
txFIFO_put(data[i]);
}
#endif

View file

@ -1,55 +0,0 @@
/*
* Copyright (C) 2019 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(I2CHost_H)
#define I2CHost_H
#include "Config.h"
#if defined(STM32_I2C_HOST)
#define I2C_CLK_FREQ 100000U
#define I2C_TX_FIFO_SIZE 512U
#define I2C_RX_FIFO_SIZE 512U
class CI2CHost {
public:
CI2CHost();
void Init(void);
void I2C_EVHandler(void);
uint8_t AvailI2C(void);
uint8_t ReadI2C(void);
void WriteI2C(const uint8_t* data, uint16_t length);
private:
void I2C2_ClearFlag(void);
uint16_t txFIFO_level(void);
uint16_t rxFIFO_level(void);
uint8_t txFIFO_put(uint8_t next);
volatile uint8_t txFIFO[I2C_TX_FIFO_SIZE];
volatile uint8_t rxFIFO[I2C_RX_FIFO_SIZE];
volatile uint16_t txFIFO_head, txFIFO_tail;
volatile uint16_t rxFIFO_head, rxFIFO_tail;
};
#endif
#endif

107
IO.cpp
View file

@ -1,8 +1,8 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -37,9 +37,7 @@ m_scanEnable(false),
m_scanPauseCnt(0U), m_scanPauseCnt(0U),
m_scanPos(0U), m_scanPos(0U),
m_ledValue(true), m_ledValue(true),
m_watchdog(0U), m_watchdog(0U)
m_int1counter(0U),
m_int2counter(0U)
{ {
Init(); Init();
@ -51,7 +49,6 @@ m_int2counter(0U)
YSF_pin(LOW); YSF_pin(LOW);
P25_pin(LOW); P25_pin(LOW);
NXDN_pin(LOW); NXDN_pin(LOW);
M17_pin(LOW);
POCSAG_pin(LOW); POCSAG_pin(LOW);
COS_pin(LOW); COS_pin(LOW);
DEB_pin(LOW); DEB_pin(LOW);
@ -90,7 +87,6 @@ void CIO::selfTest()
YSF_pin(ledValue); YSF_pin(ledValue);
P25_pin(ledValue); P25_pin(ledValue);
NXDN_pin(ledValue); NXDN_pin(ledValue);
M17_pin(ledValue);
POCSAG_pin(ledValue); POCSAG_pin(ledValue);
COS_pin(ledValue); COS_pin(ledValue);
@ -113,7 +109,7 @@ void CIO::process()
if (m_started) { if (m_started) {
// Two seconds timeout // Two seconds timeout
if (m_watchdog >= 19200U) { if (m_watchdog >= 19200U) {
if (m_modemState == STATE_DSTAR || m_modemState == STATE_DMR || m_modemState == STATE_YSF || m_modemState == STATE_P25 || m_modemState == STATE_NXDN || m_modemState == STATE_M17) { if (m_modemState == STATE_DSTAR || m_modemState == STATE_DMR || m_modemState == STATE_YSF || m_modemState == STATE_P25 || m_modemState == STATE_NXDN) {
m_modemState = STATE_IDLE; m_modemState = STATE_IDLE;
setMode(m_modemState); setMode(m_modemState);
} }
@ -180,8 +176,6 @@ void CIO::process()
scantime = SCAN_TIME; scantime = SCAN_TIME;
else if(m_modemState_prev == STATE_NXDN) else if(m_modemState_prev == STATE_NXDN)
scantime = SCAN_TIME; scantime = SCAN_TIME;
else if(m_modemState_prev == STATE_M17)
scantime = SCAN_TIME;
else else
scantime = SCAN_TIME; scantime = SCAN_TIME;
@ -225,9 +219,6 @@ void CIO::process()
case STATE_NXDN: case STATE_NXDN:
nxdnRX.databit(bit); nxdnRX.databit(bit);
break; break;
case STATE_M17:
m17RX.databit(bit);
break;
default: default:
break; break;
} }
@ -259,10 +250,6 @@ void CIO::start()
m_Modes[m_TotalModes] = STATE_NXDN; m_Modes[m_TotalModes] = STATE_NXDN;
m_TotalModes++; m_TotalModes++;
} }
if(m_m17Enable) {
m_Modes[m_TotalModes] = STATE_M17;
m_TotalModes++;
}
#if defined(ENABLE_SCAN_MODE) #if defined(ENABLE_SCAN_MODE)
if(m_TotalModes > 1U) if(m_TotalModes > 1U)
@ -318,53 +305,11 @@ bool CIO::hasRXOverflow()
return m_rxBuffer.hasOverflowed(); return m_rxBuffer.hasOverflowed();
} }
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
void CIO::checkBand(uint32_t frequency_rx, uint32_t frequency_tx) {
if (!(io.hasSingleADF7021())) {
// There are two ADF7021s on the board
if (io.isDualBand()) {
// Dual band
if ((frequency_tx <= VHF2_MAX) && (frequency_rx <= VHF2_MAX)) {
// Turn on VHF side
io.setBandVHF(true);
} else if ((frequency_tx >= UHF1_MIN) && (frequency_rx >= UHF1_MIN)) {
// Turn on UHF side
io.setBandVHF(false);
}
}
}
}
uint8_t CIO::checkZUMspot(uint32_t frequency_rx, uint32_t frequency_tx) {
if (!(io.hasSingleADF7021())) {
// There are two ADF7021s on the board
if (io.isDualBand()) {
// Dual band
if ((frequency_tx <= VHF2_MAX) && (frequency_rx <= VHF2_MAX)) {
// Turn on VHF side
io.setBandVHF(true);
} else if ((frequency_tx >= UHF1_MIN) && (frequency_rx >= UHF1_MIN)) {
// Turn on UHF side
io.setBandVHF(false);
}
} else if (!io.isDualBand()) {
// Duplex board
if ((frequency_tx < UHF1_MIN) || (frequency_rx < UHF1_MIN)) {
// Reject VHF frequencies
return 4U;
}
}
}
return 0U;
}
#endif
uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power, uint32_t pocsag_freq_tx) uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power, uint32_t pocsag_freq_tx)
{ {
// Configure power level // Configure power level
setPower(rf_power); setPower(rf_power);
#if !defined(DISABLE_FREQ_CHECK)
// Check frequency ranges // Check frequency ranges
if( !( ((frequency_rx >= VHF1_MIN)&&(frequency_rx < VHF1_MAX)) || ((frequency_tx >= VHF1_MIN)&&(frequency_tx < VHF1_MAX)) || \ if( !( ((frequency_rx >= VHF1_MIN)&&(frequency_rx < VHF1_MAX)) || ((frequency_tx >= VHF1_MIN)&&(frequency_tx < VHF1_MAX)) || \
((frequency_rx >= UHF1_MIN)&&(frequency_rx < UHF1_MAX)) || ((frequency_tx >= UHF1_MIN)&&(frequency_tx < UHF1_MAX)) || \ ((frequency_rx >= UHF1_MIN)&&(frequency_rx < UHF1_MAX)) || ((frequency_tx >= UHF1_MIN)&&(frequency_tx < UHF1_MAX)) || \
@ -377,25 +322,6 @@ uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_po
((pocsag_freq_tx >= VHF2_MIN)&&(pocsag_freq_tx < VHF2_MAX)) || \ ((pocsag_freq_tx >= VHF2_MIN)&&(pocsag_freq_tx < VHF2_MAX)) || \
((pocsag_freq_tx >= UHF2_MIN)&&(pocsag_freq_tx < UHF2_MAX)) ) ) ((pocsag_freq_tx >= UHF2_MIN)&&(pocsag_freq_tx < UHF2_MAX)) ) )
return 4U; return 4U;
#endif
#if !defined(DISABLE_FREQ_BAN)
// Check banned frequency ranges
if( ((frequency_rx >= BAN1_MIN)&&(frequency_rx <= BAN1_MAX)) || ((frequency_tx >= BAN1_MIN)&&(frequency_tx <= BAN1_MAX)) || \
((frequency_rx >= BAN2_MIN)&&(frequency_rx <= BAN2_MAX)) || ((frequency_tx >= BAN2_MIN)&&(frequency_tx <= BAN2_MAX)) )
return 4U;
if( ((pocsag_freq_tx >= BAN1_MIN)&&(pocsag_freq_tx <= BAN1_MAX)) || \
((pocsag_freq_tx >= BAN2_MIN)&&(pocsag_freq_tx <= BAN2_MAX)) )
return 4U;
#endif
// Check if we have a single, dualband or duplex board
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
if (checkZUMspot(frequency_rx, frequency_tx) > 0) {
return 4U;
}
#endif
// Configure frequency // Configure frequency
m_frequency_rx = frequency_rx; m_frequency_rx = frequency_rx;
@ -423,14 +349,6 @@ void CIO::setMode(MMDVM_STATE modemState)
#if defined(USE_ALTERNATE_NXDN_LEDS) #if defined(USE_ALTERNATE_NXDN_LEDS)
} }
#endif #endif
#if defined(USE_ALTERNATE_M17_LEDS)
if (modemState != STATE_M17) {
#endif
YSF_pin(modemState == STATE_YSF);
P25_pin(modemState == STATE_P25);
#if defined(USE_ALTERNATE_M17_LEDS)
}
#endif
#if defined(USE_ALTERNATE_NXDN_LEDS) #if defined(USE_ALTERNATE_NXDN_LEDS)
if (modemState != STATE_YSF && modemState != STATE_P25) { if (modemState != STATE_YSF && modemState != STATE_P25) {
#endif #endif
@ -445,13 +363,6 @@ void CIO::setMode(MMDVM_STATE modemState)
#if defined(USE_ALTERNATE_POCSAG_LEDS) #if defined(USE_ALTERNATE_POCSAG_LEDS)
} }
#endif #endif
#if defined(USE_ALTERNATE_M17_LEDS)
if (modemState != STATE_DSTAR && modemState != STATE_P25) {
#endif
M17_pin(modemState == STATE_M17);
#if defined(USE_ALTERNATE_M17_LEDS)
}
#endif
} }
void CIO::setDecode(bool dcd) void CIO::setDecode(bool dcd)
@ -478,11 +389,3 @@ uint32_t CIO::getWatchdog()
{ {
return m_watchdog; return m_watchdog;
} }
void CIO::getIntCounter(uint16_t &int1, uint16_t &int2)
{
int1 = m_int1counter;
int2 = m_int2counter;
m_int1counter = 0U;
m_int2counter = 0U;
}

43
IO.h
View file

@ -1,8 +1,8 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -28,7 +28,6 @@
#define LOW 0 #define LOW 0
#define HIGH 1 #define HIGH 1
// HS frequency ranges
#define VHF1_MIN 144000000 #define VHF1_MIN 144000000
#define VHF1_MAX 148000000 #define VHF1_MAX 148000000
#define VHF2_MIN 219000000 #define VHF2_MIN 219000000
@ -38,29 +37,9 @@
#define UHF2_MIN 842000000 #define UHF2_MIN 842000000
#define UHF2_MAX 950000000 #define UHF2_MAX 950000000
// Banned amateur frequency ranges (satellite only, ISS, etc)
#define BAN1_MIN 145800000
#define BAN1_MAX 146000000
#define BAN2_MIN 435000000
#define BAN2_MAX 438000000
#define SCAN_TIME 1920 #define SCAN_TIME 1920
#define SCAN_PAUSE 20000 #define SCAN_PAUSE 20000
#if defined(DUPLEX)
#if defined(STM32_USB_HOST)
#define CAL_DLY_LOOP 98950U
#else
#define CAL_DLY_LOOP 96100U
#endif
#else
#if defined(STM32_USB_HOST)
#define CAL_DLY_LOOP 110850U
#else
#define CAL_DLY_LOOP 104600U
#endif
#endif
extern uint32_t m_frequency_rx; extern uint32_t m_frequency_rx;
extern uint32_t m_frequency_tx; extern uint32_t m_frequency_tx;
extern uint32_t m_pocsag_freq_tx; extern uint32_t m_pocsag_freq_tx;
@ -98,7 +77,6 @@ public:
void YSF_pin(bool on); void YSF_pin(bool on);
void P25_pin(bool on); void P25_pin(bool on);
void NXDN_pin(bool on); void NXDN_pin(bool on);
void M17_pin(bool on);
void POCSAG_pin(bool on); void POCSAG_pin(bool on);
void COS_pin(bool on); void COS_pin(bool on);
void interrupt(void); void interrupt(void);
@ -123,15 +101,7 @@ public:
void setLoDevYSF(bool ysfLoDev); void setLoDevYSF(bool ysfLoDev);
void resetWatchdog(void); void resetWatchdog(void);
uint32_t getWatchdog(void); uint32_t getWatchdog(void);
void getIntCounter(uint16_t &int1, uint16_t &int2);
void selfTest(void); void selfTest(void);
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
void checkBand(uint32_t frequency_rx, uint32_t frequency_tx);
uint8_t checkZUMspot(uint32_t frequency_rx, uint32_t frequency_tx);
void setBandVHF(bool vhf_on);
bool hasSingleADF7021(void);
bool isDualBand(void);
#endif
// RF interface API // RF interface API
void setTX(void); void setTX(void);
@ -142,7 +112,7 @@ public:
#endif #endif
void start(void); void start(void);
void startInt(void); void startInt(void);
void setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t m17TXLevel, uint8_t pocsagTXLevel, bool ysfLoDev); void setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t pocsagTXLevel, bool ysfLoDev);
void updateCal(void); void updateCal(void);
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)
@ -163,7 +133,6 @@ public:
uint16_t devYSF(void); uint16_t devYSF(void);
uint16_t devP25(void); uint16_t devP25(void);
uint16_t devNXDN(void); uint16_t devNXDN(void);
uint16_t devM17(void);
uint16_t devPOCSAG(void); uint16_t devPOCSAG(void);
void printConf(); void printConf();
#endif #endif
@ -183,11 +152,9 @@ private:
uint32_t m_scanPauseCnt; uint32_t m_scanPauseCnt;
uint8_t m_scanPos; uint8_t m_scanPos;
uint8_t m_TotalModes; uint8_t m_TotalModes;
MMDVM_STATE m_Modes[6]; MMDVM_STATE m_Modes[5];
bool m_ledValue; bool m_ledValue;
volatile uint32_t m_watchdog; volatile uint32_t m_watchdog;
volatile uint16_t m_int1counter;
volatile uint16_t m_int2counter;
}; };

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -28,7 +28,7 @@
// STM32F1 pin definitions, using STM32duino // STM32F1 pin definitions, using STM32duino
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS) #if defined(ZUMSPOT_ADF7021)
#define PIN_SCLK PB5 #define PIN_SCLK PB5
#define PIN_SREAD PB6 #define PIN_SREAD PB6
@ -37,9 +37,9 @@
#define PIN_SLE2 PA6 #define PIN_SLE2 PA6
#define PIN_CE PC14 #define PIN_CE PC14
#define PIN_RXD PB4 #define PIN_RXD PB4
#define PIN_RXD2 PA11 #define PIN_RXD2 PA4
#define PIN_TXD PB3 #define PIN_TXD PB3
#define PIN_TXD2 PA8 #define PIN_TXD2 PA5
#define PIN_CLKOUT PA15 #define PIN_CLKOUT PA15
#define PIN_LED PC13 #define PIN_LED PC13
#define PIN_DEB PB9 #define PIN_DEB PB9
@ -47,12 +47,7 @@
#define PIN_DMR_LED PB13 #define PIN_DMR_LED PB13
#define PIN_YSF_LED PB1 #define PIN_YSF_LED PB1
#define PIN_P25_LED PB0 #define PIN_P25_LED PB0
#if defined(STM32_USB_HOST) #define PIN_NXDN_LED PA8
#define PIN_NXDN_LED PA1
#else
#define PIN_NXDN_LED PA7
#endif
#define PIN_POCSAG_LED PA5
#define PIN_PTT_LED PB14 #define PIN_PTT_LED PB14
#define PIN_COS_LED PB15 #define PIN_COS_LED PB15
@ -76,57 +71,54 @@
#define PIN_YSF_LED PB1 #define PIN_YSF_LED PB1
#define PIN_P25_LED PB0 #define PIN_P25_LED PB0
#define PIN_NXDN_LED PA8 #define PIN_NXDN_LED PA8
#define PIN_POCSAG_LED PA7
#define PIN_PTT_LED PB14 #define PIN_PTT_LED PB14
#define PIN_COS_LED PB15 #define PIN_COS_LED PB15
#else #else
#error "Either ZUMSPOT_ADF7021, LONESTAR_USB, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT, NANO_DV_REV10 or SKYBRIDGE_HS need to be defined" #error "Either ZUMSPOT_ADF7021, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT or NANO_DV_REV10 need to be defined"
#endif #endif
#elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) #elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
// Teensy pin definitions // Teensy pin definitions
#define PIN_SCLK 2 #define PIN_SCLK 2
#define PIN_SDATA 3 #define PIN_SDATA 3
#define PIN_SREAD 4 #define PIN_SREAD 4
#define PIN_SLE 5 #define PIN_SLE 5
#define PIN_CE 6 #define PIN_CE 6
#define PIN_RXD 7 #define PIN_RXD 7
#define PIN_TXD 8 #define PIN_TXD 8
#define PIN_CLKOUT 22 #define PIN_CLKOUT 22
#define PIN_LED 13 #define PIN_LED 13
#define PIN_DEB 23 #define PIN_DEB 23
#define PIN_DSTAR_LED 16 #define PIN_DSTAR_LED 16
#define PIN_DMR_LED 17 #define PIN_DMR_LED 17
#define PIN_YSF_LED 18 #define PIN_YSF_LED 18
#define PIN_P25_LED 19 #define PIN_P25_LED 19
#define PIN_NXDN_LED 20 #define PIN_NXDN_LED 20
#define PIN_POCSAG_LED 21 #define PIN_PTT_LED 14
#define PIN_PTT_LED 14 #define PIN_COS_LED 15
#define PIN_COS_LED 15
#else #else
// Arduino pin definitions (Due and Zero) // Arduino pin definitions (Due and Zero)
#define PIN_SCLK 3 #define PIN_SCLK 3
#define PIN_SDATA 4 // 2 in Arduino Zero Pro #define PIN_SDATA 4 // 2 in Arduino Zero Pro
#define PIN_SREAD 5 #define PIN_SREAD 5
#define PIN_SLE 6 #define PIN_SLE 6
#define PIN_CE 12 #define PIN_CE 12
#define PIN_RXD 7 #define PIN_RXD 7
#define PIN_TXD 8 #define PIN_TXD 8
#define PIN_CLKOUT 2 // 4 in Arduino Zero Pro #define PIN_CLKOUT 2 // 4 in Arduino Zero Pro
#define PIN_LED 13 #define PIN_LED 13
#define PIN_DEB 11 #define PIN_DEB 11
#define PIN_DSTAR_LED 14 #define PIN_DSTAR_LED 14
#define PIN_DMR_LED 15 #define PIN_DMR_LED 15
#define PIN_YSF_LED 16 #define PIN_YSF_LED 16
#define PIN_P25_LED 17 #define PIN_P25_LED 17
#define PIN_NXDN_LED 18 #define PIN_NXDN_LED 18
#define PIN_POCSAG_LED 19 #define PIN_PTT_LED 9
#define PIN_PTT_LED 9 #define PIN_COS_LED 10
#define PIN_COS_LED 10
#endif #endif
@ -156,7 +148,7 @@ void CIO::Init()
{ {
#if defined (__STM32F1__) #if defined (__STM32F1__)
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10) || defined(SKYBRIDGE_HS) #if defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY); afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY);
#endif #endif
@ -176,7 +168,6 @@ void CIO::Init()
pinMode(PIN_YSF_LED, OUTPUT); pinMode(PIN_YSF_LED, OUTPUT);
pinMode(PIN_P25_LED, OUTPUT); pinMode(PIN_P25_LED, OUTPUT);
pinMode(PIN_NXDN_LED, OUTPUT); pinMode(PIN_NXDN_LED, OUTPUT);
pinMode(PIN_POCSAG_LED, OUTPUT);
pinMode(PIN_PTT_LED, OUTPUT); pinMode(PIN_PTT_LED, OUTPUT);
pinMode(PIN_COS_LED, OUTPUT); pinMode(PIN_COS_LED, OUTPUT);
@ -191,6 +182,7 @@ void CIO::Init()
#else #else
pinMode(PIN_TXD, OUTPUT); pinMode(PIN_TXD, OUTPUT);
#endif #endif
} }
void CIO::startInt() void CIO::startInt()
@ -334,9 +326,8 @@ void CIO::POCSAG_pin(bool on)
#if defined(USE_ALTERNATE_POCSAG_LEDS) #if defined(USE_ALTERNATE_POCSAG_LEDS)
digitalWrite(PIN_DSTAR_LED, on ? HIGH : LOW); digitalWrite(PIN_DSTAR_LED, on ? HIGH : LOW);
digitalWrite(PIN_DMR_LED, on ? HIGH : LOW); digitalWrite(PIN_DMR_LED, on ? HIGH : LOW);
#else
digitalWrite(PIN_POCSAG_LED, on ? HIGH : LOW);
#endif #endif
// TODO: add a separate LED pin for POCSAG mode
} }
void CIO::PTT_pin(bool on) void CIO::PTT_pin(bool on)

175
IOSTM.cpp
View file

@ -1,7 +1,6 @@
/* /*
* Copyright (C) 2020 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM * Copyright (C) 2016 by Jim McLaughlin KI6ZUM
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2017 by Danilo DB4PLE * Copyright (C) 2017 by Danilo DB4PLE
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -84,20 +83,13 @@
#define PIN_NXDN_LED GPIO_Pin_8 #define PIN_NXDN_LED GPIO_Pin_8
#define PORT_NXDN_LED GPIOA #define PORT_NXDN_LED GPIOA
// XXX FIXME
#define PIN_M17_LED GPIO_Pin_8
#define PORT_M17_LED GPIOA
#define PIN_POCSAG_LED GPIO_Pin_5
#define PORT_POCSAG_LED GPIOA
#define PIN_PTT_LED GPIO_Pin_12 #define PIN_PTT_LED GPIO_Pin_12
#define PORT_PTT_LED GPIOB #define PORT_PTT_LED GPIOB
#define PIN_COS_LED GPIO_Pin_13 #define PIN_COS_LED GPIO_Pin_13
#define PORT_COS_LED GPIOB #define PORT_COS_LED GPIOB
#elif defined(ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS) || defined(LONESTAR_USB) #elif defined(ZUMSPOT_ADF7021)
#define PIN_SCLK GPIO_Pin_5 #define PIN_SCLK GPIO_Pin_5
#define PORT_SCLK GPIOB #define PORT_SCLK GPIOB
@ -120,15 +112,6 @@
#define PIN_RXD GPIO_Pin_4 #define PIN_RXD GPIO_Pin_4
#define PORT_RXD GPIOB #define PORT_RXD GPIOB
#define PIN_SGL_DBL GPIO_Pin_12
#define PORT_SGL_DBL GPIOA
#define PIN_DL_DPX GPIO_Pin_15
#define PORT_DL_DPX GPIOC
#define PIN_SET_BAND GPIO_Pin_15
#define PORT_SET_BAND GPIOA
// TXD used in SPI Data mode of ADF7021 // TXD used in SPI Data mode of ADF7021
// TXD is TxRxCLK of ADF7021, standard TX/RX data interface // TXD is TxRxCLK of ADF7021, standard TX/RX data interface
#define PIN_TXD GPIO_Pin_3 #define PIN_TXD GPIO_Pin_3
@ -136,17 +119,6 @@
#define PIN_TXD_INT GPIO_PinSource3 #define PIN_TXD_INT GPIO_PinSource3
#define PORT_TXD_INT GPIO_PortSourceGPIOB #define PORT_TXD_INT GPIO_PortSourceGPIOB
#if defined(DUPLEX)
#define PIN_RXD2 GPIO_Pin_11
#define PORT_RXD2 GPIOA
// TXD2 is TxRxCLK of the second ADF7021, standard TX/RX data interface
#define PIN_TXD2 GPIO_Pin_8
#define PORT_TXD2 GPIOA
#define PIN_TXD2_INT GPIO_PinSource8
#define PORT_TXD2_INT GPIO_PortSourceGPIOA
#endif
// CLKOUT used in SPI Data mode of ADF7021 // CLKOUT used in SPI Data mode of ADF7021
#define PIN_CLKOUT GPIO_Pin_15 #define PIN_CLKOUT GPIO_Pin_15
#define PORT_CLKOUT GPIOA #define PORT_CLKOUT GPIOA
@ -171,31 +143,16 @@
#define PIN_P25_LED GPIO_Pin_0 #define PIN_P25_LED GPIO_Pin_0
#define PORT_P25_LED GPIOB #define PORT_P25_LED GPIOB
#if defined(STM32_USB_HOST) #define PIN_NXDN_LED GPIO_Pin_8
#define PIN_NXDN_LED GPIO_Pin_1
#else
#define PIN_NXDN_LED GPIO_Pin_7
#endif
#define PORT_NXDN_LED GPIOA #define PORT_NXDN_LED GPIOA
// XXX FIXME
#if defined(STM32_USB_HOST)
#define PIN_M17_LED GPIO_Pin_1
#else
#define PIN_M17_LED GPIO_Pin_7
#endif
#define PORT_M17_LED GPIOA
#define PIN_POCSAG_LED GPIO_Pin_5
#define PORT_POCSAG_LED GPIOA
#define PIN_PTT_LED GPIO_Pin_14 #define PIN_PTT_LED GPIO_Pin_14
#define PORT_PTT_LED GPIOB #define PORT_PTT_LED GPIOB
#define PIN_COS_LED GPIO_Pin_15 #define PIN_COS_LED GPIO_Pin_15
#define PORT_COS_LED GPIOB #define PORT_COS_LED GPIOB
#elif defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) #elif defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
#define PIN_SCLK GPIO_Pin_5 #define PIN_SCLK GPIO_Pin_5
#define PORT_SCLK GPIOB #define PORT_SCLK GPIOB
@ -261,13 +218,6 @@
#define PIN_NXDN_LED GPIO_Pin_8 #define PIN_NXDN_LED GPIO_Pin_8
#define PORT_NXDN_LED GPIOA #define PORT_NXDN_LED GPIOA
// XXX FIXME
#define PIN_M17_LED GPIO_Pin_8
#define PORT_M17_LED GPIOA
#define PIN_POCSAG_LED GPIO_Pin_7
#define PORT_POCSAG_LED GPIOA
#define PIN_PTT_LED GPIO_Pin_14 #define PIN_PTT_LED GPIO_Pin_14
#define PORT_PTT_LED GPIOB #define PORT_PTT_LED GPIOB
@ -275,7 +225,7 @@
#define PORT_COS_LED GPIOB #define PORT_COS_LED GPIOB
#else #else
#error "Either PI_HAT_7021_REV_02, ZUMSPOT_ADF7021, LONESTAR_USB, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT, NANO_DV_REV11, D2RG_MMDVM_HS or SKYBRIDGE_HS need to be defined" #error "Either PI_HAT_7021_REV_02, ZUMSPOT_ADF7021, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT or NANO_DV_REV10 need to be defined"
#endif #endif
extern "C" { extern "C" {
@ -297,7 +247,7 @@ extern "C" {
} }
#endif #endif
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS) #elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
#if defined(BIDIR_DATA_PIN) #if defined(BIDIR_DATA_PIN)
void EXTI3_IRQHandler(void) { void EXTI3_IRQHandler(void) {
@ -317,17 +267,10 @@ extern "C" {
#if defined(DUPLEX) #if defined(DUPLEX)
void EXTI9_5_IRQHandler(void) { void EXTI9_5_IRQHandler(void) {
#if defined(ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS)
if(EXTI_GetITStatus(EXTI_Line8)!=RESET) {
io.interrupt2();
EXTI_ClearITPendingBit(EXTI_Line8);
}
#else
if(EXTI_GetITStatus(EXTI_Line5)!=RESET) { if(EXTI_GetITStatus(EXTI_Line5)!=RESET) {
io.interrupt2(); io.interrupt2();
EXTI_ClearITPendingBit(EXTI_Line5); EXTI_ClearITPendingBit(EXTI_Line5);
} }
#endif
} }
#endif #endif
@ -336,72 +279,41 @@ extern "C" {
void CIO::Init() void CIO::Init()
{ {
GPIO_InitTypeDef GPIO_InitStruct; // USB Conf IO:
GPIO_StructInit(&GPIO_InitStruct); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
#if defined(PI_HAT_7021_REV_02)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE);
#elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
#endif
RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_1Div5);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
EXTI_InitTypeDef EXTI_InitStructure; EXTI_InitTypeDef EXTI_InitStructure;
#if defined(DUPLEX) #if defined(DUPLEX)
EXTI_InitTypeDef EXTI_InitStructure2; EXTI_InitTypeDef EXTI_InitStructure2;
#endif #endif
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE); GPIO_InitTypeDef GPIO_InitStruct;
GPIO_StructInit(&GPIO_InitStruct);
#if defined(PI_HAT_7021_REV_02) // Pin PA12 = LOW, USB Reset in generic boards
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE);
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS)
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
#endif
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
// Pin defines if the board has a single ADF7021 or double
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_SGL_DBL; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(PORT_SGL_DBL, &GPIO_InitStruct);
// Pin defines if the board is dual band or duplex
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_DL_DPX;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(PORT_DL_DPX, &GPIO_InitStruct);
// Pin will set UHF or VHF
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_SET_BAND;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(PORT_SET_BAND, &GPIO_InitStruct);
// TODO: Remove this line
// GPIO_WriteBit(PORT_SET_BAND, PIN_SET_BAND, Bit_RESET);
#endif
#if defined(STM32_USB_HOST)
// Pin PA11,PA12 = LOW, USB Reset
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStruct); GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_WriteBit(GPIOA, GPIO_Pin_11, Bit_RESET);
GPIO_WriteBit(GPIOA, GPIO_Pin_12, Bit_RESET); GPIO_WriteBit(GPIOA, GPIO_Pin_12, Bit_RESET);
#endif
#if defined(LONG_USB_RESET)
// 10 ms delay
delay_us(10000U);
#else
volatile unsigned int delay; volatile unsigned int delay;
for(delay = 0;delay<512;delay++); for(delay = 0;delay<512;delay++);
#endif
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12; GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStruct); GPIO_Init(GPIOA, &GPIO_InitStruct);
RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_1Div5);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
// Pin SCLK // Pin SCLK
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_SCLK; GPIO_InitStruct.GPIO_Pin = PIN_SCLK;
@ -463,7 +375,6 @@ void CIO::Init()
#endif #endif
GPIO_Init(PORT_TXD, &GPIO_InitStruct); GPIO_Init(PORT_TXD, &GPIO_InitStruct);
#if defined(DUPLEX) #if defined(DUPLEX)
GPIO_InitStruct.GPIO_Pin = PIN_TXD2;
GPIO_Init(PORT_TXD2, &GPIO_InitStruct); GPIO_Init(PORT_TXD2, &GPIO_InitStruct);
#endif #endif
@ -517,12 +428,6 @@ void CIO::Init()
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(PORT_NXDN_LED, &GPIO_InitStruct); GPIO_Init(PORT_NXDN_LED, &GPIO_InitStruct);
// POCSAG LED
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_POCSAG_LED;
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(PORT_POCSAG_LED, &GPIO_InitStruct);
// PTT LED // PTT LED
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStruct.GPIO_Pin = PIN_PTT_LED; GPIO_InitStruct.GPIO_Pin = PIN_PTT_LED;
@ -549,7 +454,7 @@ void CIO::Init()
EXTI_InitStructure.EXTI_Line = EXTI_Line14; EXTI_InitStructure.EXTI_Line = EXTI_Line14;
#endif #endif
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS) #elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
#if defined(BIDIR_DATA_PIN) #if defined(BIDIR_DATA_PIN)
// Connect EXTI3 Line // Connect EXTI3 Line
@ -567,11 +472,7 @@ void CIO::Init()
// Connect EXTI5 Line // Connect EXTI5 Line
GPIO_EXTILineConfig(PORT_TXD2_INT, PIN_TXD2_INT); GPIO_EXTILineConfig(PORT_TXD2_INT, PIN_TXD2_INT);
// Configure EXT5 line // Configure EXT5 line
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
EXTI_InitStructure2.EXTI_Line = EXTI_Line8;
#else
EXTI_InitStructure2.EXTI_Line = EXTI_Line5; EXTI_InitStructure2.EXTI_Line = EXTI_Line5;
#endif
#endif #endif
#endif #endif
@ -601,7 +502,7 @@ void CIO::startInt()
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn; NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS) #elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
#if defined(BIDIR_DATA_PIN) #if defined(BIDIR_DATA_PIN)
// Enable and set EXTI3 Interrupt // Enable and set EXTI3 Interrupt
@ -751,24 +652,13 @@ void CIO::NXDN_pin(bool on)
#endif #endif
} }
void CIO::M17_pin(bool on)
{
#if defined(USE_ALTERNATE_M17_LEDS)
GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET);
GPIO_WriteBit(PORT_P25_LED, PIN_P25_LED, on ? Bit_SET : Bit_RESET);
#else
GPIO_WriteBit(PORT_M17_LED, PIN_M17_LED, on ? Bit_SET : Bit_RESET);
#endif
}
void CIO::POCSAG_pin(bool on) void CIO::POCSAG_pin(bool on)
{ {
#if defined(USE_ALTERNATE_POCSAG_LEDS) #if defined(USE_ALTERNATE_POCSAG_LEDS)
GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET); GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET);
GPIO_WriteBit(PORT_DMR_LED, PIN_DMR_LED, on ? Bit_SET : Bit_RESET); GPIO_WriteBit(PORT_DMR_LED, PIN_DMR_LED, on ? Bit_SET : Bit_RESET);
#else
GPIO_WriteBit(PORT_POCSAG_LED, PIN_POCSAG_LED, on ? Bit_SET : Bit_RESET);
#endif #endif
// TODO: add a separate LED pin for POCSAG mode
} }
void CIO::PTT_pin(bool on) void CIO::PTT_pin(bool on)
@ -781,19 +671,6 @@ void CIO::COS_pin(bool on)
GPIO_WriteBit(PORT_COS_LED, PIN_COS_LED, on ? Bit_SET : Bit_RESET); GPIO_WriteBit(PORT_COS_LED, PIN_COS_LED, on ? Bit_SET : Bit_RESET);
} }
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
void CIO::setBandVHF(bool vhf_on) {
GPIO_WriteBit(PORT_SET_BAND, PIN_SET_BAND, vhf_on ? Bit_SET : Bit_RESET);
}
bool CIO::hasSingleADF7021() {
return GPIO_ReadInputDataBit(PORT_SGL_DBL, PIN_SGL_DBL) == Bit_SET;
}
bool CIO::isDualBand() {
return GPIO_ReadInputDataBit(PORT_DL_DPX, PIN_DL_DPX) == Bit_SET;
}
#endif
/** /**
* Function delay_us() from stm32duino project * Function delay_us() from stm32duino project

View file

@ -1,41 +0,0 @@
/*
* Copyright (C) 2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(M17DEFINES_H)
#define M17DEFINES_H
const unsigned int M17_RADIO_SYMBOL_LENGTH = 5U; // At 24 kHz sample rate
const unsigned int M17_FRAME_LENGTH_BITS = 384U;
const unsigned int M17_FRAME_LENGTH_BYTES = M17_FRAME_LENGTH_BITS / 8U;
const unsigned int M17_SYNC_LENGTH_BITS = 16U;
const unsigned int M17_SYNC_LENGTH_BYTES = M17_SYNC_LENGTH_BITS / 8U;
const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U};
const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU};
const uint8_t M17_EOT_SYNC_BYTES[] = {0x55U, 0x5DU};
const uint8_t M17_SYNC_BYTES_LENGTH = 2U;
const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U;
const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU;
const uint16_t M17_EOT_SYNC_BITS = 0x555DU;
#endif

203
M17RX.cpp
View file

@ -1,203 +0,0 @@
/*
* Copyright (C) 2009-2018,2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2016-2018 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "Config.h"
#include "Globals.h"
#include "M17RX.h"
#include "Utils.h"
const uint8_t MAX_SYNC_BIT_START_ERRS = 0U;
const uint8_t MAX_SYNC_BIT_RUN_ERRS = 2U;
const unsigned int MAX_SYNC_FRAMES = 3U + 1U;
const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U};
#define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
CM17RX::CM17RX() :
m_state(M17RXS_NONE),
m_bitBuffer(0x00U),
m_outBuffer(),
m_buffer(NULL),
m_bufferPtr(0U),
m_lostCount(0U)
{
m_buffer = m_outBuffer + 1U;
}
void CM17RX::reset()
{
m_state = M17RXS_NONE;
m_bitBuffer = 0x00U;
m_bufferPtr = 0U;
m_lostCount = 0U;
}
void CM17RX::databit(bool bit)
{
switch (m_state) {
case M17RXS_LINK_SETUP:
case M17RXS_STREAM:
processData(bit);
break;
default:
processNone(bit);
break;
}
}
void CM17RX::processNone(bool bit)
{
m_bitBuffer <<= 1;
if (bit)
m_bitBuffer |= 0x01U;
// Exact matching of the link setup sync bit sequence
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
DEBUG1("M17RX: link setup sync found in None");
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
m_buffer[i] = M17_LINK_SETUP_SYNC_BYTES[i];
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
m_state = M17RXS_LINK_SETUP;
io.setDecode(true);
return;
}
// Exact matching of the stream sync bit sequence
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
DEBUG1("M17RX: stream sync found in None");
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
m_buffer[i] = M17_STREAM_SYNC_BYTES[i];
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
m_state = M17RXS_STREAM;
io.setDecode(true);
return;
}
}
void CM17RX::processData(bool bit)
{
m_bitBuffer <<= 1;
if (bit)
m_bitBuffer |= 0x01U;
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
m_bufferPtr++;
if (m_bufferPtr > M17_FRAME_LENGTH_BITS)
reset();
// Only search for the syncs in the right place +-1 bit
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 1U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 1U)) {
// Fuzzy matching of the link setup sync bit sequence
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found link setup sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
m_state = M17RXS_LINK_SETUP;
return;
}
// Fuzzy matching of the stream sync bit sequence
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found stream sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = M17_SYNC_LENGTH_BITS;
m_state = M17RXS_STREAM;
return;
}
// Fuzzy matching of the EOT sync bit sequence
if (countBits16(m_bitBuffer ^ M17_EOT_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
DEBUG2("M17RX: found eot sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
io.setDecode(false);
serial.writeM17EOT();
reset();
return;
}
}
// Send a frame to the host if the required number of bits have been received
if (m_bufferPtr == M17_FRAME_LENGTH_BITS) {
// We've not seen a sync for too long, signal RXLOST and change to RX_NONE
m_lostCount--;
if (m_lostCount == 0U) {
DEBUG1("M17RX: sync timed out, lost lock");
io.setDecode(false);
serial.writeM17Lost();
reset();
} else {
// Write data to host
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
switch (m_state) {
case M17RXS_LINK_SETUP:
writeRSSILinkSetup(m_outBuffer);
break;
case M17RXS_STREAM:
writeRSSIStream(m_outBuffer);
break;
default:
break;
}
// Start the next frame
::memset(m_outBuffer, 0x00U, M17_FRAME_LENGTH_BYTES + 3U);
m_bufferPtr = 0U;
}
}
}
void CM17RX::writeRSSILinkSetup(uint8_t* data)
{
#if defined(SEND_RSSI_DATA)
uint16_t rssi = io.readRSSI();
data[49U] = (rssi >> 8) & 0xFFU;
data[50U] = (rssi >> 0) & 0xFFU;
serial.writeM17LinkSetup(data, M17_FRAME_LENGTH_BYTES + 3U);
#else
serial.writeM17LinkSetup(data, M17_FRAME_LENGTH_BYTES + 1U);
#endif
}
void CM17RX::writeRSSIStream(uint8_t* data)
{
#if defined(SEND_RSSI_DATA)
uint16_t rssi = io.readRSSI();
data[49U] = (rssi >> 8) & 0xFFU;
data[50U] = (rssi >> 0) & 0xFFU;
serial.writeM17Stream(data, M17_FRAME_LENGTH_BYTES + 3U);
#else
serial.writeM17Stream(data, M17_FRAME_LENGTH_BYTES + 1U);
#endif
}

54
M17RX.h
View file

@ -1,54 +0,0 @@
/*
* Copyright (C) 2015-2018,2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2016-2018 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(M17RX_H)
#define M17RX_H
#include "M17Defines.h"
enum M17RX_STATE {
M17RXS_NONE,
M17RXS_LINK_SETUP,
M17RXS_STREAM
};
class CM17RX {
public:
CM17RX();
void databit(bool bit);
void reset();
private:
M17RX_STATE m_state;
uint16_t m_bitBuffer;
uint8_t m_outBuffer[M17_FRAME_LENGTH_BYTES + 3U];
uint8_t* m_buffer;
uint16_t m_bufferPtr;
uint16_t m_lostCount;
void processNone(bool bit);
void processData(bool bit);
void writeRSSILinkSetup(uint8_t* data);
void writeRSSIStream(uint8_t* data);
};
#endif

124
M17TX.cpp
View file

@ -1,124 +0,0 @@
/*
* Copyright (C) 2009-2018,2020,2021 by Jonathan Naylor G4KLX
* Copyright (C) 2017 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "Config.h"
#include "Globals.h"
#include "M17TX.h"
#include "M17Defines.h"
const uint8_t M17_SYNC = 0x77U;
const uint8_t M17_PREAMBLE = 0x77U;
CM17TX::CM17TX() :
m_buffer(1500U),
m_poBuffer(),
m_poLen(0U),
m_poPtr(0U),
m_txDelay(240U), // 200ms
m_delay(false)
{
}
void CM17TX::process()
{
if (m_buffer.getData() == 0U && m_poLen == 0U)
return;
if (m_poLen == 0U) {
if (!m_tx) {
m_delay = true;
m_poLen = m_txDelay;
} else {
m_delay = false;
for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++)
m_poBuffer[m_poLen++] = m_buffer.get();
}
m_poPtr = 0U;
}
if (m_poLen > 0U) {
uint16_t space = io.getSpace();
while (space > 8U) {
if (m_delay) {
writeByte(M17_SYNC);
m_poPtr++;
} else
writeByte(m_poBuffer[m_poPtr++]);
space -= 8U;
if (m_poPtr >= m_poLen) {
if (m_delay) {
m_delay = false;
m_poPtr = 0U;
m_poLen = 3U;
} else {
m_poPtr = 0U;
m_poLen = 0U;
m_delay = false;
return;
}
}
}
}
}
uint8_t CM17TX::writeData(const uint8_t* data, uint8_t length)
{
if (length != (M17_FRAME_LENGTH_BYTES + 1U))
return 4U;
uint16_t space = m_buffer.getSpace();
if (space < M17_FRAME_LENGTH_BYTES)
return 5U;
for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++)
m_buffer.put(data[i + 1U]);
return 0U;
}
void CM17TX::writeByte(uint8_t c)
{
uint8_t bit;
uint8_t mask = 0x80U;
for (uint8_t i = 0U; i < 8U; i++, c <<= 1) {
if ((c & mask) == mask)
bit = 1U;
else
bit = 0U;
io.write(&bit, 1);
}
}
void CM17TX::setTXDelay(uint8_t delay)
{
m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay
}
uint8_t CM17TX::getSpace() const
{
return m_buffer.getSpace() / M17_FRAME_LENGTH_BYTES;
}

50
M17TX.h
View file

@ -1,50 +0,0 @@
/*
* Copyright (C) 2015,2016,2017,2020,2021 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(M17TX_H)
#define M17TX_H
#include "Config.h"
#include "SerialRB.h"
class CM17TX {
public:
CM17TX();
uint8_t writeData(const uint8_t* data, uint8_t length);
void process();
void setTXDelay(uint8_t delay);
uint8_t getSpace() const;
private:
CSerialRB m_buffer;
uint8_t m_poBuffer[1200U];
uint16_t m_poLen;
uint16_t m_poPtr;
uint16_t m_txDelay;
bool m_delay;
void writeByte(uint8_t c);
};
#endif

View file

@ -1,9 +1,8 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Mathis Schmieder DB9MAT * Copyright (C) 2016 by Mathis Schmieder DB9MAT
* Copyright (C) 2016 by Colin Durbridge G4EML * Copyright (C) 2016 by Colin Durbridge G4EML
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* Copyright (C) 2019 by Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -43,7 +42,6 @@ bool m_dmrEnable = true;
bool m_ysfEnable = true; bool m_ysfEnable = true;
bool m_p25Enable = true; bool m_p25Enable = true;
bool m_nxdnEnable = true; bool m_nxdnEnable = true;
bool m_m17Enable = true;
bool m_pocsagEnable = true; bool m_pocsagEnable = true;
bool m_duplex = false; bool m_duplex = false;
@ -71,9 +69,6 @@ CYSFTX ysfTX;
CP25RX p25RX; CP25RX p25RX;
CP25TX p25TX; CP25TX p25TX;
CM17RX m17RX;
CM17TX m17TX;
CNXDNRX nxdnRX; CNXDNRX nxdnRX;
CNXDNTX nxdnTX; CNXDNTX nxdnTX;
@ -90,10 +85,6 @@ CCWIdTX cwIdTX;
CSerialPort serial; CSerialPort serial;
CIO io; CIO io;
#if defined(STM32_I2C_HOST)
CI2CHost i2c;
#endif
void setup() void setup()
{ {
serial.start(); serial.start();
@ -129,13 +120,10 @@ void loop()
if (m_nxdnEnable && m_modemState == STATE_NXDN) if (m_nxdnEnable && m_modemState == STATE_NXDN)
nxdnTX.process(); nxdnTX.process();
if (m_m17Enable && m_modemState == STATE_M17)
m17TX.process();
if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy())) if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy()))
pocsagTX.process(); pocsagTX.process();
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K || m_calState == STATE_INTCAL) if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K)
calDMR.process(); calDMR.process();
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Colin Durbridge G4EML * Copyright (C) 2016 by Colin Durbridge G4EML
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
@ -38,7 +38,6 @@ bool m_dmrEnable = true;
bool m_ysfEnable = true; bool m_ysfEnable = true;
bool m_p25Enable = true; bool m_p25Enable = true;
bool m_nxdnEnable = true; bool m_nxdnEnable = true;
bool m_m17Enable = true;
bool m_pocsagEnable = true; bool m_pocsagEnable = true;
bool m_duplex = false; bool m_duplex = false;
@ -66,9 +65,6 @@ CYSFTX ysfTX;
CP25RX p25RX; CP25RX p25RX;
CP25TX p25TX; CP25TX p25TX;
CM17RX m17RX;
CM17TX m17TX;
CNXDNRX nxdnRX; CNXDNRX nxdnRX;
CNXDNTX nxdnTX; CNXDNTX nxdnTX;
@ -119,13 +115,10 @@ void loop()
if (m_nxdnEnable && m_modemState == STATE_NXDN) if (m_nxdnEnable && m_modemState == STATE_NXDN)
nxdnTX.process(); nxdnTX.process();
if (m_m17Enable && m_modemState == STATE_M17)
m17TX.process();
if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy())) if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy()))
pocsagTX.process(); pocsagTX.process();
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K || m_calState == STATE_INTCAL) if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K)
calDMR.process(); calDMR.process();
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)

151
Makefile
View file

@ -1,4 +1,4 @@
# Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
# Copyright (C) 2016 by Jim McLaughlin KI6ZUM # Copyright (C) 2016 by Jim McLaughlin KI6ZUM
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@ -40,9 +40,6 @@ BINBIN_F1=mmdvm_f1.bin
BINELF_F1BL=mmdvm_f1bl.elf BINELF_F1BL=mmdvm_f1bl.elf
BINHEX_F1BL=mmdvm_f1bl.hex BINHEX_F1BL=mmdvm_f1bl.hex
BINBIN_F1BL=mmdvm_f1bl.bin BINBIN_F1BL=mmdvm_f1bl.bin
BINELF_F1NOBL=mmdvm_f1nobl.elf
BINHEX_F1NOBL=mmdvm_f1nobl.hex
BINBIN_F1NOBL=mmdvm_f1nobl.bin
BINELF_F4=mmdvm_f4.elf BINELF_F4=mmdvm_f4.elf
BINHEX_F4=mmdvm_f4.hex BINHEX_F4=mmdvm_f4.hex
BINBIN_F4=mmdvm_f4.bin BINBIN_F4=mmdvm_f4.bin
@ -106,31 +103,21 @@ ifeq ($(OS),Windows_NT)
DFU_UTIL=./$(F1_LIB_PATH)/utils/win/dfu-util.exe DFU_UTIL=./$(F1_LIB_PATH)/utils/win/dfu-util.exe
STM32FLASH=./$(F1_LIB_PATH)/utils/win/stm32flash.exe STM32FLASH=./$(F1_LIB_PATH)/utils/win/stm32flash.exe
else else
CLEANCMD=rm -f $(OBJ_F1BL) $(OBJ_F4) $(OBJ_F7) $(BINDIR)/*.hex $(BINDIR)/mmdvm_f1.bin $(BINDIR)/mmdvm_f1bl.bin $(BINDIR)/mmdvm_f1nobl.bin $(BINDIR)/*.elf CLEANCMD=rm -f $(OBJ_F1BL) $(OBJ_F4) $(OBJ_F7) $(BINDIR)/*.hex $(BINDIR)/mmdvm_f1.bin $(BINDIR)/*.elf
MDDIRS=mkdir $@ MDDIRS=mkdir $@
ifeq ($(shell uname -s),Linux) ifeq ($(shell uname -s),Linux)
ST_FLASH_ON_PATH=$(shell which st-flash) ifeq ($(shell uname -m),x86_64)
ST_FLASH_IS_ON_PATH=$(.SHELLSTATUS)
ifeq ($(shell uname -m),x86_64)
DFU_RST=./$(F1_LIB_PATH)/utils/linux64/upload-reset DFU_RST=./$(F1_LIB_PATH)/utils/linux64/upload-reset
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux64/dfu-util DFU_UTIL=./$(F1_LIB_PATH)/utils/linux64/dfu-util
DFU_RST=./$(F1_LIB_PATH)/utils/linux64/upload-reset ST_FLASH=./$(F1_LIB_PATH)/utils/linux64/st-flash
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux64/dfu-util
ifeq ($(ST_FLASH_IS_ON_PATH),0)
ST_FLASH=$(ST_FLASH_ON_PATH)
ST_FLASH_OPTS=--flash=128k
else
ST_FLASH=./$(F1_LIB_PATH)/utils/linux64/st-flash
ST_FLASH_OPTS=
endif
STM32FLASH=./$(F1_LIB_PATH)/utils/linux64/stm32flash STM32FLASH=./$(F1_LIB_PATH)/utils/linux64/stm32flash
else ifeq ($(shell uname -m),armv7l) else ifeq ($(shell uname -m),armv7l)
DFU_RST=./$(F1_LIB_PATH)/utils/rpi32/upload-reset DFU_RST=./$(F1_LIB_PATH)/utils/rpi32/upload-reset
DFU_UTIL=./$(F1_LIB_PATH)/utils/rpi32/dfu-util DFU_UTIL=./$(F1_LIB_PATH)/utils/rpi32/dfu-util
ST_FLASH=./$(F1_LIB_PATH)/utils/rpi32/st-flash ST_FLASH=./$(F1_LIB_PATH)/utils/rpi32/st-flash
STM32FLASH=./$(F1_LIB_PATH)/utils/rpi32/stm32flash STM32FLASH=./$(F1_LIB_PATH)/utils/rpi32/stm32flash
else ifeq ($(shell uname -m),armv6l) else ifeq ($(shell uname -m),armv6l)
DFU_RST=./$(F1_LIB_PATH)/utils/rpi32/upload-reset DFU_RST=./$(F1_LIB_PATH)/utils/rpi32/upload-reset
DFU_UTIL=./$(F1_LIB_PATH)/utils/rpi32/dfu-util DFU_UTIL=./$(F1_LIB_PATH)/utils/rpi32/dfu-util
ST_FLASH=./$(F1_LIB_PATH)/utils/rpi32/st-flash ST_FLASH=./$(F1_LIB_PATH)/utils/rpi32/st-flash
@ -138,23 +125,17 @@ else
else else
DFU_RST=./$(F1_LIB_PATH)/utils/linux/upload-reset DFU_RST=./$(F1_LIB_PATH)/utils/linux/upload-reset
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux/dfu-util DFU_UTIL=./$(F1_LIB_PATH)/utils/linux/dfu-util
ifeq ($(ST_FLASH_IS_ON_PATH),0) ST_FLASH=./$(F1_LIB_PATH)/utils/linux/st-flash
ST_FLASH=$(ST_FLASH_ON_PATH)
ST_FLASH_OPTS=--flash=128k
else
ST_FLASH=./$(F1_LIB_PATH)/utils/linux/st-flash
ST_FLASH_OPTS=
endif
STM32FLASH=./$(F1_LIB_PATH)/utils/linux/stm32flash STM32FLASH=./$(F1_LIB_PATH)/utils/linux/stm32flash
endif endif
endif endif
ifeq ($(shell uname -s),Darwin) ifeq ($(shell uname -s),Darwin)
DFU_RST=./$(F1_LIB_PATH)/utils/macosx/upload-reset DFU_RST=./$(F1_LIB_PATH)/utils/macosx/upload-reset
DFU_UTIL=./$(F1_LIB_PATH)/utils/macosx/dfu-util DFU_UTIL=./$(F1_LIB_PATH)/utils/macosx/dfu-util
ST_FLASH=./$(F1_LIB_PATH)/utils/macosx/st-flash ST_FLASH=./$(F1_LIB_PATH)/utils/macosx/st-flash
STM32FLASH=./$(F1_LIB_PATH)/utils/macosx/stm32flash STM32FLASH=./$(F1_LIB_PATH)/utils/macosx/stm32flash
endif endif
endif endif
# Default reference oscillator frequencies # Default reference oscillator frequencies
@ -219,7 +200,7 @@ CXXFLAGS=-Os -fno-exceptions -ffunction-sections -fdata-sections -nostdlib -fno-
LDFLAGS=-Os --specs=nano.specs --specs=nosys.specs LDFLAGS=-Os --specs=nano.specs --specs=nosys.specs
# Build Rules # Build Rules
.PHONY: all release_f1 release_f4 release_f7 hs bl nobl pi-f4 f446 f767 clean .PHONY: all release_f1 release_f4 release_f7 hs bl pi-f4 f446 f767 clean
all: hs all: hs
@ -248,11 +229,6 @@ bl: CXXFLAGS+=$(CXXFLAGS_F1) $(DEFS_F1_HS_BL)
bl: LDFLAGS+=$(LDFLAGS_F1_BL) bl: LDFLAGS+=$(LDFLAGS_F1_BL)
bl: release_f1bl bl: release_f1bl
nobl: CFLAGS+=$(CFLAGS_F1) $(DEFS_F1_HS)
nobl: CXXFLAGS+=$(CXXFLAGS_F1) $(DEFS_F1_HS)
nobl: LDFLAGS+=$(LDFLAGS_F1_N)
nobl: release_f1nobl
release_f1: GitVersion.h release_f1: GitVersion.h
release_f1: $(BINDIR) release_f1: $(BINDIR)
release_f1: $(OBJDIR_F1) release_f1: $(OBJDIR_F1)
@ -265,12 +241,6 @@ release_f1bl: $(OBJDIR_F1)
release_f1bl: $(BINDIR)/$(BINHEX_F1BL) release_f1bl: $(BINDIR)/$(BINHEX_F1BL)
release_f1bl: $(BINDIR)/$(BINBIN_F1BL) release_f1bl: $(BINDIR)/$(BINBIN_F1BL)
release_f1nobl: GitVersion.h
release_f1nobl: $(BINDIR)
release_f1nobl: $(OBJDIR_F1)
release_f1nobl: $(BINDIR)/$(BINHEX_F1NOBL)
release_f1nobl: $(BINDIR)/$(BINBIN_F1NOBL)
release_f4: GitVersion.h release_f4: GitVersion.h
release_f4: $(BINDIR) release_f4: $(BINDIR)
release_f4: $(OBJDIR_F4) release_f4: $(OBJDIR_F4)
@ -308,19 +278,6 @@ $(BINDIR)/$(BINELF_F1BL): $(OBJ_F1BL)
@echo "Linking complete!\n" @echo "Linking complete!\n"
$(SIZE) $(BINDIR)/$(BINELF_F1BL) $(SIZE) $(BINDIR)/$(BINELF_F1BL)
$(BINDIR)/$(BINHEX_F1NOBL): $(BINDIR)/$(BINELF_F1NOBL)
$(CP) -O ihex $< $@
@echo "Objcopy from ELF to IHEX complete!\n"
$(BINDIR)/$(BINBIN_F1NOBL): $(BINDIR)/$(BINELF_F1NOBL)
$(CP) -O binary $< $@
@echo "Objcopy from ELF to BINARY complete!\n"
$(BINDIR)/$(BINELF_F1NOBL): $(OBJ_F1BL)
$(CXX) $(OBJ_F1BL) $(LDFLAGS) -o $@
@echo "Linking complete!\n"
$(SIZE) $(BINDIR)/$(BINELF_F1NOBL)
$(BINDIR)/$(BINHEX_F1): $(BINDIR)/$(BINELF_F1) $(BINDIR)/$(BINHEX_F1): $(BINDIR)/$(BINELF_F1)
$(CP) -O ihex $< $@ $(CP) -O ihex $< $@
@echo "Objcopy from ELF to IHEX complete!\n" @echo "Objcopy from ELF to IHEX complete!\n"
@ -421,35 +378,17 @@ clean:
$(RM) GitVersion.h $(RM) GitVersion.h
stlink: stlink:
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1) 0x8000000 $(ST_FLASH) write bin/$(BINBIN_F1) 0x8000000
stlink-nobl:
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1NOBL) 0x8000000
stlink-bl: stlink-bl:
$(ST_FLASH) $(ST_FLASH_OPTS) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin 0x8000000 $(ST_FLASH) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin 0x8000000
sleep 3 $(ST_FLASH) write bin/$(BINBIN_F1BL) 0x8002000
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1BL) 0x8002000
stlink-bl-old:
$(ST_FLASH) $(ST_FLASH_OPTS) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin 0x8000000
sleep 3
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1BL) 0x8002000
serial: serial:
$(STM32FLASH) -v -w bin/$(BINBIN_F1) -g 0x0 $(devser) $(STM32FLASH) -v -w bin/$(BINBIN_F1) -g 0x0 $(devser)
serial-nobl:
$(STM32FLASH) -v -w bin/$(BINBIN_F1NOBL) -g 0x0 $(devser)
serial-bl: serial-bl:
$(STM32FLASH) -v -w $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin -g 0x0 $(devser)
sleep 3
$(STM32FLASH) -v -w bin/$(BINBIN_F1BL) -g 0x0 -S 0x08002000 $(devser)
serial-bl-old:
$(STM32FLASH) -v -w $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin -g 0x0 $(devser) $(STM32FLASH) -v -w $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin -g 0x0 $(devser)
sleep 3
$(STM32FLASH) -v -w bin/$(BINBIN_F1BL) -g 0x0 -S 0x08002000 $(devser) $(STM32FLASH) -v -w bin/$(BINBIN_F1BL) -g 0x0 -S 0x08002000 $(devser)
nano-hotspot: nano-hotspot:
@ -463,20 +402,11 @@ endif
nano-dv: nano-dv:
ifneq ($(wildcard /usr/local/bin/stm32flash),) ifneq ($(wildcard /usr/local/bin/stm32flash),)
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0 /usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0
endif endif
ifneq ($(wildcard /usr/bin/stm32flash),) ifneq ($(wildcard /usr/bin/stm32flash),)
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0 /usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0
endif
d2rg_mmdvm_hs:
ifneq ($(wildcard /usr/local/bin/stm32flash),)
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0
endif
ifneq ($(wildcard /usr/bin/stm32flash),)
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0
endif endif
zumspot-pi: zumspot-pi:
@ -492,21 +422,6 @@ mmdvm_hs_hat: zumspot-pi
mmdvm_hs_dual_hat: zumspot-pi mmdvm_hs_dual_hat: zumspot-pi
skybridge: zumspot-pi
hotpot-opipc_opipcplus:
ifneq ($(wildcard /usr/local/bin/stm32flash),)
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
endif
ifneq ($(wildcard /usr/bin/stm32flash),)
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
endif
mmdvm_hs_hat_opi: hotpot-opipc_opipcplus
mmdvm_hs_dual_hat_opi: hotpot-opipc_opipcplus
dfu: dfu:
ifdef devser ifdef devser
$(DFU_RST) $(devser) 750 $(DFU_RST) $(devser) 750
@ -526,36 +441,7 @@ ifneq ($(wildcard /opt/openocd/bin/openocd),)
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1) verify reset exit" /opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1) verify reset exit"
endif endif
ocd-nobl:
ifneq ($(wildcard /usr/bin/openocd),)
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
endif
ifneq ($(wildcard /usr/local/bin/openocd),)
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
endif
ifneq ($(wildcard /opt/openocd/bin/openocd),)
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
endif
ocd-bl: ocd-bl:
ifneq ($(wildcard /usr/bin/openocd),)
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
endif
ifneq ($(wildcard /usr/local/bin/openocd),)
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
endif
ifneq ($(wildcard /opt/openocd/bin/openocd),)
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
endif
ocd-bl-old:
ifneq ($(wildcard /usr/bin/openocd),) ifneq ($(wildcard /usr/bin/openocd),)
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin verify reset exit 0x08000000" /usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin verify reset exit 0x08000000"
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000" /usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
@ -586,3 +472,4 @@ endif
endif endif
.FORCE: .FORCE:

View file

@ -1,6 +1,5 @@
/* /*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,10 +19,16 @@
#if !defined(NXDNDEFINES_H) #if !defined(NXDNDEFINES_H)
#define NXDNDEFINES_H #define NXDNDEFINES_H
const unsigned int NXDN_FRAME_LENGTH_BITS = 384U; const unsigned int NXDN_RADIO_SYMBOL_LENGTH = 10U; // At 24 kHz sample rate
const unsigned int NXDN_FRAME_LENGTH_BYTES = NXDN_FRAME_LENGTH_BITS / 8U;
const unsigned int NXDN_FRAME_LENGTH_BITS = 384U;
const unsigned int NXDN_FRAME_LENGTH_BYTES = NXDN_FRAME_LENGTH_BITS / 8U;
const unsigned int NXDN_FRAME_LENGTH_SYMBOLS = NXDN_FRAME_LENGTH_BITS / 2U;
const unsigned int NXDN_FRAME_LENGTH_SAMPLES = NXDN_FRAME_LENGTH_SYMBOLS * NXDN_RADIO_SYMBOL_LENGTH;
const unsigned int NXDN_FSW_LENGTH_BITS = 20U; const unsigned int NXDN_FSW_LENGTH_BITS = 20U;
const unsigned int NXDN_FSW_LENGTH_SYMBOLS = NXDN_FSW_LENGTH_BITS / 2U;
const unsigned int NXDN_FSW_LENGTH_SAMPLES = NXDN_FSW_LENGTH_SYMBOLS * NXDN_RADIO_SYMBOL_LENGTH;
const uint8_t NXDN_FSW_BYTES[] = {0xCDU, 0xF5U, 0x90U}; const uint8_t NXDN_FSW_BYTES[] = {0xCDU, 0xF5U, 0x90U};
const uint8_t NXDN_FSW_BYTES_MASK[] = {0xFFU, 0xFFU, 0xF0U}; const uint8_t NXDN_FSW_BYTES_MASK[] = {0xFFU, 0xFFU, 0xF0U};
@ -32,4 +37,14 @@ const uint8_t NXDN_FSW_BYTES_LENGTH = 3U;
const uint32_t NXDN_FSW_BITS = 0x000CDF59U; const uint32_t NXDN_FSW_BITS = 0x000CDF59U;
const uint32_t NXDN_FSW_BITS_MASK = 0x000FFFFFU; const uint32_t NXDN_FSW_BITS_MASK = 0x000FFFFFU;
// C D F 5 9
// 11 00 11 01 11 11 01 01 10 01
// -3 +1 -3 +3 -3 -3 +3 +3 -1 +3
const int8_t NXDN_FSW_SYMBOLS_VALUES[] = {-3, +1, -3, +3, -3, -3, +3, +3, -1, +3};
const uint16_t NXDN_FSW_SYMBOLS = 0x014DU;
const uint16_t NXDN_FSW_SYMBOLS_MASK = 0x03FFU;
#endif #endif

View file

@ -32,6 +32,7 @@ const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02
#define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7]) #define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
CNXDNRX::CNXDNRX() : CNXDNRX::CNXDNRX() :
m_prev(false),
m_state(NXDNRXS_NONE), m_state(NXDNRXS_NONE),
m_bitBuffer(0x00U), m_bitBuffer(0x00U),
m_outBuffer(), m_outBuffer(),
@ -44,6 +45,7 @@ m_lostCount(0U)
void CNXDNRX::reset() void CNXDNRX::reset()
{ {
m_prev = false;
m_state = NXDNRXS_NONE; m_state = NXDNRXS_NONE;
m_bitBuffer = 0x00U; m_bitBuffer = 0x00U;
m_bufferPtr = 0U; m_bufferPtr = 0U;
@ -75,6 +77,7 @@ void CNXDNRX::processNone(bool bit)
m_state = NXDNRXS_DATA; m_state = NXDNRXS_DATA;
io.setDecode(true); io.setDecode(true);
} }
} }
@ -86,10 +89,7 @@ void CNXDNRX::processData(bool bit)
m_bitBuffer |= 0x01U; m_bitBuffer |= 0x01U;
WRITE_BIT1(m_buffer, m_bufferPtr, bit); WRITE_BIT1(m_buffer, m_bufferPtr, bit);
m_bufferPtr++; m_bufferPtr++;
if (m_bufferPtr > NXDN_FRAME_LENGTH_BITS)
reset();
// Only search for a sync in the right place +-2 symbols // Only search for a sync in the right place +-2 symbols
if (m_bufferPtr >= (NXDN_FSW_LENGTH_BITS - 2U) && m_bufferPtr <= (NXDN_FSW_LENGTH_BITS + 2U)) { if (m_bufferPtr >= (NXDN_FSW_LENGTH_BITS - 2U) && m_bufferPtr <= (NXDN_FSW_LENGTH_BITS + 2U)) {
@ -108,11 +108,13 @@ void CNXDNRX::processData(bool bit)
if (m_lostCount == 0U) { if (m_lostCount == 0U) {
DEBUG1("NXDNRX: sync timed out, lost lock"); DEBUG1("NXDNRX: sync timed out, lost lock");
io.setDecode(false); io.setDecode(false);
serial.writeNXDNLost(); serial.writeNXDNLost();
reset();
m_state = NXDNRXS_NONE;
} else { } else {
// Write data to host
m_outBuffer[0U] = m_lostCount == (MAX_FSW_FRAMES - 1U) ? 0x01U : 0x00U; m_outBuffer[0U] = m_lostCount == (MAX_FSW_FRAMES - 1U) ? 0x01U : 0x00U;
writeRSSIData(m_outBuffer); writeRSSIData(m_outBuffer);
// Start the next frame // Start the next frame

View file

@ -36,6 +36,7 @@ public:
void reset(); void reset();
private: private:
bool m_prev;
NXDNRX_STATE m_state; NXDNRX_STATE m_state;
uint64_t m_bitBuffer; uint64_t m_bitBuffer;
uint8_t m_outBuffer[NXDN_FRAME_LENGTH_BYTES + 3U]; uint8_t m_outBuffer[NXDN_FRAME_LENGTH_BYTES + 3U];
@ -50,3 +51,4 @@ private:
}; };
#endif #endif

View file

@ -1,6 +1,5 @@
/* /*
* Copyright (C) 2016 by Jonathan Naylor G4KLX * Copyright (C) 2016 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -22,27 +21,26 @@
const unsigned int P25_HDR_FRAME_LENGTH_BYTES = 99U; const unsigned int P25_HDR_FRAME_LENGTH_BYTES = 99U;
const unsigned int P25_HDR_FRAME_LENGTH_BITS = P25_HDR_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_HDR_FRAME_LENGTH_BITS = P25_HDR_FRAME_LENGTH_BYTES * 8U;
const unsigned int P25_HDR_FRAME_LENGTH_SYMBOLS = P25_HDR_FRAME_LENGTH_BYTES * 4U;
const unsigned int P25_LDU_FRAME_LENGTH_BYTES = 216U; const unsigned int P25_LDU_FRAME_LENGTH_BYTES = 216U;
const unsigned int P25_LDU_FRAME_LENGTH_BITS = P25_LDU_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_LDU_FRAME_LENGTH_BITS = P25_LDU_FRAME_LENGTH_BYTES * 8U;
const unsigned int P25_LDU_FRAME_LENGTH_SYMBOLS = P25_LDU_FRAME_LENGTH_BYTES * 4U;
const unsigned int P25_TERMLC_FRAME_LENGTH_BYTES = 54U; const unsigned int P25_TERMLC_FRAME_LENGTH_BYTES = 54U;
const unsigned int P25_TERMLC_FRAME_LENGTH_BITS = P25_TERMLC_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_TERMLC_FRAME_LENGTH_BITS = P25_TERMLC_FRAME_LENGTH_BYTES * 8U;
const unsigned int P25_TERMLC_FRAME_LENGTH_SYMBOLS = P25_TERMLC_FRAME_LENGTH_BYTES * 4U;
const unsigned int P25_TERM_FRAME_LENGTH_BYTES = 18U; const unsigned int P25_TERM_FRAME_LENGTH_BYTES = 18U;
const unsigned int P25_TERM_FRAME_LENGTH_BITS = P25_TERM_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_TERM_FRAME_LENGTH_BITS = P25_TERM_FRAME_LENGTH_BYTES * 8U;
const unsigned int P25_TERM_FRAME_LENGTH_SYMBOLS = P25_TERM_FRAME_LENGTH_BYTES * 4U;
const unsigned int P25_TSDU_FRAME_LENGTH_BYTES = 45U; const unsigned int P25_SYNC_LENGTH_BYTES = 6U;
const unsigned int P25_TSDU_FRAME_LENGTH_BITS = P25_TSDU_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_SYNC_LENGTH_BITS = P25_SYNC_LENGTH_BYTES * 8U;
const unsigned int P25_SYNC_LENGTH_SYMBOLS = P25_SYNC_LENGTH_BYTES * 4U;
const unsigned int P25_PDU_HDR_FRAME_LENGTH_BYTES = 45U; const unsigned int P25_NID_LENGTH_BITS = 64U;
const unsigned int P25_PDU_HDR_FRAME_LENGTH_BITS = P25_PDU_HDR_FRAME_LENGTH_BYTES * 8U; const unsigned int P25_NID_LENGTH_SYMBOLS = 32U;
const unsigned int P25_SYNC_LENGTH_BYTES = 6U;
const unsigned int P25_SYNC_LENGTH_BITS = P25_SYNC_LENGTH_BYTES * 8U;
const unsigned int P25_NID_LENGTH_BYTES = 8U;
const unsigned int P25_NID_LENGTH_BITS = P25_NID_LENGTH_BYTES * 8U;
const uint8_t P25_SYNC_BYTES[] = {0x55U, 0x75U, 0xF5U, 0xFFU, 0x77U, 0xFFU}; const uint8_t P25_SYNC_BYTES[] = {0x55U, 0x75U, 0xF5U, 0xFFU, 0x77U, 0xFFU};
const uint8_t P25_SYNC_BYTES_LENGTH = 6U; const uint8_t P25_SYNC_BYTES_LENGTH = 6U;
@ -50,12 +48,11 @@ const uint8_t P25_SYNC_BYTES_LENGTH = 6U;
const uint64_t P25_SYNC_BITS = 0x00005575F5FF77FFU; const uint64_t P25_SYNC_BITS = 0x00005575F5FF77FFU;
const uint64_t P25_SYNC_BITS_MASK = 0x0000FFFFFFFFFFFFU; const uint64_t P25_SYNC_BITS_MASK = 0x0000FFFFFFFFFFFFU;
const uint8_t P25_DUID_HDU = 0x00U; // Header Data Unit // 5 5 7 5 F 5 F F 7 7 F F
const uint8_t P25_DUID_TDU = 0x03U; // Simple Terminator Data Unit // 01 01 01 01 01 11 01 01 11 11 01 01 11 11 11 11 01 11 01 11 11 11 11 11
const uint8_t P25_DUID_LDU1 = 0x05U; // Logical Link Data Unit 1 // +3 +3 +3 +3 +3 -3 +3 +3 -3 -3 +3 +3 -3 -3 -3 -3 +3 -3 +3 -3 -3 -3 -3 -3
const uint8_t P25_DUID_TSDU = 0x07U; // Trunking System Data Unit
const uint8_t P25_DUID_LDU2 = 0x0AU; // Logical Link Data Unit 2 const uint32_t P25_SYNC_SYMBOLS = 0x00FB30A0U;
const uint8_t P25_DUID_PDU = 0x0CU; // Packet Data Unit const uint32_t P25_SYNC_SYMBOLS_MASK = 0x00FFFFFFU;
const uint8_t P25_DUID_TDULC = 0x0FU; // Terminator Data Unit with Link Control
#endif #endif

143
P25RX.cpp
View file

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX * Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -31,44 +31,33 @@ const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02
#define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7]) #define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
const uint16_t NOENDPTR = 9999U;
CP25RX::CP25RX() : CP25RX::CP25RX() :
m_prev(false),
m_state(P25RXS_NONE), m_state(P25RXS_NONE),
m_bitBuffer(0x00U), m_bitBuffer(0x00U),
m_outBuffer(), m_outBuffer(),
m_buffer(NULL), m_buffer(NULL),
m_bufferPtr(0U), m_bufferPtr(0U),
m_endPtr(NOENDPTR), m_lostCount(0U)
m_lostCount(0U),
m_duid(0U)
{ {
m_buffer = m_outBuffer + 1U; m_buffer = m_outBuffer + 1U;
} }
void CP25RX::reset() void CP25RX::reset()
{ {
m_prev = false;
m_state = P25RXS_NONE; m_state = P25RXS_NONE;
m_bitBuffer = 0x00U; m_bitBuffer = 0x00U;
m_bufferPtr = 0U; m_bufferPtr = 0U;
m_endPtr = NOENDPTR;
m_lostCount = 0U; m_lostCount = 0U;
m_duid = 0U;
} }
void CP25RX::databit(bool bit) void CP25RX::databit(bool bit)
{ {
switch (m_state) { if (m_state == P25RXS_NONE)
case P25RXS_HDR: processNone(bit);
processHdr(bit); else
break; processData(bit);
case P25RXS_LDU:
processLdu(bit);
break;
default:
processNone(bit);
break;
}
} }
void CP25RX::processNone(bool bit) void CP25RX::processNone(bool bit)
@ -85,103 +74,69 @@ void CP25RX::processNone(bool bit)
m_lostCount = MAX_SYNC_FRAMES; m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = P25_SYNC_LENGTH_BITS; m_bufferPtr = P25_SYNC_LENGTH_BITS;
m_state = P25RXS_HDR; m_state = P25RXS_DATA;
io.setDecode(true); io.setDecode(true);
} }
} }
void CP25RX::processHdr(bool bit) void CP25RX::processData(bool bit)
{ {
m_bitBuffer <<= 1; m_bitBuffer <<= 1;
if (bit) if (bit)
m_bitBuffer |= 0x01U; m_bitBuffer |= 0x01U;
WRITE_BIT1(m_buffer, m_bufferPtr, bit); WRITE_BIT1(m_buffer, m_bufferPtr, bit);
m_bufferPtr++; m_bufferPtr++;
if (m_bufferPtr > P25_LDU_FRAME_LENGTH_BITS)
reset();
if (m_bufferPtr == P25_SYNC_LENGTH_BITS + 16U) { // Search for an early sync to indicate an LDU following a header
// FIXME: we should check and correct for errors in NID first! if (m_bufferPtr >= (P25_HDR_FRAME_LENGTH_BITS + P25_SYNC_LENGTH_BITS - 1U) && m_bufferPtr <= (P25_HDR_FRAME_LENGTH_BITS + P25_SYNC_LENGTH_BITS + 1U)) {
m_duid = m_buffer[7U] & 0x0F;
if (m_duid != P25_DUID_HDU && m_duid != P25_DUID_TSDU &&
m_duid != P25_DUID_TDU && m_duid != P25_DUID_TDULC) {
m_lostCount = MAX_SYNC_FRAMES;
m_state = P25RXS_LDU;
return;
}
setEndPtr();
DEBUG2("P25RX: DUID", m_duid);
}
// Search for end of header frame
if (m_bufferPtr == m_endPtr) {
m_outBuffer[0U] = 0x01U;
serial.writeP25Hdr(m_outBuffer, (m_endPtr / 8U) + 1U);
m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = 0U;
m_state = P25RXS_LDU;
}
}
void CP25RX::processLdu(bool bit)
{
m_bitBuffer <<= 1;
if (bit)
m_bitBuffer |= 0x01U;
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
m_bufferPtr++;
if (m_bufferPtr > P25_LDU_FRAME_LENGTH_BITS)
reset();
// Only search for a sync in the right place +-2 bits
if (m_bufferPtr >= (P25_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (P25_SYNC_LENGTH_BITS + 2U)) {
// Fuzzy matching of the data sync bit sequence // Fuzzy matching of the data sync bit sequence
if (countBits64((m_bitBuffer & P25_SYNC_BITS_MASK) ^ P25_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) { if (countBits64((m_bitBuffer & P25_SYNC_BITS_MASK) ^ P25_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
DEBUG1("P25RX: found sync in LDU"); DEBUG2("P25RX: found LDU sync in Data, pos", m_bufferPtr - P25_SYNC_LENGTH_BITS);
m_outBuffer[0U] = 0x01U;
serial.writeP25Hdr(m_outBuffer, P25_HDR_FRAME_LENGTH_BYTES + 1U);
// Restore the sync that's now in the wrong place
for (uint8_t i = 0U; i < P25_SYNC_LENGTH_BYTES; i++)
m_buffer[i] = P25_SYNC_BYTES[i];
m_lostCount = MAX_SYNC_FRAMES; m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = P25_SYNC_LENGTH_BITS; m_bufferPtr = P25_SYNC_LENGTH_BITS;
} }
} }
if (m_bufferPtr == P25_SYNC_LENGTH_BITS + 16U) { // Only search for a sync in the right place +-2 symbols
// We use DUID here only to detect TDU for EOT if (m_bufferPtr >= (P25_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (P25_SYNC_LENGTH_BITS + 2U)) {
// FIXME: we should check and correct for errors in NID first! // Fuzzy matching of the data sync bit sequence
m_duid = m_buffer[7U] & 0x0F; if (countBits64((m_bitBuffer & P25_SYNC_BITS_MASK) ^ P25_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
setEndPtr(); DEBUG2("P25RX: found sync in Data, pos", m_bufferPtr - P25_SYNC_LENGTH_BITS);
DEBUG2("P25RX: DUID", m_duid); m_lostCount = MAX_SYNC_FRAMES;
m_bufferPtr = P25_SYNC_LENGTH_BITS;
}
} }
// Send a data frame to the host if the required number of bits have been received // Send a data frame to the host if the required number of bits have been received
if (m_bufferPtr == P25_LDU_FRAME_LENGTH_BITS) { if (m_bufferPtr == P25_LDU_FRAME_LENGTH_BITS) {
m_lostCount--;
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE // We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
m_lostCount--;
if (m_lostCount == 0U) { if (m_lostCount == 0U) {
DEBUG1("P25RX: sync timed out, lost lock"); DEBUG1("P25RX: sync timed out, lost lock");
io.setDecode(false); io.setDecode(false);
serial.writeP25Lost(); serial.writeP25Lost();
reset();
m_state = P25RXS_NONE;
} else { } else {
// Write data to host
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U; m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
writeRSSILdu(m_outBuffer); writeRSSILdu(m_outBuffer);
// Start the next frame // Start the next frame
::memset(m_outBuffer, 0x00U, P25_LDU_FRAME_LENGTH_BYTES + 3U); ::memset(m_outBuffer, 0x00U, P25_LDU_FRAME_LENGTH_BYTES + 3U);
m_bufferPtr = 0U; m_bufferPtr = 0U;
} }
// Check if we found a TDU to avoid a false "lost lock"
if (m_duid == P25_DUID_TDU || m_duid == P25_DUID_TDULC) {
reset();
}
} }
} }
@ -199,32 +154,4 @@ void CP25RX::writeRSSILdu(uint8_t* ldu)
#endif #endif
} }
void CP25RX::setEndPtr()
{
switch (m_duid) {
case P25_DUID_HDU:
DEBUG1("P25RX: sync found in HDU");
m_endPtr = P25_HDR_FRAME_LENGTH_BITS;
break;
case P25_DUID_TDU:
DEBUG1("P25RX: sync found in TDU");
m_endPtr = P25_TERM_FRAME_LENGTH_BITS;
break;
case P25_DUID_TSDU:
DEBUG1("P25RX: sync found in TSDU");
m_endPtr = P25_TSDU_FRAME_LENGTH_BITS;
break;
case P25_DUID_PDU:
// FIXME: not sure about PDU lengths since they have arbitrary length...
DEBUG1("P25RX: sync found in PDU");
m_endPtr = P25_PDU_HDR_FRAME_LENGTH_BITS;
break;
case P25_DUID_TDULC:
DEBUG1("P25RX: sync found in TDULC");
m_endPtr = P25_TERMLC_FRAME_LENGTH_BITS;
break;
default:
m_endPtr = P25_LDU_FRAME_LENGTH_BITS;
break;
}
}

12
P25RX.h
View file

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,8 +24,7 @@
enum P25RX_STATE { enum P25RX_STATE {
P25RXS_NONE, P25RXS_NONE,
P25RXS_HDR, P25RXS_DATA
P25RXS_LDU
}; };
class CP25RX { class CP25RX {
@ -37,20 +36,17 @@ public:
void reset(); void reset();
private: private:
bool m_prev;
P25RX_STATE m_state; P25RX_STATE m_state;
uint64_t m_bitBuffer; uint64_t m_bitBuffer;
uint8_t m_outBuffer[P25_LDU_FRAME_LENGTH_BYTES + 3U]; uint8_t m_outBuffer[P25_LDU_FRAME_LENGTH_BYTES + 3U];
uint8_t* m_buffer; uint8_t* m_buffer;
uint16_t m_bufferPtr; uint16_t m_bufferPtr;
uint16_t m_endPtr;
uint16_t m_lostCount; uint16_t m_lostCount;
uint8_t m_duid;
void processNone(bool bit); void processNone(bool bit);
void processHdr(bool bit); void processData(bool bit);
void processLdu(bool bit);
void writeRSSILdu(uint8_t* data); void writeRSSILdu(uint8_t* data);
void setEndPtr();
}; };
#endif #endif

View file

@ -1,7 +1,6 @@
/* /*
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* Copyright (C) 2019 by Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -29,18 +28,12 @@ m_poBuffer(),
m_poLen(0U), m_poLen(0U),
m_poPtr(0U), m_poPtr(0U),
m_txDelay(POCSAG_PREAMBLE_LENGTH_BYTES), m_txDelay(POCSAG_PREAMBLE_LENGTH_BYTES),
m_delay(false), m_delay(false)
m_cal(false)
{ {
} }
void CPOCSAGTX::process() void CPOCSAGTX::process()
{ {
if (m_cal) {
m_delay = false;
createCal();
}
if (m_poLen == 0U && m_buffer.getData() > 0U) { if (m_poLen == 0U && m_buffer.getData() > 0U) {
if (!m_tx) { if (!m_tx) {
m_delay = true; m_delay = true;
@ -127,28 +120,3 @@ uint8_t CPOCSAGTX::getSpace() const
{ {
return m_buffer.getSpace() / POCSAG_FRAME_LENGTH_BYTES; return m_buffer.getSpace() / POCSAG_FRAME_LENGTH_BYTES;
} }
uint8_t CPOCSAGTX::setCal(const uint8_t* data, uint8_t length)
{
if (length != 1U)
return 4U;
m_cal = data[0U] == 1U;
if (m_cal)
io.ifConf(STATE_POCSAG, true);
return 0U;
}
void CPOCSAGTX::createCal()
{
// 600 Hz square wave generation
for (unsigned int i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
m_poBuffer[i] = 0xAAU;
}
m_poLen = POCSAG_FRAME_LENGTH_BYTES;
m_poPtr = 0U;
}

View file

@ -1,7 +1,6 @@
/* /*
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* Copyright (C) 2019 by Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -29,10 +28,6 @@ public:
void setTXDelay(uint8_t delay); void setTXDelay(uint8_t delay);
uint8_t setCal(const uint8_t* data, uint8_t length);
void createCal();
uint8_t getSpace() const; uint8_t getSpace() const;
void process(); void process();
@ -46,7 +41,6 @@ private:
uint16_t m_poPtr; uint16_t m_poPtr;
uint16_t m_txDelay; uint16_t m_txDelay;
bool m_delay; bool m_delay;
bool m_cal;
void writeByte(uint8_t c); void writeByte(uint8_t c);
}; };

115
README.md
View file

@ -23,53 +23,9 @@ This software is licenced under the GPL v2 and is intended for amateur and educa
- CW ID support - CW ID support
- Full duplex support with two ADF7021 - Full duplex support with two ADF7021
# Known issues
## Common issues for simplex and duplex boards
- High RX BER or not RX, poor TX audio (4FSK modes): adjust frequency offset, specially RXOffset.
- Not instantaneous mode detection (2 modes or more enabled): mode detection could be slow and sometimes you need to hold PTT several seconds, in order to activate the hotspot. There is no solution for that, since ADF7021 works only one mode at once. You can disable mode scanning, enabling just one mode.
- Poor audio with MD380: increase DMR deviation to 55 % or 60 %.
- Bad RX sensitivity: this is not a firmware issue, ADF7021 has a minimum signal detection around -109 dBm in DMR, but RX performance depends on RF board design, external RX noise, frequency, etc. At the moment only original ZUMspot RPi can reach the best RX sensitivity in 70 cm band.
- Not working with RPi 3B+ (USB): be sure your firmware version is >= 1.4.8 and update to new USB bootloader with long reset pulse (make stlink-bl, for example).
- Not working with USB (not RPi 3B+): compile with "LONG_USB_RESET" option disabled, and use old bootloader (make stlink-bl-old, for example).
## Duplex boards
- Very difficult DMR activation ("repeater fail" error): disable mode scanning, select just DMR mode.
- Not DMR activation ("repeater fail" error) with MD380, Ailunce HD1 or some other radios: increase DMR deviation to 55 % or 60 %.
- RX timeout: this is due to TX and RX clock differences, which does not have easy solution. Be sure your firmware version is >= 1.4.7, which minimizes this problem.
# Notes for previous users of MMDVM boards
MMDVM_HS boards do not need deviation calibration like MMDVM boards, but could be necessary some frequency offset calibration (ADF7021 does not have AFC for 4FSK modes).
The following options in MMDVM.ini ([Modem] section) have not any effect for MMDVM_HS boards:
TXInvert
RXInvert
PTTInvert
RXLevel
RXDCOffset
TXDCOffset
The following options in MMDVM.ini ([Modem] section) are very important for MMDVM_HS boards:
RXOffset: RX frequency offset (HS RX BER improvement)
TXOffset: TX frequency offset (radio RX improvement)
TXLevel: default deviation setting (recommended value: 50)
RFLevel: RF power output (recommended value: 100)
CWIdTXLevel: CW ID deviation setting (recommended value: 50)
D-StarTXLevel: D-Star deviation setting (recommended value: 50)
DMRTXLevel: DMR deviation setting (recommended value: 50)
YSFTXLevel: YSF deviation setting (recommended value: 50)
P25TXLevel: P25 deviation setting (recommended value: 50)
NXDNTXLevel: NXDN deviation setting (recommended value: 50)
POCSAGTXLevel: POCSAG deviation setting (recommended value: 50)
# Important notes # Important notes
The ADF7021 (or RF7021SE module) must operate with a 14.7456 MHz TCXO and with at least 2.5 ppm of frequency stability or better. For 800-900 MHz frequency band you will need even a better frequency stability TCXO. You could use also 12.2880 MHz TCXO. Any other TCXO frequency is not supported. Please note that a bad quality TCXO not only affects the frequency offset, also affects clock data rate, which is not possible to fix and will cause BER issues. The ADF7021 (or RF7021SE module) must operate with a 14.7456 MHz TCXO and with at least 2 ppm of frequency stability. You could use also 12.2880 MHz TCXO, but this frequency configuration has less testing. Any other TCXO frequency is not supported.
Please set TXLevel=50 in MMDVM.ini to configure default deviation levels for all modes. You could modify this value and other TXLevel paramenters to change deviation levels. Use [MMDVMCal](https://github.com/g4klx/MMDVMCal) to check DMR deviation level and TX frequency offset with calibrated test equipment. Please set TXLevel=50 in MMDVM.ini to configure default deviation levels for all modes. You could modify this value and other TXLevel paramenters to change deviation levels. Use [MMDVMCal](https://github.com/g4klx/MMDVMCal) to check DMR deviation level and TX frequency offset with calibrated test equipment.
@ -111,7 +67,7 @@ You could use some pi-star commands under SSH console:
### Windows ### Windows
Download the ZUMspotFW firmware upgrade utility (ZUMspotFW_setup.exe) from the [releases section](https://github.com/juribeparada/MMDVM_HS/releases). Download the ZUMspotFW firmware upgrade utility (ZUMspotFW_setup.exe) from the [releases section](https://github.com/juribeparada/MMDVM_HS/releases/download/v1.0.2/ZUMSpotFW_setup.exe).
This utility includes firmwares binaries and USB drivers for Windows 7/8/10. If you have problems with the installer, you can download [ZUMspotFW.zip](https://github.com/juribeparada/MMDVM_HS/releases/download/v1.0.2/ZUMspotFW.zip) for a manual installation. This utility includes firmwares binaries and USB drivers for Windows 7/8/10. If you have problems with the installer, you can download [ZUMspotFW.zip](https://github.com/juribeparada/MMDVM_HS/releases/download/v1.0.2/ZUMspotFW.zip) for a manual installation.
@ -119,23 +75,18 @@ This utility includes firmwares binaries and USB drivers for Windows 7/8/10. If
Download the script (*.sh) that matches with your ZUMspot/MMDVM_HS board: Download the script (*.sh) that matches with your ZUMspot/MMDVM_HS board:
- install_fw_librekit.sh: only for ZUMspot Libre Kit board (KI6ZUM & VE2GZI) or generic MMDVM_HS board with USB interface
- install_fw_rpi.sh: only for ZUMspot RPi board (KI6ZUM & VE2GZI) - install_fw_rpi.sh: only for ZUMspot RPi board (KI6ZUM & VE2GZI)
- install_fw_usb.sh: only for ZUMspot USB dongle (KI6ZUM)
- install_fw_duplex.sh: only for ZUMspot Duplex for RPi (KI6ZUM)
- install_fw_dualband.sh: only for ZUMspot Dualband for RPi (KI6ZUM)
- install_fw_hshat.sh: only for MMDVM_HS_Hat board (DB9MAT & DF2ET) - install_fw_hshat.sh: only for MMDVM_HS_Hat board (DB9MAT & DF2ET)
- install_fw_hshat-12mhz.sh: only for MMDVM_HS_Hat board with 12.288 MHz TCXO (DB9MAT & DF2ET) - install_fw_hshat-12mhz.sh: only for MMDVM_HS_Hat board with 12.288 MHz TCXO (DB9MAT & DF2ET)
- install_fw_hsdualhat.sh: only for MMDVM_HS_Dual_Hat board (DB9MAT & DF2ET & DO7EN)
- install_fw_hsdualhat-12mhz.sh: only for MMDVM_HS_Dual_Hat board with 12.288 MHz TCXO (DB9MAT & DF2ET & DO7EN)
- install_fw_nanohs.sh: only for Nano hotSPOT board (BI7JTA) - install_fw_nanohs.sh: only for Nano hotSPOT board (BI7JTA)
- install_fw_nanodv_npi.sh: only for NanoDV NPi board 1.0 (BG4TGO & BG5HHP) - install_fw_nanodv_npi.sh: only for NanoDV NPi board 1.0 (BG4TGO & BG5HHP)
- install_fw_nanodv_usb.sh: only for NanoDV USB board 1.0 (BG4TGO & BG5HHP) - install_fw_nanodv_usb.sh: only for NanoDV USB board 1.0 (BG4TGO & BG5HHP)
- install_fw_d2rg_mmdvmhs.sh: only for D2RG MMDVM_HS board (BG3MDO, VE2GZI, CA6JAU) - install_fw_hsdualhat.sh: only for MMDVM_HS_Dual_Hat board (DB9MAT & DF2ET & DO7EN)
- install_fw_librekit.sh: only for ZUMspot Libre Kit board (KI6ZUM & VE2GZI) or generic MMDVM_HS board with USB interface
- install_fw_usb.sh: only for ZUMspot USB dongle (KI6ZUM & VE2GZI)
- install_fw_duplex.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with USB interface
- install_fw_gen_gpio.sh: only for generic MMDVM_HS board (EA7GIB) with GPIO serial interface - install_fw_gen_gpio.sh: only for generic MMDVM_HS board (EA7GIB) with GPIO serial interface
- install_fw_duplex_gpio.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with GPIO serial interface - install_fw_duplex_gpio.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with GPIO serial interface
- install_fw_duplex_usb.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with USB interface
- install_fw_skybridge_rpi.sh: only for BridgeCom SkyBridge HotSpot
For example, download the ZUMspot RPi upgrade script: For example, download the ZUMspot RPi upgrade script:
@ -152,10 +103,6 @@ stop your MMDVMHost process and run (you will need the root password):
and wait to complete the upgrading process. and wait to complete the upgrading process.
You could optionally install a beta firmware for testing:
./install_fw_rpi.sh beta
## Build from the sources ## Build from the sources
You could use example files from MMDVM_HS/configs folder and overwrite the Config.h file, in order to compile a firmware with default settings. There are a specific config file for each ZUMspot or any MMDVM_HS compatible boards. In general, there are two possible compilation ways: You could use example files from MMDVM_HS/configs folder and overwrite the Config.h file, in order to compile a firmware with default settings. There are a specific config file for each ZUMspot or any MMDVM_HS compatible boards. In general, there are two possible compilation ways:
@ -168,12 +115,6 @@ Boards with STM32_USB_HOST option enabled in Config.h (ZUMspot Libre Kit, ZUMspo
make bl make bl
make dfu make dfu
You can optionally install a firmware without bootloader, with USB support. Be aware you will need always a ST-Link or serial interface in order to install or update the firmware. For this reason, you should use USB bootloader, unless you have trouble with the bootloader.
make clean
make nobl
make stlink-nobl
- Boards with GPIO interface: - Boards with GPIO interface:
Boards with STM32_USART1_HOST option enabled in Config.h (ZUMspot RPi, MMDVM_HS_Hat, MMDVM_HS_Dual_Hat, Nano hotSPOT, etc). No USB bootloader needed. For example: Boards with STM32_USART1_HOST option enabled in Config.h (ZUMspot RPi, MMDVM_HS_Hat, MMDVM_HS_Dual_Hat, Nano hotSPOT, etc). No USB bootloader needed. For example:
@ -188,10 +129,6 @@ Some detailed examples as follows:
Please visit Mathis Schmieder GitHub [here](https://github.com/mathisschmieder/MMDVM_HS_Hat/blob/master/README.md) for detailed instructions. Please visit Mathis Schmieder GitHub [here](https://github.com/mathisschmieder/MMDVM_HS_Hat/blob/master/README.md) for detailed instructions.
### D2RG MMDVM_HS board
This hotspot needs Raspbian support for SPI-UART converter included in this board. If you don't see /dev/ttySC0, please visit Yuan BG3MDO GitHub [here](https://github.com/bg3mdo/D2RG_MMDVM_HS_ambe_uart_service) for driver installation instructions.
### ZUMspot Libre Kit (under Linux Raspbian) ### ZUMspot Libre Kit (under Linux Raspbian)
If you are using Pi-Star, expand filesystem (if you haven't done before): If you are using Pi-Star, expand filesystem (if you haven't done before):
@ -275,8 +212,6 @@ Install the necessary software tools:
sudo apt-get update sudo apt-get update
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
Note: The Pi-Star image contains an executable for stm32flash. The next five steps can be skipped!
cd ~ cd ~
git clone https://git.code.sf.net/p/stm32flash/code stm32flash git clone https://git.code.sf.net/p/stm32flash/code stm32flash
cd stm32flash cd stm32flash
@ -320,41 +255,3 @@ Upload the firmware to ZUMspot RPi board:
sudo make zumspot-pi sudo make zumspot-pi
### MMDVM_HS_Dual_Hat\MMDVM_HS_Hat gpio firmware update on OrangePI PC/PC2/PC Plus
Install the necessary software tools:
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
Download the sources:
cd ~
git clone https://github.com/juribeparada/MMDVM_HS
cd MMDVM_HS/
git submodule init
git submodule update
Install the tools for building firmware
cd MMDVM_HS/scripts
./install_buildtools.sh
Copy MMDVM_HS/configs/MMDVM_HS_Dual_Hat.h or MMDVM_HS/configs/MMDVM_HS_Hat.h (MMDVM_HS_Hat-12mhz.h) to MMDVM_HS/Config.h and build the firmware:
make
Stop the MMDVMHost services:
sudo systemctl stop mmdvmhost.timer
sudo systemctl stop mmdvmhost.service
Upload the firmware to mmdvm_hs_dual_hat (mmdvm_hs_hat) on OrangePi PC\PC2\PC Plus:
sudo make mmdvm_hs_dual_hat_opi (sudo make mmdvm_hs_hat_opi)
or
sudo /usr/local/bin/stm32flash -v -w bin/mmdvm_f1.bin -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3

@ -1 +1 @@
Subproject commit 1debc23063f3942608e2bd62d04d5e1249c47fa3 Subproject commit f57ebc35af760675bd6d15e6667e6e66508f852b

View file

@ -1,8 +1,7 @@
/* /*
* Copyright (C) 2013,2015,2016,2018,2020,2021 by Jonathan Naylor G4KLX * Copyright (C) 2013,2015,2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2016 by Colin Durbridge G4EML * Copyright (C) 2016 by Colin Durbridge G4EML
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2019 by Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -60,12 +59,6 @@ const uint8_t MMDVM_P25_LOST = 0x32U;
const uint8_t MMDVM_NXDN_DATA = 0x40U; const uint8_t MMDVM_NXDN_DATA = 0x40U;
const uint8_t MMDVM_NXDN_LOST = 0x41U; const uint8_t MMDVM_NXDN_LOST = 0x41U;
const uint8_t MMDVM_M17_LINK_SETUP = 0x45U;
const uint8_t MMDVM_M17_STREAM = 0x46U;
const uint8_t MMDVM_M17_PACKET = 0x47U;
const uint8_t MMDVM_M17_LOST = 0x48U;
const uint8_t MMDVM_M17_EOT = 0x49U;
const uint8_t MMDVM_POCSAG_DATA = 0x50U; const uint8_t MMDVM_POCSAG_DATA = 0x50U;
const uint8_t MMDVM_ACK = 0x70U; const uint8_t MMDVM_ACK = 0x70U;
@ -73,9 +66,6 @@ const uint8_t MMDVM_NAK = 0x7FU;
const uint8_t MMDVM_SERIAL = 0x80U; const uint8_t MMDVM_SERIAL = 0x80U;
const uint8_t MMDVM_TRANSPARENT = 0x90U;
const uint8_t MMDVM_QSO_INFO = 0x91U;
const uint8_t MMDVM_DEBUG1 = 0xF1U; const uint8_t MMDVM_DEBUG1 = 0xF1U;
const uint8_t MMDVM_DEBUG2 = 0xF2U; const uint8_t MMDVM_DEBUG2 = 0xF2U;
const uint8_t MMDVM_DEBUG3 = 0xF3U; const uint8_t MMDVM_DEBUG3 = 0xF3U;
@ -84,16 +74,10 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
const uint8_t PROTOCOL_VERSION = 1U; const uint8_t PROTOCOL_VERSION = 1U;
#if defined(ENABLE_UDID)
char UDID[] = "00000000000000000000000000000000";
#endif
CSerialPort::CSerialPort() : CSerialPort::CSerialPort() :
m_buffer(), m_buffer(),
m_ptr(0U), m_ptr(0U),
m_len(0U), m_len(0U),
m_serial_buffer(),
m_serial_len(0U),
m_debug(false), m_debug(false),
m_firstCal(false) m_firstCal(false)
{ {
@ -132,7 +116,7 @@ void CSerialPort::getStatus()
// Send all sorts of interesting internal values // Send all sorts of interesting internal values
reply[0U] = MMDVM_FRAME_START; reply[0U] = MMDVM_FRAME_START;
reply[1U] = 14U; reply[1U] = 13U;
reply[2U] = MMDVM_GET_STATUS; reply[2U] = MMDVM_GET_STATUS;
reply[3U] = 0x00U; reply[3U] = 0x00U;
@ -148,8 +132,6 @@ void CSerialPort::getStatus()
reply[3U] |= 0x10U; reply[3U] |= 0x10U;
if (m_pocsagEnable) if (m_pocsagEnable)
reply[3U] |= 0x20U; reply[3U] |= 0x20U;
if (m_m17Enable)
reply[3U] |= 0x80U;
reply[4U] = uint8_t(m_modemState); reply[4U] = uint8_t(m_modemState);
@ -204,17 +186,12 @@ void CSerialPort::getStatus()
else else
reply[12U] = 0U; reply[12U] = 0U;
if (m_m17Enable) writeInt(1U, reply, 13);
reply[13U] = m17TX.getSpace();
else
reply[13U] = 0U;
writeInt(1U, reply, 14);
} }
void CSerialPort::getVersion() void CSerialPort::getVersion()
{ {
uint8_t reply[132U]; uint8_t reply[100U];
reply[0U] = MMDVM_FRAME_START; reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U; reply[1U] = 0U;
@ -226,12 +203,6 @@ void CSerialPort::getVersion()
for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++) for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++)
reply[count] = HARDWARE[i]; reply[count] = HARDWARE[i];
#if defined(ENABLE_UDID)
reply[count++] = '\0';
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
reply[count] = UDID[i];
#endif
reply[1U] = count; reply[1U] = count;
writeInt(1U, reply, count); writeInt(1U, reply, count);
@ -239,7 +210,7 @@ void CSerialPort::getVersion()
uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length) uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
{ {
if (length < 23U) if (length < 13U)
return 4U; return 4U;
bool ysfLoDev = (data[0U] & 0x08U) == 0x08U; bool ysfLoDev = (data[0U] & 0x08U) == 0x08U;
@ -253,7 +224,6 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
bool p25Enable = (data[1U] & 0x08U) == 0x08U; bool p25Enable = (data[1U] & 0x08U) == 0x08U;
bool nxdnEnable = (data[1U] & 0x10U) == 0x10U; bool nxdnEnable = (data[1U] & 0x10U) == 0x10U;
bool pocsagEnable = (data[1U] & 0x20U) == 0x20U; bool pocsagEnable = (data[1U] & 0x20U) == 0x20U;
bool m17Enable = (data[1U] & 0x40U) == 0x40U;
uint8_t txDelay = data[2U]; uint8_t txDelay = data[2U];
if (txDelay > 50U) if (txDelay > 50U)
@ -261,7 +231,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
MMDVM_STATE modemState = MMDVM_STATE(data[3U]); MMDVM_STATE modemState = MMDVM_STATE(data[3U]);
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_M17 && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_INTCAL && modemState != STATE_RSSICAL && modemState != STATE_POCSAGCAL) if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)
return 4U; return 4U;
if (modemState == STATE_DSTAR && !dstarEnable) if (modemState == STATE_DSTAR && !dstarEnable)
return 4U; return 4U;
@ -275,8 +245,6 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
return 4U; return 4U;
if (modemState == STATE_POCSAG && !pocsagEnable) if (modemState == STATE_POCSAG && !pocsagEnable)
return 4U; return 4U;
if (modemState == STATE_M17 && !m17Enable)
return 4U;
uint8_t colorCode = data[6U]; uint8_t colorCode = data[6U];
if (colorCode > 15U) if (colorCode > 15U)
@ -292,21 +260,25 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
uint8_t dmrTXLevel = data[10U]; uint8_t dmrTXLevel = data[10U];
uint8_t ysfTXLevel = data[11U]; uint8_t ysfTXLevel = data[11U];
uint8_t p25TXLevel = data[12U]; uint8_t p25TXLevel = data[12U];
uint8_t nxdnTXLevel = data[15U]; uint8_t nxdnTXLevel = 128U;
uint8_t pocsagTXLevel = data[17U]; uint8_t pocsagTXLevel = 128U;
uint8_t m17TXLevel = data[21U];
io.setDeviations(dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, m17TXLevel, pocsagTXLevel, ysfLoDev); if (length >= 16U)
nxdnTXLevel = data[15U];
if (length >= 18U)
pocsagTXLevel = data[17U];
io.setDeviations(dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, pocsagTXLevel, ysfLoDev);
m_dstarEnable = dstarEnable; m_dstarEnable = dstarEnable;
m_dmrEnable = dmrEnable; m_dmrEnable = dmrEnable;
m_ysfEnable = ysfEnable; m_ysfEnable = ysfEnable;
m_p25Enable = p25Enable; m_p25Enable = p25Enable;
m_nxdnEnable = nxdnEnable; m_nxdnEnable = nxdnEnable;
m_m17Enable = m17Enable;
m_pocsagEnable = pocsagEnable; m_pocsagEnable = pocsagEnable;
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL) { if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL) {
m_dmrEnable = true; m_dmrEnable = true;
m_modemState = STATE_DMR; m_modemState = STATE_DMR;
m_calState = modemState; m_calState = modemState;
@ -314,12 +286,6 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
io.updateCal(); io.updateCal();
if (modemState == STATE_RSSICAL) if (modemState == STATE_RSSICAL)
io.ifConf(STATE_DMR, true); io.ifConf(STATE_DMR, true);
} else if (modemState == STATE_POCSAGCAL) {
m_pocsagEnable = true;
m_modemState = STATE_POCSAG;
m_calState = modemState;
if (m_firstCal)
io.updateCal();
} }
else { else {
m_modemState = modemState; m_modemState = modemState;
@ -333,18 +299,12 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
DEBUG1("Full duplex not supported with this firmware"); DEBUG1("Full duplex not supported with this firmware");
return 6U; return 6U;
} }
#elif defined(DUPLEX) && (defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS))
if (io.isDualBand() && m_duplex && m_calState == STATE_IDLE && modemState != STATE_DSTARCAL) {
DEBUG1("Full duplex is not supported on this board");
return 6U;
}
#endif #endif
dstarTX.setTXDelay(txDelay); dstarTX.setTXDelay(txDelay);
ysfTX.setTXDelay(txDelay); ysfTX.setTXDelay(txDelay);
p25TX.setTXDelay(txDelay); p25TX.setTXDelay(txDelay);
nxdnTX.setTXDelay(txDelay); nxdnTX.setTXDelay(txDelay);
m17TX.setTXDelay(txDelay);
pocsagTX.setTXDelay(txDelay); pocsagTX.setTXDelay(txDelay);
dmrDMOTX.setTXDelay(txDelay); dmrDMOTX.setTXDelay(txDelay);
@ -359,7 +319,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
io.setLoDevYSF(ysfLoDev); io.setLoDevYSF(ysfLoDev);
if (!m_firstCal || (modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL && modemState != STATE_INTCAL && modemState != STATE_POCSAGCAL)) { if (!m_firstCal || (modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)) {
if(m_dstarEnable) if(m_dstarEnable)
io.ifConf(STATE_DSTAR, true); io.ifConf(STATE_DSTAR, true);
else if(m_dmrEnable) else if(m_dmrEnable)
@ -370,8 +330,6 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
io.ifConf(STATE_P25, true); io.ifConf(STATE_P25, true);
else if(m_nxdnEnable) else if(m_nxdnEnable)
io.ifConf(STATE_NXDN, true); io.ifConf(STATE_NXDN, true);
else if(m_m17Enable)
io.ifConf(STATE_M17, true);
else if(m_pocsagEnable) else if(m_pocsagEnable)
io.ifConf(STATE_POCSAG, true); io.ifConf(STATE_POCSAG, true);
} }
@ -381,7 +339,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
io.printConf(); io.printConf();
#endif #endif
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL || modemState == STATE_POCSAGCAL) if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL)
m_firstCal = true; m_firstCal = true;
return 0U; return 0U;
@ -398,7 +356,7 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length)
if (modemState == m_modemState) if (modemState == m_modemState)
return 0U; return 0U;
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_M17 && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL && modemState != STATE_INTCAL && modemState != STATE_POCSAGCAL) if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)
return 4U; return 4U;
if (modemState == STATE_DSTAR && !m_dstarEnable) if (modemState == STATE_DSTAR && !m_dstarEnable)
return 4U; return 4U;
@ -410,23 +368,15 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length)
return 4U; return 4U;
if (modemState == STATE_NXDN && !m_nxdnEnable) if (modemState == STATE_NXDN && !m_nxdnEnable)
return 4U; return 4U;
if (modemState == STATE_M17 && !m_m17Enable)
return 4U;
if (modemState == STATE_POCSAG && !m_pocsagEnable) if (modemState == STATE_POCSAG && !m_pocsagEnable)
return 4U; return 4U;
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL) { if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL) {
m_dmrEnable = true; m_dmrEnable = true;
tmpState = STATE_DMR; tmpState = STATE_DMR;
m_calState = modemState; m_calState = modemState;
if (m_firstCal) if (m_firstCal)
io.updateCal(); io.updateCal();
} else if (modemState == STATE_POCSAGCAL) {
m_pocsagEnable = true;
tmpState = STATE_POCSAG;
m_calState = modemState;
if (m_firstCal)
io.updateCal();
} }
else { else {
tmpState = modemState; tmpState = modemState;
@ -486,7 +436,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
ysfRX.reset(); ysfRX.reset();
p25RX.reset(); p25RX.reset();
nxdnRX.reset(); nxdnRX.reset();
m17RX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
case STATE_DSTAR: case STATE_DSTAR:
@ -499,7 +448,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
ysfRX.reset(); ysfRX.reset();
p25RX.reset(); p25RX.reset();
nxdnRX.reset(); nxdnRX.reset();
m17RX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
case STATE_YSF: case STATE_YSF:
@ -512,7 +460,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
dstarRX.reset(); dstarRX.reset();
p25RX.reset(); p25RX.reset();
nxdnRX.reset(); nxdnRX.reset();
m17RX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
case STATE_P25: case STATE_P25:
@ -525,7 +472,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
dstarRX.reset(); dstarRX.reset();
ysfRX.reset(); ysfRX.reset();
nxdnRX.reset(); nxdnRX.reset();
m17RX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
case STATE_NXDN: case STATE_NXDN:
@ -538,20 +484,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
dstarRX.reset(); dstarRX.reset();
ysfRX.reset(); ysfRX.reset();
p25RX.reset(); p25RX.reset();
m17RX.reset();
cwIdTX.reset();
break;
case STATE_M17:
DEBUG1("Mode set to M17");
#if defined(DUPLEX)
dmrIdleRX.reset();
dmrRX.reset();
#endif
dmrDMORX.reset();
dstarRX.reset();
ysfRX.reset();
p25RX.reset();
nxdnRX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
case STATE_POCSAG: case STATE_POCSAG:
@ -565,7 +497,6 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
ysfRX.reset(); ysfRX.reset();
p25RX.reset(); p25RX.reset();
nxdnRX.reset(); nxdnRX.reset();
m17RX.reset();
cwIdTX.reset(); cwIdTX.reset();
break; break;
default: default:
@ -589,7 +520,7 @@ void CSerialPort::start()
beginInt(1U, 115200); beginInt(1U, 115200);
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1) #if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
beginInt(3U, SERIAL_REPEATER_BAUD); beginInt(3U, 9600);
#endif #endif
} }
@ -658,9 +589,7 @@ void CSerialPort::process()
case MMDVM_CAL_DATA: case MMDVM_CAL_DATA:
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K) { if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K) {
err = calDMR.write(m_buffer + 3U, m_len - 3U); err = calDMR.write(m_buffer + 3U, m_len - 3U);
} else if (m_calState == STATE_POCSAGCAL) { } else if (m_calState == STATE_RSSICAL) {
err = pocsagTX.setCal(m_buffer + 3U, m_len - 3U);
} else if (m_calState == STATE_RSSICAL || m_calState == STATE_INTCAL) {
err = 0U; err = 0U;
} }
if (err == 0U) { if (err == 0U) {
@ -867,48 +796,6 @@ void CSerialPort::process()
} }
break; break;
case MMDVM_M17_LINK_SETUP:
if (m_m17Enable) {
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
}
if (err == 0U) {
if (m_modemState == STATE_IDLE)
setMode(STATE_M17);
} else {
DEBUG2("Received invalid M17 link setup data", err);
sendNAK(err);
}
break;
case MMDVM_M17_STREAM:
if (m_m17Enable) {
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
}
if (err == 0U) {
if (m_modemState == STATE_IDLE)
setMode(STATE_M17);
} else {
DEBUG2("Received invalid M17 stream data", err);
sendNAK(err);
}
break;
case MMDVM_M17_EOT:
if (m_m17Enable) {
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
}
if (err == 0U) {
if (m_modemState == STATE_IDLE)
setMode(STATE_M17);
} else {
DEBUG2("Received invalid M17 EOT", err);
sendNAK(err);
}
break;
case MMDVM_POCSAG_DATA: case MMDVM_POCSAG_DATA:
if (m_pocsagEnable) { if (m_pocsagEnable) {
if (m_modemState == STATE_IDLE || m_modemState == STATE_POCSAG) { if (m_modemState == STATE_IDLE || m_modemState == STATE_POCSAG) {
@ -925,11 +812,6 @@ void CSerialPort::process()
} }
break; break;
case MMDVM_TRANSPARENT:
case MMDVM_QSO_INFO:
// Do nothing on the MMDVM.
break;
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1) #if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
case MMDVM_SERIAL: case MMDVM_SERIAL:
writeInt(3U, m_buffer + 3U, m_len - 3U); writeInt(3U, m_buffer + 3U, m_len - 3U);
@ -954,54 +836,12 @@ void CSerialPort::process()
} }
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1) #if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
// Check for any incoming serial data from a device/screen on UART2 // Drain any incoming serial data
// !!Notice!! on powerup the Nextion screen dumps FF FF FF 88 FF FF FF to the serial port.
while (availableInt(3U)) while (availableInt(3U))
{ readInt(3U);
// read UART2
m_serial_buffer[m_serial_len++] = readInt(3U);
if (m_serial_len >=3 && (m_serial_buffer[m_serial_len - 3] == 0xFF) && (m_serial_buffer[m_serial_len - 2] == 0xFF) && (m_serial_buffer[m_serial_len - 1] == 0xFF))
{
if (m_serial_len > 3)
serial.writeSerialRpt(m_serial_buffer, m_serial_len);
// if the last 3 bytes are FF's then the screen is done sending data so send the m_serial_buffer to serial.writeSerialRpt()
//
// TODO - BG5HHP
// modem serial data repeat should be generic instead of coupling with the nextion protocol.
//
m_serial_len = 0U;
continue;
}
if (m_serial_len == sizeof(m_serial_buffer))
{
// buffer overflow
m_serial_len = 0U;
continue;
}
}
#endif #endif
} }
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
void CSerialPort::writeSerialRpt(const uint8_t* data, uint8_t length)
{
if (length == 0)
return;
uint8_t head[3];
head[0U] = MMDVM_FRAME_START;
head[1U] = length + 3;
head[2U] = MMDVM_SERIAL;
writeInt(1U, head, 3U);
writeInt(1U, data, length, true);
}
#endif
void CSerialPort::writeDStarHeader(const uint8_t* header, uint8_t length) void CSerialPort::writeDStarHeader(const uint8_t* header, uint8_t length)
{ {
if (m_modemState != STATE_DSTAR && m_modemState != STATE_IDLE) if (m_modemState != STATE_DSTAR && m_modemState != STATE_IDLE)
@ -1264,86 +1104,6 @@ void CSerialPort::writeNXDNLost()
writeInt(1U, reply, 3); writeInt(1U, reply, 3);
} }
void CSerialPort::writeM17LinkSetup(const uint8_t* data, uint8_t length)
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
return;
if (!m_m17Enable)
return;
uint8_t reply[130U];
reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U;
reply[2U] = MMDVM_M17_LINK_SETUP;
uint8_t count = 3U;
for (uint8_t i = 0U; i < length; i++, count++)
reply[count] = data[i];
reply[1U] = count;
writeInt(1U, reply, count);
}
void CSerialPort::writeM17Stream(const uint8_t* data, uint8_t length)
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
return;
if (!m_m17Enable)
return;
uint8_t reply[130U];
reply[0U] = MMDVM_FRAME_START;
reply[1U] = 0U;
reply[2U] = MMDVM_M17_STREAM;
uint8_t count = 3U;
for (uint8_t i = 0U; i < length; i++, count++)
reply[count] = data[i];
reply[1U] = count;
writeInt(1U, reply, count);
}
void CSerialPort::writeM17EOT()
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
return;
if (!m_m17Enable)
return;
uint8_t reply[3U];
reply[0U] = MMDVM_FRAME_START;
reply[1U] = 3U;
reply[2U] = MMDVM_M17_EOT;
writeInt(1U, reply, 3);
}
void CSerialPort::writeM17Lost()
{
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
return;
if (!m_m17Enable)
return;
uint8_t reply[3U];
reply[0U] = MMDVM_FRAME_START;
reply[1U] = 3U;
reply[2U] = MMDVM_M17_LOST;
writeInt(1U, reply, 3);
}
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)
void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length) void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length)
@ -1369,6 +1129,7 @@ void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length)
#endif #endif
#if defined(ENABLE_DEBUG) #if defined(ENABLE_DEBUG)
void CSerialPort::writeDebug(const char* text) void CSerialPort::writeDebug(const char* text)
{ {
if (!m_debug) if (!m_debug)
@ -1437,7 +1198,6 @@ void CSerialPort::writeDebug(const char* text, int16_t n1)
writeInt(1U, reply, count, true); writeInt(1U, reply, count, true);
} }
#endif
void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2) void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2)
{ {
@ -1465,7 +1225,6 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2)
writeInt(1U, reply, count, true); writeInt(1U, reply, count, true);
} }
#if defined(ENABLE_DEBUG)
void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3) void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3)
{ {
if (!m_debug) if (!m_debug)
@ -1526,4 +1285,6 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n
writeInt(1U, reply, count, true); writeInt(1U, reply, count, true);
} }
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2016,2018,2020,2021 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -30,10 +30,6 @@ public:
void process(); void process();
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
void writeSerialRpt(const uint8_t* data, uint8_t length);
#endif
void writeDStarHeader(const uint8_t* header, uint8_t length); void writeDStarHeader(const uint8_t* header, uint8_t length);
void writeDStarData(const uint8_t* data, uint8_t length); void writeDStarData(const uint8_t* data, uint8_t length);
void writeDStarLost(); void writeDStarLost();
@ -52,11 +48,6 @@ public:
void writeNXDNData(const uint8_t* data, uint8_t length); void writeNXDNData(const uint8_t* data, uint8_t length);
void writeNXDNLost(); void writeNXDNLost();
void writeM17LinkSetup(const uint8_t* data, uint8_t length);
void writeM17Stream(const uint8_t* data, uint8_t length);
void writeM17EOT();
void writeM17Lost();
#if defined(SEND_RSSI_DATA) #if defined(SEND_RSSI_DATA)
void writeRSSIData(const uint8_t* data, uint8_t length); void writeRSSIData(const uint8_t* data, uint8_t length);
#endif #endif
@ -65,18 +56,15 @@ public:
void writeDebug(const char* text); void writeDebug(const char* text);
void writeDebug(const char* text, int16_t n1); void writeDebug(const char* text, int16_t n1);
void writeDebugI(const char* text, int32_t n1); void writeDebugI(const char* text, int32_t n1);
void writeDebug(const char* text, int16_t n1, int16_t n2);
void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3); void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3);
void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3, int16_t n4); void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3, int16_t n4);
#endif #endif
void writeDebug(const char* text, int16_t n1, int16_t n2);
private: private:
uint8_t m_buffer[256U]; uint8_t m_buffer[256U];
uint8_t m_ptr; uint8_t m_ptr;
uint8_t m_len; uint8_t m_len;
uint8_t m_serial_buffer[128U];
uint8_t m_serial_len;
bool m_debug; bool m_debug;
bool m_firstCal; bool m_firstCal;
@ -97,3 +85,4 @@ private:
}; };
#endif #endif

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM * Copyright (C) 2016 by Jim McLaughlin KI6ZUM
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -23,7 +23,6 @@
#include "Globals.h" #include "Globals.h"
#include "SerialPort.h" #include "SerialPort.h"
#include "I2CHost.h"
#if defined(STM32_USB_HOST) #if defined(STM32_USB_HOST)
#include <usb_serial.h> #include <usb_serial.h>
@ -33,9 +32,9 @@
Pin definitions: Pin definitions:
- Host communication: - Host communication:
1) USART1 - TXD PA9 - RXD PA10 USART1 - TXD PA9 - RXD PA10
2) USB VCOM or
3) I2C - SCL PB10 - SDA PB11 USB VCOM
- Serial repeater - Serial repeater
USART2 - TXD PA2 - RXD PA3 USART2 - TXD PA2 - RXD PA3
@ -433,45 +432,15 @@ void WriteUSART2(const uint8_t* data, uint16_t length)
#endif #endif
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
#if defined(ENABLE_UDID)
extern char UDID[];
extern "C" {
#include <stdio.h>
}
#endif
void CSerialPort::beginInt(uint8_t n, int speed) void CSerialPort::beginInt(uint8_t n, int speed)
{ {
#if defined(ENABLE_UDID)
#if defined(STM32F4XX)
uint32_t *id0 = (uint32_t *) (0x1FFF7A10);
uint32_t *id1 = (uint32_t *) (0x1FFF7A10 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FFF7A10 + 0x08);
::sprintf(UDID, "%08X%08X%08X", *(unsigned int *)id0, *(unsigned int *)id1, *(unsigned int *)id2);
#elif defined(STM32F7XX)
uint32_t *id0 = (uint32_t *) (0x1FF0F420);
uint32_t *id1 = (uint32_t *) (0x1FF0F420 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FF0F420 + 0x08);
::sprintf(UDID, "%08X%08X%08X", *(unsigned int *)id0, *(unsigned int *)id1, *(unsigned int *)id2);
#elif defined(STM32F10X_MD)
uint16_t *id00 = (uint16_t *) (0x1FFFF7E8);
uint16_t *id01 = (uint16_t *) (0x1FFFF7E8 + 0x02);
uint32_t *id1 = (uint32_t *) (0x1FFFF7E8 + 0x04);
uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08);
::sprintf(UDID, "%04X%04X%08X%08X", *id00, *id01, *(unsigned int *)id1, *(unsigned int *)id2);
#endif
#endif
switch (n) { switch (n) {
case 1U: case 1U:
#if defined(STM32_USART1_HOST) #if defined(STM32_USART1_HOST)
InitUSART1(speed); InitUSART1(speed);
#elif defined(STM32_USB_HOST) #elif defined(STM32_USB_HOST)
usbserial.begin(); usbserial.begin();
#elif defined(STM32_I2C_HOST)
i2c.Init();
#endif #endif
break; break;
case 3U: case 3U:
@ -494,8 +463,6 @@ int CSerialPort::availableInt(uint8_t n)
return AvailUSART1(); return AvailUSART1();
#elif defined(STM32_USB_HOST) #elif defined(STM32_USB_HOST)
return usbserial.available(); return usbserial.available();
#elif defined(STM32_I2C_HOST)
return i2c.AvailI2C();
#endif #endif
case 3U: case 3U:
#if defined(SERIAL_REPEATER) #if defined(SERIAL_REPEATER)
@ -516,8 +483,6 @@ uint8_t CSerialPort::readInt(uint8_t n)
return ReadUSART1(); return ReadUSART1();
#elif defined(STM32_USB_HOST) #elif defined(STM32_USB_HOST)
return usbserial.read(); return usbserial.read();
#elif defined(STM32_I2C_HOST)
return i2c.ReadI2C();
#endif #endif
case 3U: case 3U:
#if defined(SERIAL_REPEATER) #if defined(SERIAL_REPEATER)
@ -536,14 +501,12 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool
case 1U: case 1U:
#if defined(STM32_USART1_HOST) #if defined(STM32_USART1_HOST)
WriteUSART1(data, length); WriteUSART1(data, length);
if (flush) if (flush)
TXSerialFlush1(); TXSerialFlush1();
#elif defined(STM32_USB_HOST) #elif defined(STM32_USB_HOST)
usbserial.write(data, length); usbserial.write(data, length);
if (flush) if (flush)
usbserial.flush(); usbserial.flush();
#elif defined(STM32_I2C_HOST)
i2c.WriteI2C(data, length);
#endif #endif
break; break;
case 3U: case 3U:

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015 by Jonathan Naylor G4KLX
* Copyright (C) 2017 by Andy Uribe CA6JAU * Copyright (C) 2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -31,15 +31,6 @@ uint8_t countBits8(uint8_t bits)
return BITS_TABLE[bits]; return BITS_TABLE[bits];
} }
uint8_t countBits16(uint16_t bits)
{
uint8_t* p = (uint8_t*)&bits;
uint8_t n = 0U;
n += BITS_TABLE[p[0U]];
n += BITS_TABLE[p[1U]];
return n;
}
uint8_t countBits32(uint32_t bits) uint8_t countBits32(uint32_t bits)
{ {
uint8_t* p = (uint8_t*)&bits; uint8_t* p = (uint8_t*)&bits;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
* Copyright (C) 2017 by Andy Uribe CA6JAU * Copyright (C) 2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -34,8 +34,6 @@
uint8_t countBits8(uint8_t bits); uint8_t countBits8(uint8_t bits);
uint8_t countBits16(uint16_t bits);
uint8_t countBits32(uint32_t bits); uint8_t countBits32(uint32_t bits);
uint8_t countBits64(uint64_t bits); uint8_t countBits64(uint64_t bits);

View file

@ -1,6 +1,5 @@
/* /*
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
* Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -20,13 +19,16 @@
#if !defined(YSFDEFINES_H) #if !defined(YSFDEFINES_H)
#define YSFDEFINES_H #define YSFDEFINES_H
const unsigned int YSF_FRAME_LENGTH_BYTES = 120U; const unsigned int YSF_FRAME_LENGTH_BYTES = 120U;
const unsigned int YSF_FRAME_LENGTH_BITS = YSF_FRAME_LENGTH_BYTES * 8U; const unsigned int YSF_FRAME_LENGTH_BITS = YSF_FRAME_LENGTH_BYTES * 8U;
const unsigned int YSF_FRAME_LENGTH_SYMBOLS = YSF_FRAME_LENGTH_BYTES * 4U;
const unsigned int YSF_SYNC_LENGTH_BYTES = 5U; const unsigned int YSF_SYNC_LENGTH_BYTES = 5U;
const unsigned int YSF_SYNC_LENGTH_BITS = YSF_SYNC_LENGTH_BYTES * 8U; const unsigned int YSF_SYNC_LENGTH_BITS = YSF_SYNC_LENGTH_BYTES * 8U;
const unsigned int YSF_SYNC_LENGTH_SYMBOLS = YSF_SYNC_LENGTH_BYTES * 4U;
const unsigned int YSF_FICH_LENGTH_BITS = 200U; const unsigned int YSF_FICH_LENGTH_BITS = 200U;
const unsigned int YSF_FICH_LENGTH_SYMBOLS = 100U;
const uint8_t YSF_SYNC_BYTES[] = {0xD4U, 0x71U, 0xC9U, 0x63U, 0x4DU}; const uint8_t YSF_SYNC_BYTES[] = {0xD4U, 0x71U, 0xC9U, 0x63U, 0x4DU};
const uint8_t YSF_SYNC_BYTES_LENGTH = 5U; const uint8_t YSF_SYNC_BYTES_LENGTH = 5U;
@ -34,5 +36,11 @@ const uint8_t YSF_SYNC_BYTES_LENGTH = 5U;
const uint64_t YSF_SYNC_BITS = 0x000000D471C9634DU; const uint64_t YSF_SYNC_BITS = 0x000000D471C9634DU;
const uint64_t YSF_SYNC_BITS_MASK = 0x000000FFFFFFFFFFU; const uint64_t YSF_SYNC_BITS_MASK = 0x000000FFFFFFFFFFU;
// D 4 7 1 C 9 6 3 4 D
// 11 01 01 00 01 11 00 01 11 00 10 01 01 10 00 11 01 00 11 01
// -3 +3 +3 +1 +3 -3 +1 +3 -3 +1 -1 +3 +3 -1 +3 -3 +3 +1 -3 +3
const uint32_t YSF_SYNC_SYMBOLS = 0x0007B5ADU;
const uint32_t YSF_SYNC_SYMBOLS_MASK = 0x000FFFFFU;
#endif #endif

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (C) 2009-2017 by Jonathan Naylor G4KLX * Copyright (C) 2009-2017 by Jonathan Naylor G4KLX
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU * Copyright (C) 2016,2017 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -25,13 +25,14 @@
const uint8_t SYNC_BIT_START_ERRS = 2U; const uint8_t SYNC_BIT_START_ERRS = 2U;
const uint8_t SYNC_BIT_RUN_ERRS = 4U; const uint8_t SYNC_BIT_RUN_ERRS = 4U;
const unsigned int MAX_SYNC_FRAMES = 1U + 1U; const unsigned int MAX_SYNC_FRAMES = 4U + 1U;
const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U}; const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U};
#define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7]) #define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7])
CYSFRX::CYSFRX() : CYSFRX::CYSFRX() :
m_prev(false),
m_state(YSFRXS_NONE), m_state(YSFRXS_NONE),
m_bitBuffer(0x00U), m_bitBuffer(0x00U),
m_outBuffer(), m_outBuffer(),
@ -44,6 +45,7 @@ m_lostCount(0U)
void CYSFRX::reset() void CYSFRX::reset()
{ {
m_prev = false;
m_state = YSFRXS_NONE; m_state = YSFRXS_NONE;
m_bitBuffer = 0x00U; m_bitBuffer = 0x00U;
m_bufferPtr = 0U; m_bufferPtr = 0U;
@ -75,6 +77,7 @@ void CYSFRX::processNone(bool bit)
m_state = YSFRXS_DATA; m_state = YSFRXS_DATA;
io.setDecode(true); io.setDecode(true);
} }
} }
@ -86,12 +89,9 @@ void CYSFRX::processData(bool bit)
m_bitBuffer |= 0x01U; m_bitBuffer |= 0x01U;
WRITE_BIT1(m_buffer, m_bufferPtr, bit); WRITE_BIT1(m_buffer, m_bufferPtr, bit);
m_bufferPtr++; m_bufferPtr++;
if (m_bufferPtr > YSF_FRAME_LENGTH_BITS)
reset();
// Only search for a sync in the right place +-2 bits // Only search for a sync in the right place +-2 symbols
if (m_bufferPtr >= (YSF_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (YSF_SYNC_LENGTH_BITS + 2U)) { if (m_bufferPtr >= (YSF_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (YSF_SYNC_LENGTH_BITS + 2U)) {
// Fuzzy matching of the data sync bit sequence // Fuzzy matching of the data sync bit sequence
if (countBits64((m_bitBuffer & YSF_SYNC_BITS_MASK) ^ YSF_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) { if (countBits64((m_bitBuffer & YSF_SYNC_BITS_MASK) ^ YSF_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
@ -103,16 +103,18 @@ void CYSFRX::processData(bool bit)
// Send a data frame to the host if the required number of bits have been received // Send a data frame to the host if the required number of bits have been received
if (m_bufferPtr == YSF_FRAME_LENGTH_BITS) { if (m_bufferPtr == YSF_FRAME_LENGTH_BITS) {
m_lostCount--;
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE // We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
m_lostCount--;
if (m_lostCount == 0U) { if (m_lostCount == 0U) {
DEBUG1("YSFRX: sync timed out, lost lock"); DEBUG1("YSFRX: sync timed out, lost lock");
io.setDecode(false); io.setDecode(false);
serial.writeYSFLost(); serial.writeYSFLost();
reset();
m_state = YSFRXS_NONE;
} else { } else {
// Write data to host
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U; m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
writeRSSIData(m_outBuffer); writeRSSIData(m_outBuffer);
// Start the next frame // Start the next frame

View file

@ -36,6 +36,7 @@ public:
void reset(); void reset();
private: private:
bool m_prev;
YSFRX_STATE m_state; YSFRX_STATE m_state;
uint64_t m_bitBuffer; uint64_t m_bitBuffer;
uint8_t m_outBuffer[YSF_FRAME_LENGTH_BYTES + 3U]; uint8_t m_outBuffer[YSF_FRAME_LENGTH_BYTES + 3U];
@ -50,3 +51,4 @@ private:
}; };
#endif #endif

View file

@ -1,119 +0,0 @@
/*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(CONFIG_H)
#define CONFIG_H
// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
// #define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
// #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
#define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support:
#define ENABLE_ADF7021
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
// #define DUPLEX
// TCXO of the ADF7021
// For 14.7456 MHz:
#define ADF7021_14_7456
// For 12.2880 MHz:
// #define ADF7021_12_2880
// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH
// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection:
#define ENABLE_SCAN_MODE
// Send RSSI value:
#define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1
// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE
// Disable mode LEDs blink during scan mode:
// #define QUIET_MODE_LEDS
// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
// #define DISCREET_SRV_LED_INVERTED
// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages
#define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif

View file

@ -1,120 +0,0 @@
/*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(CONFIG_H)
#define CONFIG_H
// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
// #define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
// #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// 9) LoneStar USB Stick ADF7071
#define LONESTAR_USB
// Enable ADF7021 support:
#define ENABLE_ADF7021
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
// #define DUPLEX
// TCXO of the ADF7021
// For 14.7456 MHz:
#define ADF7021_14_7456
// For 12.2880 MHz:
// #define ADF7021_12_2880
// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH
// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection:
#define ENABLE_SCAN_MODE
// Send RSSI value:
#define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
// #define SERIAL_REPEATER
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1
// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE
// Disable mode LEDs blink during scan mode:
// #define QUIET_MODE_LEDS
// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
// #define DISCREET_SRV_LED_INVERTED
// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages
#define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET * Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
#define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
// #define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET * Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
#define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
// #define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET * Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
#define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
#define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -30,12 +30,8 @@
// #define MMDVM_HS_DUAL_HAT_REV10 // #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA) // 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
#define NANO_DV_REV11 #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -30,12 +30,8 @@
// #define MMDVM_HS_DUAL_HAT_REV10 // #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA) // 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
#define NANO_DV_REV11 #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
// #define STM32_USART1_HOST // #define STM32_USART1_HOST
#define STM32_USB_HOST #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
#define NANO_HOTSPOT #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,116 +0,0 @@
/*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(CONFIG_H)
#define CONFIG_H
// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
// #define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
// #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
#define SKYBRIDGE_HS
// Enable ADF7021 support:
#define ENABLE_ADF7021
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
// #define DUPLEX
// TCXO of the ADF7021
// For 14.7456 MHz:
#define ADF7021_14_7456
// For 12.2880 MHz:
// #define ADF7021_12_2880
// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH
// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection:
#define ENABLE_SCAN_MODE
// Send RSSI value:
#define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1
// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE
// Disable mode LEDs blink during scan mode:
// #define QUIET_MODE_LEDS
// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
// #define DISCREET_SRV_LED_INVERTED
// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages
#define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
// #define STM32_USART1_HOST // #define STM32_USART1_HOST
#define STM32_USB_HOST #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
// #define STM32_USART1_HOST // #define STM32_USART1_HOST
#define STM32_USB_HOST #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -94,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif #endif

View file

@ -1,119 +0,0 @@
/*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(CONFIG_H)
#define CONFIG_H
// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
#define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
// #define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
// #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support:
#define ENABLE_ADF7021
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
// #define DUPLEX
// TCXO of the ADF7021
// For 14.7456 MHz:
#define ADF7021_14_7456
// For 12.2880 MHz:
// #define ADF7021_12_2880
// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH
// Host communication selection:
#define STM32_USART1_HOST
// #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection:
#define ENABLE_SCAN_MODE
// Send RSSI value:
#define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1
// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE
// Disable mode LEDs blink during scan mode:
// #define QUIET_MODE_LEDS
// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
// #define DISCREET_SRV_LED_INVERTED
// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages
#define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,9 +21,9 @@
// Select one board (STM32F103 based boards) // Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB: // 1) ZUMspot RPi or ZUMspot USB:
#define ZUMSPOT_ADF7021 // #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
// #define LIBRE_KIT_ADF7021 #define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12 // #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -60,22 +56,17 @@
// #define AD7021_GAIN_HIGH // #define AD7021_GAIN_HIGH
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST // #define STM32_USART1_HOST
// #define STM32_USB_HOST #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
// Send RSSI value: // Send RSSI value:
#define SEND_RSSI_DATA // #define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif #endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
// #define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,119 +0,0 @@
/*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#if !defined(CONFIG_H)
#define CONFIG_H
// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
#define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
// #define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support:
#define ENABLE_ADF7021
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
#define DUPLEX
// TCXO of the ADF7021
// For 14.7456 MHz:
#define ADF7021_14_7456
// For 12.2880 MHz:
// #define ADF7021_12_2880
// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH
// Host communication selection:
// #define STM32_USART1_HOST
#define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection:
#define ENABLE_SCAN_MODE
// Send RSSI value:
// #define SEND_RSSI_DATA
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1
// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE
// Disable mode LEDs blink during scan mode:
// #define QUIET_MODE_LEDS
// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
// #define DISCREET_SRV_LED_INVERTED
// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
#define LONG_USB_RESET
// Enable modem debug messages
// #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
// #define ENABLE_UDID
#endif

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -32,10 +32,6 @@
// #define NANO_HOTSPOT // #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10 // #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS
// 8) BridgeCom SkyBridge HotSpot
// #define SKYBRIDGE_HS
// Enable ADF7021 support: // Enable ADF7021 support:
#define ENABLE_ADF7021 #define ENABLE_ADF7021
@ -62,10 +58,6 @@
// Host communication selection: // Host communication selection:
#define STM32_USART1_HOST #define STM32_USART1_HOST
// #define STM32_USB_HOST // #define STM32_USB_HOST
// #define STM32_I2C_HOST
// I2C host address:
#define I2C_ADDR 0x22
// Enable mode detection: // Enable mode detection:
#define ENABLE_SCAN_MODE #define ENABLE_SCAN_MODE
@ -75,7 +67,6 @@
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
#define SERIAL_REPEATER #define SERIAL_REPEATER
#define SERIAL_REPEATER_BAUD 9600
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1 // #define SERIAL_REPEATER_USART1
@ -95,25 +86,10 @@
// Use the YSF and P25 LEDs for NXDN // Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS // #define USE_ALTERNATE_NXDN_LEDS
// Use the D-Star and P25 LEDs for M17
// #define USE_ALTERNATE_M17_LEDS
// Use the D-Star and DMR LEDs for POCSAG // Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS // #define USE_ALTERNATE_POCSAG_LEDS
// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET
// Enable modem debug messages // Enable modem debug messages
#define ENABLE_DEBUG // #define ENABLE_DEBUG
// Disable frequency bands check
// #define DISABLE_FREQ_CHECK
// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN
// Enable UDID feature
#define ENABLE_UDID
#endif #endif

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -16,173 +16,86 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
echo "******************************************************"
echo "********* Cleaning objects and updating code *********"
echo "******************************************************"
cd ~/MMDVM_HS/ cd ~/MMDVM_HS/
make clean make clean
git pull git pull
# Building ZUMspot Libre Kit # Building ZUMspot Libre Kit
echo "*******************************************************"
echo "********* Building ZUMspot Libre Kit firmware *********"
echo "*******************************************************"
cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h
make -j4 bl make bl
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_libre_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_libre_fw.bin
make clean make clean
# Building ZUMspot RPi # Building ZUMspot RPi
echo "*************************************************"
echo "********* Building ZUMspot RPi firmware *********"
echo "*************************************************"
cp ~/MMDVM_HS/configs/ZUMspot_RPi.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/ZUMspot_RPi.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_rpi_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_rpi_fw.bin
make clean make clean
# Building ZUMspot USB # Building ZUMspot USB
echo "*************************************************"
echo "********* Building ZUMspot USB firmware *********"
echo "*************************************************"
cp ~/MMDVM_HS/configs/ZUMspot_USB.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/ZUMspot_USB.h ~/MMDVM_HS/Config.h
make -j4 bl make bl
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_usb_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_usb_fw.bin
make clean make clean
# Building ZUMspot Duplex # Building ZUMspot Duplex
echo "****************************************************"
echo "********* Building ZUMspot Duplex firmware *********"
echo "****************************************************"
cp ~/MMDVM_HS/configs/ZUMspot_duplex.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/ZUMspot_duplex.h ~/MMDVM_HS/Config.h
make -j4 make bl
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_duplex_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_duplex_fw.bin
make clean
# Building ZUMspot Dualband
echo "******************************************************"
echo "********* Building ZUMspot Dualband firmware *********"
echo "******************************************************"
cp ~/MMDVM_HS/configs/ZUMspot_dualband.h ~/MMDVM_HS/Config.h
make -j4
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_dualband_fw.bin
make clean make clean
# Building MMDVM_HS_Hat # Building MMDVM_HS_Hat
echo "**************************************************"
echo "********* Building MMDVM_HS_Hat firmware *********"
echo "**************************************************"
cp ~/MMDVM_HS/configs/MMDVM_HS_Hat.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/MMDVM_HS_Hat.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw.bin
make clean make clean
# Building MMDVM_HS_Hat (12.288 MHz TCXO) # Building MMDVM_HS_Hat (12.288 MHz TCXO)
echo "********************************************************************"
echo "********* Building MMDVM_HS_Hat (12.288 MHz TCXO) firmware *********"
echo "********************************************************************"
cp ~/MMDVM_HS/configs/MMDVM_HS_Hat-12mhz.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/MMDVM_HS_Hat-12mhz.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw-12mhz.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw-12mhz.bin
make clean make clean
# Building MMDVM_HS_Dual_Hat # Building MMDVM_HS_Dual_Hat
echo "*******************************************************"
echo "********* Building MMDVM_HS_Dual_Hat firmware *********"
echo "*******************************************************"
cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw.bin
make clean make clean
# Building MMDVM_HS_Dual_Hat (12.288 MHz TCXO) # Building MMDVM_HS_Dual_Hat (12.288 MHz TCXO)
echo "*************************************************************************"
echo "********* Building MMDVM_HS_Dual_Hat (12.288 MHz TCXO) firmware *********"
echo "*************************************************************************"
cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat-12mhz.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat-12mhz.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw-12mhz.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw-12mhz.bin
make clean make clean
# Building Nano hotSPOT # Building Nano hotSPOT
echo "**************************************************"
echo "********* Building Nano hotSPOT firmware *********"
echo "**************************************************"
cp ~/MMDVM_HS/configs/Nano_hotSPOT.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/Nano_hotSPOT.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nano_hotspot_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nano_hotspot_fw.bin
make clean make clean
# Building NanoDV NPi # Building NanoDV NPi
echo "************************************************"
echo "********* Building NanoDV NPi firmware *********"
echo "************************************************"
cp ~/MMDVM_HS/configs/NanoDV_NPi.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/NanoDV_NPi.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nanodv_npi_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nanodv_npi_fw.bin
make clean make clean
# Building NanoDV USB # Building NanoDV USB
echo "************************************************"
echo "********* Building NanoDV USB firmware *********"
echo "************************************************"
cp ~/MMDVM_HS/configs/NanoDV_USB.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/NanoDV_USB.h ~/MMDVM_HS/Config.h
make -j4 bl make bl
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/nanodv_usb_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/nanodv_usb_fw.bin
make clean make clean
# Building D2RG MMDVM_HS
echo "***************************************************"
echo "********* Building D2RG MMDVM_HS firmware *********"
echo "***************************************************"
cp ~/MMDVM_HS/configs/D2RG_MMDVM_HS.h ~/MMDVM_HS/Config.h
make -j4
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/d2rg_mmdvm_hs.bin
make clean
# Building Generic Simplex GPIO # Building Generic Simplex GPIO
echo "**********************************************************"
echo "********* Building Generic Simplex GPIO firmware *********"
echo "**********************************************************"
cp ~/MMDVM_HS/configs/generic_gpio.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/generic_gpio.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_gpio_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_gpio_fw.bin
make clean make clean
# Building Generic Duplex GPIO # Building Generic Duplex GPIO
echo "*********************************************************"
echo "********* Building Generic Duplex GPIO firmware *********"
echo "*********************************************************"
cp ~/MMDVM_HS/configs/generic_duplex_gpio.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/generic_duplex_gpio.h ~/MMDVM_HS/Config.h
make -j4 make
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_duplex_gpio_fw.bin mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_duplex_gpio_fw.bin
make clean make clean
# Building Generic Duplex USB
echo "********************************************************"
echo "********* Building Generic Duplex USB firmware *********"
echo "********************************************************"
cp ~/MMDVM_HS/configs/generic_duplex_usb.h ~/MMDVM_HS/Config.h
make -j4 bl
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/generic_duplex_usb_fw.bin
make clean
# Building SkyBridge RPi HS
echo "******************************************************"
echo "********* Building SkyBridge RPi HS firmware *********"
echo "******************************************************"
cp ~/MMDVM_HS/configs/SkyBridge_RPi.h ~/MMDVM_HS/Config.h
make -j4
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/skybridge_rpi_fw.bin
make clean
# Building LoneStar USB
echo "*************************************************"
echo "********* Building LoneStar USB firmware *********"
echo "*************************************************"
cp ~/MMDVM_HS/configs/LoneStar_USB.h ~/MMDVM_HS/Config.h
make -j4 bl
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/lonestar_usb_fw.bin
make clean
cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h

View file

@ -49,12 +49,6 @@ if [ $(uname -s) == "Linux" ]; then
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"

View file

@ -1,91 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.5.2"
# Configure beta version
FW_VERSION_BETA="v1.5.1b"
# Firmware filename
FW_FILENAME="d2rg_mmdvm_hs.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware
# Note: /dev/ttySC0 should be enabled, see: https://github.com/bg3mdo/D2RG_MMDVM_HS_ambe_uart_service
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0

View file

@ -1,90 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.5.2"
# Configure beta version
FW_VERSION_BETA="v1.5.1b"
# Firmware filename
FW_FILENAME="zumspot_dualband_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for ZUMspot Libre Kit
FW_FILENAME="zumspot_duplex_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_duplex_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -85,6 +72,12 @@ fi
# Stop MMDVMHost process to free serial port # Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Reset ZUMspot to enter bootloader mode
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware
eval sudo $DFU_UTIL -D zumspot_duplex_fw.bin -d 1eaf:0003 -a 2 -R -R
echo
echo "Please RESET your ZUMspot !"
echo

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,25 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename
FW_FILENAME="generic_duplex_gpio_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download latest firmware for Generic Duplex GPIO # Download latest firmware for Generic Duplex GPIO
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/ curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/generic_duplex_gpio_fw.bin
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -44,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -79,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -89,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w generic_duplex_gpio_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,92 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.5.2"
# Configure beta version
FW_VERSION_BETA="v1.5.1b"
# Firmware filename
FW_FILENAME="generic_duplex_gpio_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download latest firmware for Generic Duplex GPIO
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3

View file

@ -1,101 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.5.2"
# Change USB-serial port name ONLY in macOS
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
# Configure beta version
FW_VERSION_BETA="v1.5.1b"
# Firmware filename
FW_FILENAME="generic_duplex_usb_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Reset ZUMspot to enter bootloader mode
eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
echo
echo "Please RESET your MMDVM_HS board !"
echo

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for Generic Simplex GPIO
FW_FILENAME="generic_gpio_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/generic_gpio_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w generic_gpio_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET # Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for MMDVM_HS_Hat
FW_FILENAME="mmdvm_hs_dual_hat_fw-12mhz.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_dual_hat_fw-12mhz.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w mmdvm_hs_dual_hat_fw-12mhz.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET # Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for MMDVM_HS_Hat
FW_FILENAME="mmdvm_hs_dual_hat_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_dual_hat_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w mmdvm_hs_dual_hat_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET # Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for MMDVM_HS_Hat with 12.288 MHz TCXO
FW_FILENAME="mmdvm_hs_hat_fw-12mhz.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_hat_fw-12mhz.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w mmdvm_hs_hat_fw-12mhz.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for MMDVM_HS_Hat
FW_FILENAME="mmdvm_hs_hat_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_hat_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w mmdvm_hs_hat_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -17,25 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Change USB-serial port name ONLY in macOS # Change USB-serial port name ONLY in macOS
MAC_DEV_USB_SER="/dev/cu.usbmodem14401" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Configure beta version # Download latest firmware for ZUMspot Libre Kit
FW_VERSION_BETA="v1.5.1b" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_libre_fw.bin
# Firmware filename
FW_FILENAME="zumspot_libre_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -51,12 +39,6 @@ if [ $(uname -s) == "Linux" ]; then
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -94,8 +76,8 @@ sudo killall MMDVMHost >/dev/null 2>&1
eval sudo $DFU_RST $DEV_USB_SER 750 eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware # Upload the firmware
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R eval sudo $DFU_UTIL -D zumspot_libre_fw.bin -d 1eaf:0003 -a 2 -R -R
echo echo
echo "Please RESET your ZUMspot Libre Kit !" echo "Please RESET your ZUMspot !"
echo echo

View file

@ -1,101 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.6.0"
# Change USB-serial port name ONLY in macOS
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
# Configure beta version
FW_VERSION_BETA="v1.6.0b"
# Firmware filename
FW_FILENAME="lonestar_usb_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Reset ZUMspot to enter bootloader mode
eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
echo
echo "Please RESET your LoneStar device !"
echo

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for Nano DV
FW_FILENAME="nanodv_npi_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nanodv_npi_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w nanodv_npi_fw.bin -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0

28
scripts/install_fw_nanodv_usb.sh Executable file → Normal file
View file

@ -17,25 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Change USB-serial port name ONLY in macOS # Change USB-serial port name ONLY in macOS
MAC_DEV_USB_SER="/dev/cu.usbmodem14401" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Configure beta version # Download latest firmware for ZUMspot USB
FW_VERSION_BETA="v1.5.1b" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nanodv_usb_fw.bin
# Firmware filename
FW_FILENAME="nanodv_usb_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -51,12 +39,6 @@ if [ $(uname -s) == "Linux" ]; then
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -94,7 +76,7 @@ sudo killall MMDVMHost >/dev/null 2>&1
eval sudo $DFU_RST $DEV_USB_SER 750 eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware # Upload the firmware
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R eval sudo $DFU_UTIL -D nanodv_usb_fw.bin -d 1eaf:0003 -a 2 -R -R
echo echo
echo "Please RESET your Nano DV !" echo "Please RESET your Nano DV !"

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -16,34 +16,14 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# If we run this on a NanoPi board set the GPIO pins
if [ -f /etc/pistar-release ]; then
hardware=$(grep -i hardware /etc/pistar-release | awk -F "= " '{print $2}')
if [[ ${hardware} == "NanoPi" ]]; then
echo 3 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio3/direction
echo 1 > /sys/class/gpio/gpio3/value
echo 3 > /sys/class/gpio/unexport
fi
fi
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for Nano hotSPOT
FW_FILENAME="nano_hotspot_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nano_hotspot_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -52,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -87,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -97,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 200,-3,3:-200,3 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w nano_hotspot_fw.bin -g 0x0 -R -i 200,-3,3:-200,3 /dev/ttyAMA0

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU # Copyright (C) 2017,2018 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -17,22 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Configure beta version # Change USB-serial port name ONLY in macOS
FW_VERSION_BETA="v1.5.1b" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Firmware filename # Download latest firmware for ZUMspot RPi (GPIO)
FW_FILENAME="zumspot_rpi_fw.bin" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_rpi_fw.bin
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -41,18 +32,13 @@ fi
# Configure vars depending on OS # Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then if [ $(uname -s) == "Linux" ]; then
DEV_USB_SER="/dev/ttyACM0"
if [ $(uname -m) == "x86_64" ]; then if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected" echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -76,6 +62,7 @@ fi
if [ $(uname -s) == "Darwin" ]; then if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected" echo "macOS detected"
DEV_USB_SER=$MAC_DEV_USB_SER
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
@ -86,5 +73,5 @@ fi
sudo killall MMDVMHost >/dev/null 2>&1 sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware # Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 eval sudo $STM32FLASH -v -w zumspot_rpi_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -1,90 +0,0 @@
#!/bin/bash
# Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version
FW_VERSION="v1.5.2"
# Configure beta version
FW_VERSION_BETA="v1.5.1b"
# Firmware filename
FW_FILENAME="skybridge_rpi_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then
git clone https://github.com/juribeparada/STM32F10X_Lib
fi
# Configure vars depending on OS
if [ $(uname -s) == "Linux" ]; then
if [ $(uname -m) == "x86_64" ]; then
echo "Linux 64-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv6l" ]; then
echo "Raspberry Pi 2 or Pi Zero W detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
else
echo "Linux 32-bit detected"
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
fi
fi
if [ $(uname -s) == "Darwin" ]; then
echo "macOS detected"
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
fi
# Stop MMDVMHost process to free serial port
sudo killall MMDVMHost >/dev/null 2>&1
# Upload the firmware
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0

View file

@ -17,25 +17,13 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# Configure latest version # Configure latest version
FW_VERSION="v1.5.2" FW_VERSION="v1.4.7"
# Change USB-serial port name ONLY in macOS # Change USB-serial port name ONLY in macOS
MAC_DEV_USB_SER="/dev/cu.usbmodem14401" MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
# Configure beta version # Download latest firmware for ZUMspot USB
FW_VERSION_BETA="v1.5.1b" curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_usb_fw.bin
# Firmware filename
FW_FILENAME="zumspot_usb_fw.bin"
# Download latest firmware
if [ $1 = "beta" ]; then
echo "Downloading beta firmware..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
else
echo "Downloading latest firmware (stable)..."
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
fi
# Download STM32F10X_Lib (only for binary tools) # Download STM32F10X_Lib (only for binary tools)
if [ ! -d "./STM32F10X_Lib/utils" ]; then if [ ! -d "./STM32F10X_Lib/utils" ]; then
@ -51,12 +39,6 @@ if [ $(uname -s) == "Linux" ]; then
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
elif [ $(uname -m) == "aarch64" ] ; then
echo "Raspberry Pi 4 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
elif [ $(uname -m) == "armv7l" ]; then elif [ $(uname -m) == "armv7l" ]; then
echo "Raspberry Pi 3 detected" echo "Raspberry Pi 3 detected"
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
@ -94,7 +76,7 @@ sudo killall MMDVMHost >/dev/null 2>&1
eval sudo $DFU_RST $DEV_USB_SER 750 eval sudo $DFU_RST $DEV_USB_SER 750
# Upload the firmware # Upload the firmware
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R eval sudo $DFU_UTIL -D zumspot_usb_fw.bin -d 1eaf:0003 -a 2 -R -R
echo echo
echo "Please RESET your ZUMspot !" echo "Please RESET your ZUMspot !"

View file

@ -1,6 +1,5 @@
/* /*
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU * Copyright (C) 2017,2018 by Andy Uribe CA6JAU
* Copyright (C) 2020,2021 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -24,9 +23,9 @@
#include "ADF7021.h" #include "ADF7021.h"
#define VER_MAJOR "1" #define VER_MAJOR "1"
#define VER_MINOR "6" #define VER_MINOR "4"
#define VER_REV "0" #define VER_REV "7"
#define VERSION_DATE "20210919" #define VERSION_DATE "20180821"
#if defined(ZUMSPOT_ADF7021) #if defined(ZUMSPOT_ADF7021)
#define BOARD_INFO "ZUMspot" #define BOARD_INFO "ZUMspot"
@ -36,14 +35,8 @@
#define BOARD_INFO "MMDVM_HS_Dual_Hat" #define BOARD_INFO "MMDVM_HS_Dual_Hat"
#elif defined(NANO_HOTSPOT) #elif defined(NANO_HOTSPOT)
#define BOARD_INFO "Nano_hotSPOT" #define BOARD_INFO "Nano_hotSPOT"
#elif defined(NANO_DV_REV11) #elif defined(NANO_DV_REV10)
#define BOARD_INFO "Nano_DV" #define BOARD_INFO "Nano_DV"
#elif defined(D2RG_MMDVM_HS)
#define BOARD_INFO "D2RG_MMDVM_HS"
#elif defined(SKYBRIDGE_HS)
#define BOARD_INFO "SkyBridge"
#elif defined(LONESTAR_USB)
#define BOARD_INFO "LS_USB_STICK"
#else #else
#define BOARD_INFO "MMDVM_HS" #define BOARD_INFO "MMDVM_HS"
#endif #endif