Solve the first run error problem
I recently purchased a WIFI module online. The example is written using the HAL library. When compiling for the first time, USER\stm32f4xx.h(193): error: #35: #error directive: "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)", locate the error position as
#error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
means "Please select first the application The STM32F4xx target device used in the program (in the STM32F4xx .h file)", in the stm32f4xx.h file (the file where the error is reported), find the position shown in the figure, mine starts from line 83.
The contents of these comments correspond to your MCU model. For example, I am using stm32f429 MCU, just cancel the comment on the corresponding line.
After compiling, it is solved perfectly.
keil5 download button turns gray
After the error was resolved, a new problem was discovered, and the download button of keil5 became gray. This was the first time I met, so I had to continue to ask Du Niang. I consulted some great gods' solutions on the Internet and found that there was no ending problem. Finally found a solution to the problem.
Open the magic wand, under the Utilities tab, first uncheck Use Debug Deriver.
Then choose the emulator you use. I used CMSIS-DAP, and finally checked Use Debug Deriver and clicked OK. At this time, I found that the download button was restored miraculously.
If my method does not solve the problem of graying out the download button, you can also refer to the blog post:
https://www.cnblogs.com/renmeditation/articles/9975268.html