About the gray download button in keil5 and the #error "Please select first the target STM32F4xx devic....error solution

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.
Insert picture description here
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.
Insert picture description here
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.
Insert picture description here

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.
Insert picture description here
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

https://blog.csdn.net/wuyuzun/article/details/90721736

https://blog.csdn.net/qq_22329595/article/details/79256715?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param

Guess you like

Origin blog.csdn.net/weixin_43414694/article/details/109645619