Solve the prompt "Browse information of one or more files is not available: xxx\Source\system_gd32f20x.c" problem

Today I would like to share a problem that gave me a headache all afternoon, because I started to report various errors after adding a header file to the project.

Because I didn’t know why my keil might have installed a new one before, so the header file path of the previous project changed, and then the compilation started to report an error. The error message is:

gd32f20x_libopt.h(43): error:  #5: cannot open source input file "RTE_Components.h": No such file or directory

Then I added the path of the RTE_Components.h header file to the project, and after recompilation, I was prompted with the following errors:
What USART0 is not defined, but isn’t this system variable already defined in the system file?

Handware\Usart2.c(100): error:  #20: identifier "USART0" is undefined

There are also error messages such as various source file information that cannot be browsed:

Browse information of one or more files is not available:
.\Handware\Usart.c
.\CMSIS\GD\GD32F20x\Source\system_gd32f20x.c

Later, I found out that the reason was that I added the path of the RTE_Components.h file to the project, and the system that prompted me to lack this file was also the system, and the reason for the prompt RTE_Components.h was that I did not add some header file paths about cm3 to the project. Path, and various errors are caused by adding the RTE_Components.h header file. The code of the header file is as follows: that is, the gd32f20x.h file is defined with a macro.

#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H


/*
 * Define the Device Header File: 
 */
#define CMSIS_device_header "gd32f20x.h"


#endif /* RTE_COMPONENTS_H */

So if some friends also encounter the above errors, maybe you can refer to my experience and delete the RTE_Components.h header file~

My level is limited, the above information is for learning reference only, if there is any error or inappropriateness, please advise.
In addition, it is not easy to create, please do not plagiarize, if it is helpful to everyone, I hope you can like it and collect it, thank you~

Guess you like

Origin blog.csdn.net/OMGMac/article/details/130416273