HAL_SPI_Transmit Timeout problem
I am trying to implement a driver for an EEPROM. I created as follows:
typedef struct
{
uint16_t address;
uint16_t size;
uint8_t *data;
} test_t;
And create a structure array as:
test_t test[] = {{0x0000, 50, NULL}, {0x00AB, 70, NULL}, {0x0AB0, 98, NULL}, {0x7F0C, 64, NULL}, {0x24AB, 200, NULL}}
I create 5 uint8_t arrays give their address to the pointers inside the structure as:
// Assume I create 5 arrays via a function here
test[0].data = array1;
test[1].data = array2;
.
.
.
Now, I am trying my drivers with this test array,
for(uint8_t var = 0; var 5; ++var)
{
write_function(test[var].address, test[var].data, test[var].size);
read_function(test[var].address, test[var].size, output_array);
}
Assume output is defined somewhere else in the main function and is big enough to hold the data. My intention is that I wanna look at the value of the output_array so that I can deduce whether my driver works or not. In debug mode, if I go over the code step-by-step by using step over button, then eveything works perfectly. However, if I try to use resume button to download the whole code in one shot, then the code gets stucked in HardFault_Handler function, I can understand from the STM32CubeIDE that in HAL_SPI_Transmit function, it is due to the timeout. What is the problem and how can I solve it?
Thanks in advance for your comments.
