Skip to content

Issue #18: ECU STM32 Implement Communication Hub#40

Open
hasslesstech wants to merge 17 commits intomainfrom
18-2-ecu-stm32-implement-network-communication
Open

Issue #18: ECU STM32 Implement Communication Hub#40
hasslesstech wants to merge 17 commits intomainfrom
18-2-ecu-stm32-implement-network-communication

Conversation

@hasslesstech
Copy link
Contributor

No description provided.

hasslesstech and others added 17 commits December 28, 2025 21:50
…num updations with included validation measures
ULog now sends messages over the wire only if it is connected, correctly
logs messages in KPIRover_Init() and does not cause hardfaults due to
overflowing the message queue.

Default task does not cause HardFault due to overflowing it's stack.

ulStorage is initialized in KPIRover_Init().

ulDatabase metadata order has been corrected.
@hasslesstech hasslesstech linked an issue Mar 12, 2026 that may be closed by this pull request
6 tasks
@AksonovSergei AksonovSergei self-assigned this Mar 13, 2026

static uint16_t crc_table[UINT8_MAX + 1];

uint16_t crc16( const unsigned char *buf, unsigned int len )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signature mismatch
crc16.h: uint16_t crc16(uint8_t const *data, size_t size);

struct ulDatabase_ParamMetadata *p = ulDatabase_getMetadata(i);

if (p == NULL)
return false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning false is by design? The function type is uint32.


bool drvUart_send(uint8_t * const buf)
{
memcpy(transmitBuffer + 1, buf, buf[0]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have out of array problem?

}

void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
on_tx_cplt();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to check for NULL

(void) osMessageQueueGet(recvQ, recvBuffer, NULL, osWaitForever);

*size = recvBuffer[0] - 1;
memcpy(buf, recvBuffer + 1, *size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here also I prefer control size. What if recvBuffer[0] == 0?

#define DRV_UART_TRANSMIT_BUFFER_SIZE 53

bool drvUart_start(void);
bool drvUart_on_rx_cplt(void (*f)(const uint8_t * const buffer));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drvUart_set_on_rx_cplt


bool drvUart_start(void);
bool drvUart_on_rx_cplt(void (*f)(const uint8_t * const buffer));
bool drvUart_on_tx_cplt(void (*f)(void));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drvUart_set_on_tx_cplt


void ProtocolHandler_init(void)
{
for (uint32_t i = 0; i < 256; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this


for ( ; ; ) {
UARTTransport_receive(recvBuffer, &recvSize);
dispatch_table[recvBuffer[0]]();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add if to check range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ECU STM32] Implement component Communication Hub

3 participants