2016-09-22 03:51 AM
Hi all;
I am trying to comunicate with an external flash memory with my STM32F429. I can see my signals in the oscilloscope . I see how my microcontroler starts the clock and write to the bus but the NSS signal do not change. It is always at LOW level. This is a problem with this flash beacuse it uses NSS signal to sincronice data. I have configure the SPI5 chanel with the following code: hspi5.Instance = SPI5; hspi5.Init.Mode = SPI_MODE_MASTER; hspi5.Init.Direction = SPI_DIRECTION_2LINES; hspi5.Init.DataSize = SPI_DATASIZE_8BIT; hspi5.Init.CLKPolarity = SPI_POLARITY_LOW; hspi5.Init.CLKPhase = SPI_PHASE_1EDGE; hspi5.Init.NSS = SPI_NSS_HARD_OUTPUT; hspi5.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_128; hspi5.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi5.Init.TIMode = SPI_TIMODE_DISABLE; hspi5.Init.CRCCalculation = SPI_CRCCALCULATION_ENABLE; hspi5.Init.CRCPolynomial = 7; if (HAL_SPI_Init(&hspi5) != HAL_OK) I understand that if I set NSS as a Hardware Output SPI peripheal is going to manage it correctly but it ramains in LOW state. I wanto to see the change from HIG to LOW state so the flash start to read or write into the com lines. Could anybody help me?? I repeat that te SPI is working but if there is not edge in the NSS bit. #!spi-!stm32f429-!externalflashSolved! Go to Solution.
2016-09-22 05:19 AM
Hi jzotes,
The reference manual says that: ''NSS output enabled (SSM = 0, SSOE = 1)This configuration is used only when the device operates in master mode. TheNSS signal is driven low when the master starts the communication and is keptlow until the SPI is disabled. ''You may assign NSS as GPIO CS, will resolve this issue.Regards2016-09-22 05:19 AM
Hi jzotes,
The reference manual says that: ''NSS output enabled (SSM = 0, SSOE = 1)This configuration is used only when the device operates in master mode. TheNSS signal is driven low when the master starts the communication and is keptlow until the SPI is disabled. ''You may assign NSS as GPIO CS, will resolve this issue.Regards2016-09-22 08:06 AM
Thanks for your reply. I have disabled de NSS signal and configure that pin as GPIO. The device is talking with my STM32 without problems. Thank you very much.