when i run Josepino's code, on the same board with the same crystal, i do not get any error.
This is why I think it is a fault in the software...