However due to recent linker script changes the maximum_ram_size value is used in the build system to calculate the start stack pointer. By using a value of 256Kbyte, this will point at 0x2000000 + 256*1024, at which there is no RAM, the board will instantly crash on startup.
board_upload.maximum_ram_size = 196608
to the platformio.ini.
EDIT: Fix board_build to board_upload, facepalm.
This corrects the stackpointer back down to where there is RAM.
Then there’s a problem even before you get to the uploading part.
I overlooked this earlier, but you musn’t have that option in. The upload happens via USB (the STLink), not via a COM port.
If there is a failed.txt then the connections between the STLink and the MCU might have been disconnected. There are 2 jumpers for the SWD connections, one voltage selection jumper (E5V vs U5V) and one IDD jumper (supplies the entire current to the MCU). Make sure these are all set. When you re-plug the Nucleo into the PC, the LD1 LED must go green. See docs chapter 6.3.3 and 6.4.2.