Question
Pointers and HAL libs => HardFault?
I'm having a problem that I don't understand why it happens.
I am using STM32CUBEIDE (updated).
Each time the code below runs, the PC jumps to "HardFault_Handler". But I can't understand what the problem is ...
uint8_t buff_cfg[10] =
{ 0 };
buff_cfg[0] = 1;
buff_cfg[1] = 2;
buff_cfg[2] = 3;
buff_cfg[3] = 4;
HAL_SPI_Transmit(&hspi1, &buff_cfg[1], 2, SPI_TIMEOUT);If I don't reference the buffer pos, the code runs smoothly, and the data is correctly delivered by SPI
uint8_t buff_cfg[10] =
{ 0 };
buff_cfg[0] = 1;
buff_cfg[1] = 2;
buff_cfg[2] = 3;
buff_cfg[3] = 4;
HAL_SPI_Transmit(&hspi1, buff_cfg, 2, SPI_TIMEOUT);This situation is not making any sense to me ...
Thanks for your help!