Hi guys
I have a weird problem that is my blackpill ( based on STM32F401 chip) is not detected after initializing the MODER register. Here's my code:
RCC->AHB1ENR |=(1<<0); //Enable GPIOA clock
GPIOA->MODER =0; //clear MODER register
GPIOA->MODER=0X555; //PA0-PA5 AS OUTPUT
Right after, I flash the board, I get the error that my blackpill is not detected ( see picture 1).The solution, I found to get my board working again is by keep pressing on BOOT0 switch and erasing the chip using stm link utility.
The weird thing, if I comment the two last lines out in my code above and flash again, my board is still working fine ( see picture 2).
I'm really lost, because the problem happens even with another blackpill I have.
Does someone have an idea what's going on?
Thanks in advance