stm32mp: stm32prog: add timeout in stm32prog_serial_get_buffer
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Tue, 18 May 2021 13:12:05 +0000 (15:12 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 18 Jun 2021 08:09:41 +0000 (10:09 +0200)
commitd4358a648c5a785e708dbf23f0a67290ac22cf70
treee4a64e37065bded803869268df2727a183712588
parent5f14e2fe9d70afac8aa6e87319e826c7b9daa489
stm32mp: stm32prog: add timeout in stm32prog_serial_get_buffer

Handle timeout in stm32prog_serial_get_buffer to sent NACK
to STM32CubeProgrammer when the buffer is not fully received.

This patch avoids to reach the STM32CubeProgrammer timeout and
the associated unrecoverable error.

  Timeout error occurred while waiting for acknowledgment.

  Error: Write Operation fails at packet number 4165 at address 0x1044FF

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_serial.c