From 636c1fdf26b474577ca0bd4c6051025d9f44687a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 20 Dec 2021 13:37:28 +0100 Subject: [PATCH 1/6] added GNSS enable pin handling --- bsp_q7s/boardconfig/busConf.h | 2 ++ bsp_q7s/core/ObjectFactory.cpp | 14 +++++++++++++- linux/fsfwconfig/devices/gpioIds.h | 2 ++ .../pollingsequence/pollingSequenceFactory.cpp | 4 ++-- tmtc | 2 +- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 73605471..e6f9ae54 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -31,6 +31,8 @@ namespace gpioNames { static constexpr char MGM_3_CS[] = "mgm_3_rm3100_chip_select"; static constexpr char RESET_GNSS_0[] = "reset_gnss_0"; static constexpr char RESET_GNSS_1[] = "reset_gnss_1"; + static constexpr char GNSS_0_ENABLE[] = "enable_gnss_0"; + static constexpr char GNSS_1_ENABLE[] = "enable_gnss_1"; static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0"; static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2"; static constexpr char HEATER_0[] = "heater0"; diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 558f23b1..3b35f89e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -468,7 +468,19 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI gpio::LOW); gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ENABLE, gpio); - // TODO: Add enable pins for GPS as soon as new interface board design is finished + // Enable pins for GNSS + consumer.str(""); + consumer << "0x" << std::hex << objects::GPS0_HANDLER; + gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_0_ENABLE, consumer.str(), + gpio::DIR_OUT, gpio::LOW); + gpioCookieAcsBoard->addGpio(gpioIds::GNSS_0_ENABLE, gpio); + + consumer.str(""); + consumer << "0x" << std::hex << objects::GPS1_HANDLER; + gpio = new GpiodRegularByLineName(q7s::gpioNames::GNSS_1_ENABLE, consumer.str(), gpio::DIR_OUT, + gpio::LOW); + gpioCookieAcsBoard->addGpio(gpioIds::GNSS_1_ENABLE, gpio); + gpioComIF->addGpios(gpioCookieAcsBoard); std::string spiDev = q7s::SPI_DEFAULT_DEV; diff --git a/linux/fsfwconfig/devices/gpioIds.h b/linux/fsfwconfig/devices/gpioIds.h index 8d3f94ca..e4b9f727 100644 --- a/linux/fsfwconfig/devices/gpioIds.h +++ b/linux/fsfwconfig/devices/gpioIds.h @@ -27,6 +27,8 @@ enum gpioId_t { GNSS_0_NRESET, GNSS_1_NRESET, + GNSS_0_ENABLE, + GNSS_1_ENABLE, GYRO_0_ENABLE, GYRO_2_ENABLE, diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 19d9b2de..be38fd89 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -439,8 +439,8 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_ACS_BOARD == 1 - bool enableAside = true; - bool enableBside = false; + bool enableAside = false; + bool enableBside = true; if(enableAside) { // A side thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, diff --git a/tmtc b/tmtc index 8cfc2892..1c2f09ad 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8cfc2892dd95f959edb4b0ec1bbc8fc4aaa69ef2 +Subproject commit 1c2f09adc8c775cf84cfab860da165a319a756af From 861d92f3c2b18812650ebaf256f5e28eb5aee020 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Dec 2021 18:13:20 +0100 Subject: [PATCH 2/6] update uart device names --- bsp_q7s/boardconfig/busConf.h | 12 +++++------- bsp_q7s/core/ObjectFactory.cpp | 10 +--------- .../pollingsequence/pollingSequenceFactory.cpp | 4 ++-- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index e6f9ae54..354dc263 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -8,13 +8,11 @@ static constexpr char SPI_RW_DEV[] = "/dev/spidev3.0"; static constexpr char I2C_DEFAULT_DEV[] = "/dev/i2c-1"; -static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ttyUL3"; -static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ttyUL4"; -static constexpr char UART_SYRLINKS_DEV[] = "/dev/ttyUL5"; -static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ttyUL8"; - -static constexpr char UART_GNSS_0_DEV[] = "/dev/ttyUL0"; -static constexpr char UART_GNSS_1_DEV[] = "/dev/ttyUL2"; +static constexpr char UART_GNSS_DEV[] = "/dev/ttyUL0"; +static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ttyUL2"; +static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ttyUL3"; +static constexpr char UART_SYRLINKS_DEV[] = "/dev/ttyUL4"; +static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ttyUL7"; static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0"; static constexpr char UIO_PDEC_CONFIG_MEMORY[] = "/dev/uio2"; diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3b35f89e..ddd82853 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -564,22 +564,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI resetArgsGnss0.gnss1 = false; resetArgsGnss0.gpioComIF = gpioComIF; resetArgsGnss0.waitPeriodMs = 100; - auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV, + auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_DEV, UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER); uartCookieGps0->setToFlushInput(true); uartCookieGps0->setReadCycles(6); - auto uartCookieGps1 = new UartCookie(objects::GPS1_HANDLER, q7s::UART_GNSS_1_DEV, - UartModes::CANONICAL, uart::GNSS_BAUD, uart::HYPERION_GPS_REPLY_MAX_BUFFER); - uartCookieGps1->setToFlushInput(true); - uartCookieGps1->setReadCycles(6); auto gpsHandler0 = new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookieGps0, debugGps); gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); gpsHandler0->setStartUpImmediately(); - auto gpsHandler1 = new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, - uartCookieGps1, debugGps); - gpsHandler1->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss1); - gpsHandler1->setStartUpImmediately(); } void ObjectFactory::createHeaterComponents() { diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index be38fd89..19d9b2de 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -439,8 +439,8 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) { #endif #if OBSW_ADD_ACS_BOARD == 1 - bool enableAside = false; - bool enableBside = true; + bool enableAside = true; + bool enableBside = false; if(enableAside) { // A side thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0, From 433947824aa5d2702aab651ba0d13d9bf3d19e4d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Dec 2021 18:28:46 +0100 Subject: [PATCH 3/6] removed spi mux switching, not necessary anymore --- bsp_q7s/callbacks/rwSpiCallback.cpp | 10 ---------- bsp_q7s/core/ObjectFactory.cpp | 9 --------- 2 files changed, 19 deletions(-) diff --git a/bsp_q7s/callbacks/rwSpiCallback.cpp b/bsp_q7s/callbacks/rwSpiCallback.cpp index ad99d505..1e60e3c0 100644 --- a/bsp_q7s/callbacks/rwSpiCallback.cpp +++ b/bsp_q7s/callbacks/rwSpiCallback.cpp @@ -51,11 +51,6 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie *cookie, const uint8_t *sen return result; } - /** Disconnect PS SPI peripheral and select AXI SPI core */ - if(gpioIF->pullHigh(gpioIds::SPI_MUX) != HasReturnvaluesIF::RETURN_OK) { - sif::error << "rwSpiCallback::spiCallback: Failed to pull spi mux gpio high" << std::endl; - } - /** Sending frame start sign */ writeBuffer[0] = 0x7E; writeSize = 1; @@ -239,10 +234,5 @@ void closeSpi (gpioId_t gpioId, GpioIF* gpioIF, MutexIF* mutex) { if(mutex->unlockMutex() != HasReturnvaluesIF::RETURN_OK) { sif::error << "rwSpiCallback::closeSpi: Failed to unlock mutex" << std::endl;; } - - /** Route SPI interface again to PS SPI peripheral */ - if(gpioIF->pullLow(gpioIds::SPI_MUX) != HasReturnvaluesIF::RETURN_OK) { - sif::error << "rwSpiCallback::spiCallback: Failed to pull spi mux gpio low" << std::endl; - } } } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ddd82853..15416e1e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -840,15 +840,6 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { gpio::LOW); gpioCookieRw->addGpio(gpioIds::EN_RW4, gpio); - /** - * This GPIO is only internally connected to the SPI MUX module and responsible to disconnect - * the PS SPI peripheral from the SPI interface and route out the SPI lines of the AXI SPI core. - * Per default the PS SPI is selected (EMIO = 0). - */ - gpio = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_SELECT, - "SPI Reaction Wheel Callback ", gpio::DIR_OUT, gpio::LOW); - gpioCookieRw->addGpio(gpioIds::SPI_MUX, gpio); - gpioComIF->addGpios(gpioCookieRw); auto rw1SpiCookie = new SpiCookie(addresses::RW1, gpioIds::CS_RW1, q7s::SPI_RW_DEV, From 433b2182271529b722d102ff64a089dcd3989547 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 21 Dec 2021 18:29:27 +0100 Subject: [PATCH 4/6] added new GNSS mux select pin --- bsp_q7s/boardconfig/busConf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp_q7s/boardconfig/busConf.h b/bsp_q7s/boardconfig/busConf.h index 354dc263..34516fa6 100644 --- a/bsp_q7s/boardconfig/busConf.h +++ b/bsp_q7s/boardconfig/busConf.h @@ -54,7 +54,7 @@ namespace gpioNames { static constexpr char EN_RW_2[] = "enable_rw_2"; static constexpr char EN_RW_3[] = "enable_rw_3"; static constexpr char EN_RW_4[] = "enable_rw_4"; - static constexpr char SPI_MUX_SELECT[] = "spi_mux_select"; + static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select"; static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select"; static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0"; static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0"; From 27c011413a4b9d8553fd06b506aff6a6e495bed0 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 22 Dec 2021 15:26:32 +0100 Subject: [PATCH 5/6] fsfw update --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index e5b568bc..2506af27 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e5b568bc2b0b819bfb5c9dc90026d534852df4ff +Subproject commit 2506af27ed84585c64df2679b0c6a3c969f31941 From 24ee4cb7f5c50d6988b675ba60dce876e174beca Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 2 Jan 2022 10:39:40 +0100 Subject: [PATCH 6/6] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index 2ecc4de0..242c0e48 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 2ecc4de0223f3772627a002a6486c356ab6f5cd2 +Subproject commit 242c0e48a9bbcb1039dec6a2b6abba52e826870e