feat: Send ACK before jumping to bootloader

- Added functionality to send an acknowledgment (ACK) before executing the bootloader jump.
- Ensures the sender receives confirmation before transitioning to the bootloader.
stable
Rakshita 2025-03-10 18:38:24 +05:30
parent dfdb8d0c64
commit 2e4b44259a
1 changed files with 13 additions and 0 deletions

View File

@ -579,6 +579,19 @@ void vRTE_ProcessUartData(void)
if(l_eRetCode > -1) if(l_eRetCode > -1)
{ {
if( (l_u32Id == 0x16) && (g_pu8UartBuffer[ecuUART_PKT_HEADER_u8] == 'V') && \
(g_pu8UartBuffer[ecuUART_PKT_HEADER_u8 + 1] == 'E') &&(g_pu8UartBuffer[ecuUART_PKT_HEADER_u8 + 2] == 'C') && \
(g_pu8UartBuffer[ecuUART_PKT_HEADER_u8 + 3] == 'I') && (g_pu8UartBuffer[ecuUART_PKT_HEADER_u8 + 4] == 'O') && \
(g_pu8UartBuffer[ecuUART_PKT_HEADER_u8 + 5] == 'T'))
{
uint32_t u32Id = 0x36; // ID to pass
uint8_t pu8Data[1] = {0x79}; // Data array containing 0x79
uint8_t u8Len = sizeof(pu8Data); // Length of data array
iECU_UartInitiateTransmit(&g_xUartHandle, u32Id, pu8Data, u8Len);
iECU_UartInitiateTransmit(&g_xUartHandle, 0x8, NULL, 0);
vMCAL_softReset();
}
if(l_eRetCode > 0 && l_u32Id == 0x00) if(l_eRetCode > 0 && l_u32Id == 0x00)
{ {
uint32_t l_u32Baudrate = 0; uint32_t l_u32Baudrate = 0;