AnsweredAssumed Answered

STM32 UART stops receiving after writing w. SPI to FRAM 

Question asked by Stefan Meyre on Dec 4, 2017
Latest reply on Jan 2, 2018 by Matthew Staben

Hello everybody,

I do use UART on a STM32F405 just fine (receiving and transmitting).

(while (HAL_UART_Receive_DMA(&huart4, receiveBuffer, UARTRECEIVEDBUFFERSIZE) != HAL_OK);).

Now I added an external FRAM (FM25V02A) to my circuit and use SPI to read and write to it. Reading works fine. But after writing to the FRAM (transmit completes, data is stored away) the UART does no longer receive data !? The UART however still transmits data like before.

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {...}

The interrupt callback is not going to be fired anymore.

This is how I do write to the FRAM.

opcodeWREN[0] = 0b00000110; opcodeWRITE[0] = 0b00000010;  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_RESET); //chip select HAL_SPI_Transmit(&hspi2, opcodeWREN,1,5); HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_SET);  HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_RESET); HAL_SPI_Transmit(&hspi2, opcodeWRITE,1,5); HAL_SPI_Transmit(&hspi2, sendFRAMBufferByte,240,5); //transmitting 240byte of data HAL_GPIO_WritePin(GPIOC, GPIO_PIN_1, GPIO_PIN_SET);

I did have the same problem writing with I2C to an EEPROM.

Whats going on? Any ideas what I should look at? Thanks! Stefan