STM32F4 chip select problem
Hello,
I am having problems with SPI connectivity. My problem seems to be the chip select pin that is controlled using GPIO HAL libraries. Chip select is pulled low for way longer than it is supposed to and therefore I cannot read the sent data properly.
I am aware of the available NSS function, however I cannot use it in my case. The chip select control must be done using GPIO toggling.
Would it be possible in any way to shorten the active time of chip select pin so it would be much more synchronized with the beggining and end of SPI transmission? In other words, can I come closer to the speed that would be provided by NSS pin?
I have attached a photo from my logic analyzer view. My board is NUCLEO-F401RE.
This is code for sending data via SPI:
void send_data(uint8_t *address)
{
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_RESET); // Pull chip select low
HAL_SPI_Transmit(&hspi3, address, 1, 5);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_SET); // Pull chip select high
}
