Solve previous regression fw 1.3.1 -->fw 1.4.0 onwards , about RX ghost signal issue #637
This commit is contained in:
GullCode 2022-10-07 22:17:10 +02:00 committed by GitHub
commit 83f7c9ae63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 68 additions and 17 deletions

View File

@ -29,6 +29,7 @@
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "portapack.hpp" #include "portapack.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp" #include "portapack_persistent_memory.hpp"
using namespace portapack; using namespace portapack;
@ -242,7 +243,8 @@ GpsSimAppView::GpsSimAppView(
GpsSimAppView::~GpsSimAppView() { GpsSimAppView::~GpsSimAppView() {
radio::disable(); radio::disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void GpsSimAppView::on_hide() { void GpsSimAppView::on_hide() {

View File

@ -27,6 +27,7 @@
#include "lge_app.hpp" #include "lge_app.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "ui_textentry.hpp" #include "ui_textentry.hpp"
#include "string_format.hpp" #include "string_format.hpp"
@ -48,7 +49,8 @@ LGEView::~LGEView() {
settings.save("tx_lge", &app_settings); settings.save("tx_lge", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown();// better this function at the end, not load_sram() that sometimes produces hang up.
} }
void LGEView::generate_lge_frame(const uint8_t command, const uint16_t address_a, const uint16_t address_b, std::vector<uint8_t>& data) { void LGEView::generate_lge_frame(const uint8_t command, const uint16_t address_a, const uint16_t address_b, std::vector<uint8_t>& data) {

View File

@ -25,6 +25,7 @@
#include "soundboard_app.hpp" #include "soundboard_app.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "tonesets.hpp" #include "tonesets.hpp"
#include "cpld_update.hpp"
using namespace tonekey; using namespace tonekey;
using namespace portapack; using namespace portapack;
@ -295,7 +296,8 @@ SoundBoardView::~SoundBoardView() {
stop(); stop();
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
} }

View File

@ -26,6 +26,7 @@
#include "manchester.hpp" #include "manchester.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "portapack.hpp" #include "portapack.hpp"
#include "cpld_update.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include <cstring> #include <cstring>
@ -290,8 +291,9 @@ ADSBTxView::~ADSBTxView() {
settings.save("tx_adsb", &app_settings); settings.save("tx_adsb", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, withouth ghost signal problem at the exit .
} baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
}
void ADSBTxView::generate_frames() { void ADSBTxView::generate_frames() {
const uint32_t ICAO_address = sym_icao.value_hex_u64(); const uint32_t ICAO_address = sym_icao.value_hex_u64();

View File

@ -26,6 +26,7 @@
#include "aprs.hpp" #include "aprs.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "portapack.hpp" #include "portapack.hpp"
#include "cpld_update.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "portapack_shared_memory.hpp" #include "portapack_shared_memory.hpp"
#include "portapack_persistent_memory.hpp" #include "portapack_persistent_memory.hpp"
@ -48,7 +49,8 @@ APRSTXView::~APRSTXView() {
settings.save("tx_aprs", &app_settings); settings.save("tx_aprs", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void APRSTXView::start_tx() { void APRSTXView::start_tx() {

View File

@ -24,6 +24,7 @@
#include "string_format.hpp" #include "string_format.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp" #include "portapack_persistent_memory.hpp"
using namespace portapack; using namespace portapack;
@ -145,6 +146,8 @@ BHTView::~BHTView() {
settings.save("tx_bht", &app_settings); settings.save("tx_bht", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
BHTView::BHTView(NavigationView& nav) { BHTView::BHTView(NavigationView& nav) {

View File

@ -23,6 +23,7 @@
#include "ui_coasterp.hpp" #include "ui_coasterp.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_persistent_memory.hpp" #include "portapack_persistent_memory.hpp"
#include <cstring> #include <cstring>
@ -42,7 +43,8 @@ CoasterPagerView::~CoasterPagerView() {
settings.save("tx_coaster", &app_settings); settings.save("tx_coaster", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void CoasterPagerView::generate_frame() { void CoasterPagerView::generate_frame() {

View File

@ -24,6 +24,7 @@
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "cpld_update.hpp"
using namespace portapack; using namespace portapack;
@ -208,7 +209,8 @@ EncodersView::~EncodersView() {
settings.save("tx_ook", &app_settings); settings.save("tx_ook", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // ghost signal c/m to the problem at the exit .
baseband::shutdown(); // better this function after load_sram()
} }
void EncodersView::update_progress() { void EncodersView::update_progress() {

View File

@ -25,6 +25,7 @@
#include "ui_freqman.hpp" #include "ui_freqman.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp" #include "string_format.hpp"
using namespace portapack; using namespace portapack;
@ -183,7 +184,8 @@ void JammerView::focus() {
JammerView::~JammerView() { JammerView::~JammerView() {
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void JammerView::on_retune(const rf::Frequency freq, const uint32_t range) { void JammerView::on_retune(const rf::Frequency freq, const uint32_t range) {

View File

@ -23,6 +23,7 @@
#include "ui_keyfob.hpp" #include "ui_keyfob.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp" #include "string_format.hpp"
using namespace portapack; using namespace portapack;
@ -140,7 +141,8 @@ KeyfobView::~KeyfobView() {
settings.save("tx_keyfob", &app_settings); settings.save("tx_keyfob", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void KeyfobView::update_progress(const uint32_t progress) { void KeyfobView::update_progress(const uint32_t progress) {

View File

@ -27,6 +27,7 @@
#include "modems.hpp" #include "modems.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "cpld_update.hpp"
#include "serializer.hpp" #include "serializer.hpp"
@ -44,7 +45,8 @@ LCRView::~LCRView() {
settings.save("tx_lcr", &app_settings); settings.save("tx_lcr", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
/* /*

View File

@ -30,6 +30,7 @@ using wolfson::wm8731::WM8731;
#include "tonesets.hpp" #include "tonesets.hpp"
#include "portapack_hal.hpp" #include "portapack_hal.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "irq_controls.hpp" #include "irq_controls.hpp"
@ -178,6 +179,7 @@ void MicTXView::rxaudio(bool is_on) {
receiver_model.set_vga(rx_vga); receiver_model.set_vga(rx_vga);
receiver_model.set_rf_amp(rx_amp); receiver_model.set_rf_amp(rx_amp);
receiver_model.enable(); receiver_model.enable();
hackrf::cpld::load_sram_no_verify(); // to have a good RX without any ghost inside Mic App
audio::output::start(); audio::output::start();
} else { //These incredibly convoluted steps are required for the vumeter to reappear when stopping RX. } else { //These incredibly convoluted steps are required for the vumeter to reappear when stopping RX.
receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio); //This fixes something with AM RX... receiver_model.set_modulation(ReceiverModel::Mode::NarrowbandFMAudio); //This fixes something with AM RX...
@ -548,7 +550,8 @@ MicTXView::~MicTXView() {
transmitter_model.disable(); transmitter_model.disable();
if (rx_enabled) //Also turn off audio rx if enabled if (rx_enabled) //Also turn off audio rx if enabled
rxaudio(false); rxaudio(false);
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
} }

View File

@ -26,6 +26,7 @@
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "hackrf_gpio.hpp" #include "hackrf_gpio.hpp"
#include "portapack_shared_memory.hpp" #include "portapack_shared_memory.hpp"
#include "cpld_update.hpp"
#include "ui_textentry.hpp" #include "ui_textentry.hpp"
#include "string_format.hpp" #include "string_format.hpp"
@ -102,7 +103,8 @@ MorseView::~MorseView() {
settings.save("tx_morse", &app_settings); settings.save("tx_morse", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit .
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void MorseView::paint(Painter&) { void MorseView::paint(Painter&) {

View File

@ -23,6 +23,7 @@
#include "ui_pocsag_tx.hpp" #include "ui_pocsag_tx.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "ui_textentry.hpp" #include "ui_textentry.hpp"
@ -43,7 +44,8 @@ POCSAGTXView::~POCSAGTXView() {
settings.save("tx_pocsag", &app_settings); settings.save("tx_pocsag", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void POCSAGTXView::on_tx_progress(const uint32_t progress, const bool done) { void POCSAGTXView::on_tx_progress(const uint32_t progress, const bool done) {

View File

@ -24,6 +24,7 @@
#include "portapack.hpp" #include "portapack.hpp"
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "cpld_update.hpp"
#include "portapack_shared_memory.hpp" #include "portapack_shared_memory.hpp"
#include <cstring> #include <cstring>
@ -180,7 +181,8 @@ RDSView::~RDSView() {
settings.save("tx_rds", &app_settings); settings.save("tx_rds", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void RDSView::start_tx() { void RDSView::start_tx() {

View File

@ -25,6 +25,7 @@
#include "portapack.hpp" #include "portapack.hpp"
#include "hackrf_hal.hpp" #include "hackrf_hal.hpp"
#include "cpld_update.hpp"
#include <cstring> #include <cstring>
#include <stdio.h> #include <stdio.h>
@ -93,7 +94,8 @@ SSTVTXView::~SSTVTXView() {
settings.save("tx_sstv", &app_settings); settings.save("tx_sstv", &app_settings);
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void SSTVTXView::on_tuning_frequency_changed(rf::Frequency f) { void SSTVTXView::on_tuning_frequency_changed(rf::Frequency f) {

View File

@ -26,6 +26,7 @@
#include "baseband_api.hpp" #include "baseband_api.hpp"
#include "string_format.hpp" #include "string_format.hpp"
#include "cpld_update.hpp"
using namespace portapack; using namespace portapack;
@ -39,7 +40,8 @@ void TouchTunesView::focus() {
TouchTunesView::~TouchTunesView() { TouchTunesView::~TouchTunesView() {
transmitter_model.disable(); transmitter_model.disable();
baseband::shutdown(); hackrf::cpld::load_sram_no_verify(); // to leave all RX ok, without ghost signal problem at the exit.
baseband::shutdown(); // better this function at the end, not load_sram() that sometimes produces hang up.
} }
void TouchTunesView::stop_tx() { void TouchTunesView::stop_tx() {

View File

@ -114,6 +114,20 @@ bool load_sram() {
return ok; return ok;
} }
void load_sram_no_verify() {
// CoolRunner II family has Hybrid memory CPLD arquitecture (SRAM+NVM)
// It seems that after using TX App somehow , I do not why , the CPLD_SRAM part needs to be re_loaded to solve #637 ghost beat
// load_sram() it is already called at each boot in portapack.cpp ,including verify CPLD part.
// Here we skipped CPLD verify part,just to be quicker (in case any CPLD problem it will be detected in the boot process).
auto jtag_target_hackrf_cpld = jtag_target_hackrf();
hackrf::one::cpld::CPLD hackrf_cpld { jtag_target_hackrf_cpld };
hackrf_cpld.write_sram(hackrf::one::cpld::verify_blocks);
return;
}
bool verify_eeprom() { bool verify_eeprom() {
auto jtag_target_hackrf_cpld = jtag_target_hackrf(); auto jtag_target_hackrf_cpld = jtag_target_hackrf();
hackrf::one::cpld::CPLD hackrf_cpld { jtag_target_hackrf_cpld }; hackrf::one::cpld::CPLD hackrf_cpld { jtag_target_hackrf_cpld };

View File

@ -38,6 +38,7 @@ namespace hackrf {
namespace cpld { namespace cpld {
bool load_sram(); bool load_sram();
void load_sram_no_verify(); // added to solve issue #637 , "ghost" signal at RX , after using any TX App
bool verify_eeprom(); bool verify_eeprom();
void init_from_eeprom(); void init_from_eeprom();