Uart receiver pb
i have established communication with a BLDC (Brushless DC) controller. Initially, i send a message to the controller using the function void sendParameter(uint8_t parameter). Following this transmission, the BLDC controller is expected to respond with a frame. Although the transmission process appears to be functioning correctly, the receiver is not operating as expected. i have confirmed this issue using a logic analyzer.
UART_HandleTypeDef huart1;
uint8_t buffer[10];
uint8_t senddata[4] = {0x66, 0x42, 0x00, 0xA8};
uint8_t transmitAllowed = 1;
-----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_USART1_UART_Init(void)
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_UART_Receive_IT(&huart1, buffer, 1);
}
void sendParameter(uint8_t parameter)
{
HAL_UART_Transmit_IT(&huart1, senddata, 4);
HAL_Delay(100);
}
*/
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USART1_UART_Init();
HAL_UART_Receive_IT(&huart1, buffer, 10);
while (1)
{
readParameter(0x42);
}
