diff --git a/firmware/application/apps/ui_mictx.cpp b/firmware/application/apps/ui_mictx.cpp index 68d98212..6b2169cf 100644 --- a/firmware/application/apps/ui_mictx.cpp +++ b/firmware/application/apps/ui_mictx.cpp @@ -30,6 +30,7 @@ using wolfson::wm8731::WM8731; #include "tonesets.hpp" #include "portapack_hal.hpp" +#include "cpld_update.hpp" #include "string_format.hpp" #include "irq_controls.hpp" @@ -178,6 +179,7 @@ void MicTXView::rxaudio(bool is_on) { receiver_model.set_vga(rx_vga); receiver_model.set_rf_amp(rx_amp); receiver_model.enable(); + hackrf::cpld::load_sram_no_verify(); // to have a good RX without any ghost inside Mic App audio::output::start(); } 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... @@ -549,6 +551,7 @@ MicTXView::~MicTXView() { if (rx_enabled) //Also turn off audio rx if enabled rxaudio(false); baseband::shutdown(); + hackrf::cpld::load_sram_no_verify(); // too leave all RX ok, wihouth ghost signal problem at the exit . } } diff --git a/firmware/common/cpld_update.cpp b/firmware/common/cpld_update.cpp index 03964691..3055eb3d 100644 --- a/firmware/common/cpld_update.cpp +++ b/firmware/common/cpld_update.cpp @@ -114,6 +114,20 @@ bool load_sram() { 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() { auto jtag_target_hackrf_cpld = jtag_target_hackrf(); hackrf::one::cpld::CPLD hackrf_cpld { jtag_target_hackrf_cpld }; diff --git a/firmware/common/cpld_update.hpp b/firmware/common/cpld_update.hpp index 6799c708..36c87a1b 100644 --- a/firmware/common/cpld_update.hpp +++ b/firmware/common/cpld_update.hpp @@ -38,6 +38,7 @@ namespace hackrf { namespace cpld { 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(); void init_from_eeprom();