maintainability: openblt text status #6981

only:proteus_f7
This commit is contained in:
Andrey 2024-10-11 20:00:03 -04:00
parent c7494d25c6
commit 0e4cba7e83
4 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,17 @@ void Rs232TransmitPacket(blt_int8u *data, blt_int8u len)
} }
} /*** end of Rs232TransmitPacket ***/ } /*** end of Rs232TransmitPacket ***/
PUBLIC_API_WEAK void openBltUnexpectedByte(blt_int8u firstByte) {
#if defined(OPEN_BLT_TEST_COMMAND)
// 'z' is right at the end of 128 ascii range
static_assert(BOOT_COM_RS232_RX_MAX_DATA < 'z');
if (firstByte == 'z') {
const char * bltTest = "openblt\n";
chnWriteTimeout(&SDU1, (const uint8_t*)bltTest, sizeof(bltTest), TIME_INFINITE);
}
#endif // OPEN_BLT_TEST_COMMAND
}
/************************************************************************************//** /************************************************************************************//**
** \brief Receives a communication interface packet if one is present. ** \brief Receives a communication interface packet if one is present.
** \param data Pointer to byte array where the data is to be stored. ** \param data Pointer to byte array where the data is to be stored.
@ -80,6 +91,8 @@ blt_bool Rs232ReceivePacket(blt_int8u *data, blt_int8u *len)
xcpCtoRxLength = 0; xcpCtoRxLength = 0;
/* indicate that a cto packet is being received */ /* indicate that a cto packet is being received */
xcpCtoRxInProgress = BLT_TRUE; xcpCtoRxInProgress = BLT_TRUE;
} else {
openBltUnexpectedByte(xcpCtoReqPacket[0]);
} }
} }
} }

View File

@ -16,6 +16,9 @@ DDEFS += -DEFI_MAX_31855=TRUE
DDEFS += -DSTM32_SPI_USE_SPI5=TRUE DDEFS += -DSTM32_SPI_USE_SPI5=TRUE
DDEFS += -DEFI_TCU=TRUE DDEFS += -DEFI_TCU=TRUE
DDEFS += -DBOOT_COM_RS232_RX_MAX_DATA=120
DDEFS += -DOPEN_BLT_TEST_COMMAND=1
# let's start asap # let's start asap
DDEFS += -DBOOT_BACKDOOR_ENTRY_TIMEOUT_MS=0 DDEFS += -DBOOT_BACKDOOR_ENTRY_TIMEOUT_MS=0

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
cd ../../.. && bash bin/compile.sh config/boards/proteus/meta-info-proteus_f7.env bootloader

View File

@ -114,7 +114,9 @@
/** \brief Configure number of bytes in the target->host data packet. */ /** \brief Configure number of bytes in the target->host data packet. */
#define BOOT_COM_RS232_TX_MAX_DATA (200) #define BOOT_COM_RS232_TX_MAX_DATA (200)
/** \brief Configure number of bytes in the host->target data packet. */ /** \brief Configure number of bytes in the host->target data packet. */
#ifndef BOOT_COM_RS232_RX_MAX_DATA
#define BOOT_COM_RS232_RX_MAX_DATA (200) #define BOOT_COM_RS232_RX_MAX_DATA (200)
#endif
/** only USB supported, this is ignored but required */ /** only USB supported, this is ignored but required */
#define BOOT_COM_RS232_CHANNEL_INDEX 0 #define BOOT_COM_RS232_CHANNEL_INDEX 0