- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[I cannot reply to https://community.cypress.com/t5/PSoC-5-3-1-MCU/We-were-unable-to-find-the-symbol-There-are-several-... from the old forum so I will create it again]
Often when I right-click a function name and select Go To Definition, it doesn't work. I get this error:
We were unable to find the symbol 'FunctionName. There are several things that can hinder symbol lookup:
- Make sure your project compiles without errors.
- Make sure your "Generated Source" has been generated (Build -> Generate Application).
- Make sure your .c files #include their corresponding header files.
The project compiles without errors, the Generated Source has been generated, and the .c files include the .h files which declare the function.
I don't understand why this works for some functions and not others.
I have to use Ctrl+Shift+F and search for the function definition manually.
Has anyone had this problem and figured it out?
For example, if I create a New Project, with the UART_Full_Duplex example, and build it, and then in main.c try to right-click on UART_PutString and Go To Definition, it produces this error. Is it a missing .h file or something?
- Labels:
-
PSoC3 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In my experience something similar to your question happened when
(1) The function is not called and optimized out by the compiler
(2) The function was defined as inline or preprocessor macro
May be trying to build the program without any optimization will let you find the function.
I tried with PSoC Creator v4.4 for CY8CKIT-059.
I could not reproduce the problem.
The following was my test today. (but in vain, though)
Build Settings
Goto Definition
UART.c
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried building it in Debug mode to disable optimization, but it still doesn't work.
--------------- Build Succeeded: 06/20/2021 09:18:08 ---------------
We were unable to find the symbol. There are several things that can hinder symbol lookup:
- Make sure your project compiles without errors.
- Make sure your "Generated Source" has been generated (Build -> Generate Application).
- Make sure your .c files #include their corresponding header files.
Reproduction:
Environment:
PSoC Creator 4.4 (4.4.0.80)
Culture: English (United States)
OS Version: Microsoft Windows NT 10.0.19043.0
CLR Version: 4.0.30319.42000
- Create New Project
- Target device CY8C3446LTI-073
- Code example
- UART_Full_Duplex
- Create in default location C:\Users\USERNAME\Documents\PSoC Creator\
- Workspace and Project name UART_Full_Duplex_deleteme
- Debug mode
- Assign LED to pin 1, SW2 to pin 2
- Build Succeeded: Flash used: 5634 of 65536 bytes (8.6%). SRAM used: 154 of 8192 bytes (1.9%).
- Open main.c
- Scroll down to a function, like "LED_Write(LED_OFF); /* Clear LED */"
- Right-click, Go To Definition
- Gives the "unable to find the symbol" error.
On the other hand:
- Create New Project
- Target device CY8C3446LTI-073
- Code example
- USB_UART
- Create in default location C:\Users\USERNAME\Documents\PSoC Creator\
- Workspace and Project name USBFS_UART_deleteme
- Debug mode
- Set PLL_OUT to 49.8 MHz
- Assign LCD Port[0] to pin 34
- Build Succeeded: Flash used: 18131 of 65536 bytes (27.7%). SRAM used: 494 of 8192 bytes (6.0%).
- Open main.c
- Scroll down to a function, like "USBUART_CDC_Init();"
- Right-click, Go To Definition
- It works, showing the definition in USBUART_cdc.c
So why does one project work and the other doesn't?
I didn't see that you had posted an example project. I downloaded that, built it, and it succeeded, and then I can right-click on a function and it goes to the definition. I really don't understand why it works in your project but not mine. Because the chip is different? That's the only difference, right?
Oh your chip is PSoC5, that could make a difference. CortexM3 with ARM_GCC_541 vs DP8051_Keil_951. Maybe there's something missing in the PSoC3 header files?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
> Because the chip is different? That's the only difference, right?
This can be the main reason.
For PSoC 4, 5LP, 6, GNU C is being used,.
But for PSoC 3, which uses 8051 (8bit) CPU core,
ARM MDK Keil is being used as the toolchain.
Anyway, So I tried with CY8C3446LTI-073 as device.
And, yes, I could reproduce your problem!
I have been tweaking for a few hours but have not found any cure, yet.
But one thing I noticed was if I select some register definition, such as
UART_RXSTATUS_REG
and chose "Go to definition", PSoC Creator can locate the definition of the register definition in UART.h.
So the including/referencing must be working.
Then why we can not locate "UART_PutString()" ?
I'm sorry, but I don't have a good answer.
Hopefully someone from Infineon/Cypress (or from ARM) may have an answer.
By the way, I just added a function foo() in main.c something like
int foo(int a)
{
return( a - 1) ;
}
And called it just before the first printf()
int main()
{
uint8 button = 0u;
uint8 buttonPre = 0u;
LED_Write(LED_OFF); /* Clear LED */
UART_Start(); /* Start communication component */
UART_PutString("UART Full Duplex and printf() support Code Example Project \r\n");
#if(INTERRUPT_CODE_ENABLED == ENABLED)
isr_rx_StartEx(RxIsr);
#endif /* INTERRUPT_CODE_ENABLED == ENABLED */
CyGlobalIntEnable; /* Enable global interrupts. */
#if(UART_PRINTF_ENABLED == ENABLED)
{
uint32 i = 444444444u;
float f = 55.55555f;
i = foo(i) ;
And I selected foo and tried "Go To Definition" and got the same error.
Even in the same source file, "Go To Definition" does not find the function!
I would rather call this a bug, if I may.
moto
- Tags:
- not a solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for trying to find the cause. This has been bothering me for years.
Now I'm getting Inline Diagnostics errors for "use of undefined identifier" even though the project builds fine.
I combined the USBFS_UART and UART_Full_Duplex examples to make a USB-UART bridge, and now "Go To Definition" works for the USBUART_… functions, but not for the UART_… functions, even in the same main.c file.
So maybe this is an issue with the component itself? Since the problem carried over even when copying the code from one project to another, and only applies to functions associated with one component and not the other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It can't even find the definition of a function that's defined in the same file!