diff --git a/os/hal/platforms/Posix/serial_lld.c b/os/hal/platforms/Posix/serial_lld.c index 28cd19421..cfe6792ca 100644 --- a/os/hal/platforms/Posix/serial_lld.c +++ b/os/hal/platforms/Posix/serial_lld.c @@ -64,6 +64,9 @@ static u_long nb = 1; static void init(SerialDriver *sdp, uint16_t port) { struct sockaddr_in sad; struct protoent *prtp; + int sockval = 1; + socklen_t socklen = sizeof(sockval); + if ((prtp = getprotobyname("tcp")) == NULL) { printf("%s: Error mapping protocol name to protocol number\n", sdp->com_name); @@ -76,6 +79,9 @@ static void init(SerialDriver *sdp, uint16_t port) { goto abort; } + + setsockopt(sdp->com_listen, SOL_SOCKET, SO_REUSEADDR, &sockval, socklen); + if (ioctl(sdp->com_listen, FIONBIO, &nb) != 0) { printf("%s: Unable to setup non blocking mode on socket\n", sdp->com_name); goto abort; diff --git a/readme.txt b/readme.txt index 6af7fcc65..626419d25 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,7 @@ ***************************************************************************** *** 2.5.2 *** +- FIX: Fixed patch to allow simulator to be restarted quicker (bug #398). - FIX: Fixed blkDisconnect macro typo (bug #397). - FIX: Fixed STM32 SPI (V2) driver hangs (bug 3608241). - FIX: Fixed fixed I2C malfunction after fixing bug 3607518 (bug 3607549)