UART-1 working code reads NULL
Hi clive
I have interfaced UART DATA device(sender) and NUCLEOF401RE(receiver)
I have set the proper BAUD RATE 115200
I am using UART-1 to receive data
I generated the code in the IDE and first tested for transmit functionality and it works fine
I took RX TX and GND from F401RE and connect to USB to TTY converter and was able to send the data to the terminal
I was confident that transmit is working fine from the generated code
NUCLEOF401RE TX(PA9)D8 GND RX(PA10)D6 ---------TRANSMIT---------> UART TO TTY TX RX GND worked fine
This above experiment was done to make sure generated codes are proper
Now My goal is to receive the data from my Data Device UART to F401RE
I connected the TX RX PINS OF DATA DEVICE ------------> NUCLEOF401RE TX(PA9)D8 GND RX(PA10)D6
Following is the code written
I see that the voltage level in the multimeter of UART signal from data device its around 3.6 V
I think the voltage level should not be an issue as i was able to receive the data on arduino as well using serial read api
That makes me think pin voltage level in arduino and arduino shield voltage level are fine Attached the screen shot
I am not able to receive the data and its empty
I have configured the baud rate 115200
I am not sure what is the exact function to receive the data and test this
I have the follwoing code
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
char deepak[10]="testing";
uint8_t receive_testing[10]={0};
/* Initialize all configured peripherals */
MX_GPIO_Init();
//MX_USART2_UART_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
// HAL_UART_Transmit(&huart1,"Deepakprint",10,100);
// HAL_UART_Transmit(&huart1,deepak,10,100);
// HAL_UART_Transmit(&huart1,"ABHIJITH",10,100);
int r=0;
for(r=0;r<100;r++)
{
//HAL_UART_Transmit_IT(&huart1,"deepak",10);
HAL_UART_Receive_IT(&huart1,receive_testing,10);
//There are no values in the receive_testing function I did inline debugging as well the *pdata has no value
}The values in receive_testing is NULL only
Can you please help I am sure something is wrong in my program only