Thanks for the reply.
I managed to find the cause of the problem and it was rather embarrassing. The jumper that was included with the board was originally placed between GND and pin D2 but by mistake, after removing it at some point, I put it back between GND and pin NRST. I removed the jumper and the OpenOCD test succeeds now. I can also connect successfully with ST-LINK utility.
So after a whole day wasted I can now begin what I set out to do in the first place. 🙂
BR
Daniel