pin fixes for ACS board
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2021-08-20 14:50:40 +02:00
parent 23782dc2fa
commit 6ecd4ec2f3
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
5 changed files with 91 additions and 78 deletions

View File

@ -15,14 +15,15 @@ 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 GPIO_GYRO_ADIS_CHIP[] = "gpiochip4";
static constexpr char GPIO_ACS_BOARD_DEFAULT_CHIP[] = "gpiochip5";
static constexpr char GPIO_MGM2_LIS3_CHIP[] = "gpiochip6";
// TODO: Determine new pins, additional ADIS gyro device
static constexpr uint32_t GPIO_GYRO_0_ADIS_CS = 1;
static constexpr uint32_t GPIO_GYRO_1_L3G_CS = 7;
static constexpr uint32_t GPIO_GYRO_2_ADIS_CS = 3;
static constexpr uint32_t GPIO_GYRO_3_L3G_CS = 3;
static constexpr uint32_t GPIO_GYRO_0_ADIS_CS = 0;
static constexpr uint32_t GPIO_GYRO_1_L3G_CS = 18;
static constexpr uint32_t GPIO_GYRO_2_ADIS_CS = 2;
static constexpr uint32_t GPIO_GYRO_3_L3G_CS = 1;
static constexpr uint32_t GPIO_MGM_0_LIS3_CS = 5;
static constexpr uint32_t GPIO_MGM_1_RM3100_CS = 16;

View File

@ -5,30 +5,37 @@
#cmakedefine01 Q7S_SIMPLE_MODE
#define Q7S_SD_NONE 0
#define Q7S_SD_COLD_REDUNDANT 1
#define Q7S_SD_HOT_REDUNDANT 2
/*******************************************************************/
/** All of the following flags should be enabled for mission code */
/*******************************************************************/
//! Timers can mess up the code when debugging
//! All of this should be enabled for mission code!
/*******************************************************************/
/** Other flags */
/*******************************************************************/
#define Q7S_SD_NONE 0
#define Q7S_SD_COLD_REDUNDANT 1
#define Q7S_SD_HOT_REDUNDANT 2
// The OBSW will perform different actions to set up the SD cards depending on the flag set here
// Set to Q7S_SD_NONE: Don't do anything
// Set to Q7S_COLD_REDUNDANT: On startup, get the prefered SD card, turn it on and mount it, and
// turn off the second SD card if it is on
// Set to Q7S_HOT_REDUNDANT: On startup, turn on both SD cards and mount them
#define Q7S_SD_CARD_CONFIG Q7S_SD_COLD_REDUNDANT
#define Q7S_SD_CARD_CONFIG Q7S_SD_COLD_REDUNDANT
// Probably better if this is disabled for mission code. Convenient for development
#define Q7S_CHECK_FOR_ALREADY_RUNNING_IMG 1
#define Q7S_ADD_RTD_DEVICES 0
#define Q7S_CHECK_FOR_ALREADY_RUNNING_IMG 1
#define Q7S_ADD_RTD_DEVICES 0
/* Only one of those 2 should be enabled! */
/* Add code for ACS board */
#define OBSW_ADD_ACS_BOARD 0
// Only one of those 2 should be enabled!
#if OBSW_ADD_ACS_BOARD == 0
#define Q7S_ADD_SPI_TEST 0
#define Q7S_ADD_SPI_TEST 0
#endif
#define Q7S_ADD_SYRLINKS_HANDLER 1
#define Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST 0
#define Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST 0
namespace config {

View File

@ -1,3 +1,4 @@
#include <mission/devices/GyroADIS16507Handler.h>
#include "ObjectFactory.h"
#include "OBSWConfig.h"
#include "devConf.h"
@ -386,13 +387,13 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
GpiodRegular* gpio = nullptr;
// TODO: Determine new Gyro GPIO pins
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, q7s::GPIO_GYRO_0_ADIS_CS,
gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, q7s::GPIO_GYRO_0_ADIS_CS,
"CS_GYRO_0_ADIS", gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, q7s::GPIO_GYRO_1_L3G_CS,
"CS_GYRO_1_L3G", gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, q7s::GPIO_GYRO_2_ADIS_CS,
gpio = new GpiodRegular(q7s::GPIO_GYRO_ADIS_CHIP, q7s::GPIO_GYRO_2_ADIS_CS,
"CS_GYRO_2_ADIS", gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
gpio = new GpiodRegular(q7s::GPIO_ACS_BOARD_DEFAULT_CHIP, q7s::GPIO_GYRO_3_L3G_CS,
@ -421,49 +422,61 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
objects::SPI_COM_IF, spiCookie);
mgmLis3Handler->setStartUpImmediately();
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler2 = new MGMHandlerLIS3MDL(objects::MGM_2_LIS3_HANDLER,
objects::SPI_COM_IF, spiCookie);
mgmLis3Handler2->setStartUpImmediately();
spiCookie = new SpiCookie(addresses::MGM_1_RM3100, gpioIds::MGM_1_RM3100_CS, spiDev,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
auto mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_1_RM3100_HANDLER,
objects::SPI_COM_IF, spiCookie);
mgmRm3100Handler->setStartUpImmediately();
spiCookie = new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
auto mgmLis3Handler2 = new MGMHandlerLIS3MDL(objects::MGM_2_LIS3_HANDLER,
objects::SPI_COM_IF, spiCookie);
mgmLis3Handler2->setStartUpImmediately();
spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev,
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
mgmRm3100Handler = new MGMHandlerRM3100(objects::MGM_3_RM3100_HANDLER,
objects::SPI_COM_IF, spiCookie);
mgmRm3100Handler->setStartUpImmediately();
//TODO: Adis Gyro (Gyro 0 Side A)
// Commented until ACS board V2 in in clean room again
/* Gyro 1 Side A */
// spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev,
// L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
// auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
// spiCookie);
// gyroL3gHandler->setStartUpImmediately();
//
// /* Gyro 2 Side B */
// spiCookie = new SpiCookie(addresses::GYRO_2_L3G, gpioIds::GYRO_2_L3G_CS, spiDev,
// L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
// gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_2_L3G_HANDLER, objects::SPI_COM_IF,
// spiCookie);
// gyroL3gHandler->setStartUpImmediately();
// Gyro 0 Side A
spiCookie = new SpiCookie(addresses::GYRO_0_ADIS, gpioIds::GYRO_0_ADIS_CS, spiDev,
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
spi::DEFAULT_ADIS16507_SPEED);
auto adisHandler = new GyroADIS16507Handler(objects::GYRO_0_ADIS_HANDLER,
objects::SPI_COM_IF, spiCookie);
adisHandler->setStartUpImmediately();
// Gyro 1 Side A
spiCookie = new SpiCookie(addresses::GYRO_1_L3G, gpioIds::GYRO_1_L3G_CS, spiDev,
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER,
objects::SPI_COM_IF, spiCookie);
gyroL3gHandler->setStartUpImmediately();
// Gyro 2 Side B
spiCookie = new SpiCookie(addresses::GYRO_2_ADIS, gpioIds::GYRO_2_ADIS_CS, spiDev,
ADIS16507::MAXIMUM_REPLY_SIZE, spi::DEFAULT_ADIS16507_MODE,
spi::DEFAULT_ADIS16507_SPEED);
adisHandler = new GyroADIS16507Handler(objects::GYRO_2_ADIS_HANDLER,
objects::SPI_COM_IF, spiCookie);
adisHandler->setStartUpImmediately();
// Gyro 3 Side B
spiCookie = new SpiCookie(addresses::GYRO_3_L3G, gpioIds::GYRO_3_L3G_CS, spiDev,
L3GD20H::MAX_BUFFER_SIZE, spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER,
objects::SPI_COM_IF, spiCookie);
gyroL3gHandler->setStartUpImmediately();
auto uartCookieGps0 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_0_DEV,
UartModes::CANONICAL, 9600, uart::HYPERION_GPS_REPLY_MAX_BUFFER);
auto uartCookieGps1 = new UartCookie(objects::GPS0_HANDLER, q7s::UART_GNSS_1_DEV,
auto uartCookieGps1 = new UartCookie(objects::GPS1_HANDLER, q7s::UART_GNSS_1_DEV,
UartModes::CANONICAL, 9600, uart::HYPERION_GPS_REPLY_MAX_BUFFER);
uartCookieGps1->setToFlushInput(true);
uartCookieGps1->setReadCycles(6);
new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookieGps0);
new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, uartCookieGps1);
new GPSHyperionHandler(objects::GPS0_HANDLER, objects::UART_COM_IF, uartCookieGps0, true);
new GPSHyperionHandler(objects::GPS1_HANDLER, objects::UART_COM_IF, uartCookieGps1, true);
}
void ObjectFactory::createHeaterComponents() {

View File

@ -36,6 +36,8 @@ debugging. */
#define OBSW_ADD_STAR_TRACKER 0
#define OBSW_ADD_PLOC_SUPERVISOR 0
#define OBSW_ADD_PLOC_MPSOC 0
#define OBSW_ADD_SUN_SENSORS 0
#define OBSW_ADD_ACS_BOARD 0
/*******************************************************************/
/** All of the following flags should be disabled for mission code */

View File

@ -520,6 +520,7 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
// Length of a communication cycle
uint32_t length = thisSequence->getPeriodMs();
static_cast<void>(length);
#if OBSW_ADD_PLOC_MPSOC == 1
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0,
@ -550,56 +551,45 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
#if Q7S_ADD_SYRLINKS_HANDLER == 1
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
#endif
#if OBSW_ADD_ACS_BOARD == 1
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
#endif
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
#if OBSW_ADD_ACS_BOARD == 1
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
#endif
#if Q7S_ADD_SYRLINKS_HANDLER == 1
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.4,
DeviceHandlerIF::GET_WRITE);
#endif
#if OBSW_ADD_ACS_BOARD == 1
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.4,
DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.4,
DeviceHandlerIF::GET_WRITE);
#endif
#if Q7S_ADD_SYRLINKS_HANDLER == 1
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.6,
DeviceHandlerIF::SEND_READ);
#endif
#if OBSW_ADD_ACS_BOARD == 1
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.6,
DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.6,
DeviceHandlerIF::SEND_READ);
#endif
#if Q7S_ADD_SYRLINKS_HANDLER == 1
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.8,
DeviceHandlerIF::GET_READ);
#endif
#if OBSW_ADD_ACS_BOARD == 1
#if OBSW_ADD_GPS_0 == 1
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.4,
DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.6,
DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GPS0_HANDLER, length * 0.8,
DeviceHandlerIF::GET_READ);
#endif /* OBSW_ADD_GPS_0 == 1 */
#if OBSW_ADD_GPS_1 == 1
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0,
DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.2,
DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.4,
DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.6,
DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::GPS1_HANDLER, length * 0.8,
DeviceHandlerIF::GET_READ);
#endif
#endif /* OBSW_ADD_GPS_1 == 1 */
#endif /* OBSW_ADD_ACS_BOARD == 1 */
#if OBSW_ADD_STAR_TRACKER == 1
thisSequence->addSlot(objects::START_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);