Hard fault occur during first byte receive
I am trying to receive 16bit data(at once) through SPI and transmit 8 bit data through USART.
clock frequency 16MHz.
All initialization done using STM32CubeMX. and build was successful .
but after writing following codes , control enters in Hard Fault at first byte receive.
variables declared:
uint16_t buffer_t[2];
uint8_t buffer_r[8];
uint8_t data_tx8[16];
codes written in while loop:
HAL_SPI_Receive(&hspi2,buffer_t,8,10000);
uint16_t j=buffer_t[1];
uint16_t k=buffer_t[0];
I am not able to understand why hard fault occurs here. (Same code runs properly if the code is configured only for SPI receive). I am using STM32L072 discovery kit.
thanks in advance.