Well this error still makes me laugh because it's so stupid :)
I was planning to use PB4 as an output PP to pull up my USB D+ line. after some time trying to understand why it was not working I just realized that PB4 initial function is not GPIO but JTAG port.
I decided to remap it so that I can use the PB4 DIO.
Unfortunately, Copy / pasting some code just had me remap SWD which is the interface I use for debug on my homemade board. Its like cutting the branch on which you sit.
Anyways, now keil will say that there is a SWD commucation error (of course), thus I cannot flash it again to remove this code. This code is in the first steps of main so it will be executed very shortly after powering up tthe board, making it instantly unusable :)
I was wondering if there was a way to reset this eventually, like maybe erase the flash or if i need to trash my board ? :)
Thanks for your suggestions.