Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) IRAM_ATTR in ESP32 Version 3.0.4 (Read 1237 times)
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
IRAM_ATTR in ESP32 Version 3.0.4
Aug 8th, 2024 at 1:41pm
Print Post  
Hi,

after I installed version 3.0.4 for the ESP32 board, intellisense no longer recognizes the definition for IRAM_ATTR. This macro is in 
.... sp32??\include\esp_common\include\esp_attr.h. (??: S2, S3, C3, etc.). Somehow this file is not included. However, the compiler recognizes the file and integrates it correctly.
When compiling, a file with the name "nul.d" is generated in the build directory (this name is poorly chosen, "nul" is a reserved device name, you have to rename it to open it). This file contains a list of all included files. It contains the "esp-attr.h". (after upgrading to the newest VM version this file is no longer generated, a great pity)

Intellisense does not recognize the type "hw_timer_t". This is defined in the file ", but is linked to the condition "#if SOC_GPTIMER_SUPPORTED". Intellisense does not find a definition for "SOC_GPTIMER_SUPPORTED". Obviously a definition or an included file is missing here.

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #1 - Aug 8th, 2024 at 2:11pm
Print Post  
Path to timer is: C:... \arduino15\packages\esp32\hardware\esp32\3.0.4\cores\esp32\esp32-hal-timer.h
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #2 - Aug 8th, 2024 at 3:56pm
Print Post  
Thanks for the report.

Can you try closing the solution, and then deleting the ".vs" folder, and reopening the solution, and running the build again?

Both the IRAM_ATTR and hw_timer_t attributes are recognised by Intellisense on the same board package version and vMicro version for me currently.
  
Back to top
IP Logged
 
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #3 - Aug 9th, 2024 at 8:32am
Print Post  
Thanks for your hints. Deleting the .vs, .vm and the temp folders did not help.

I created a new project. There IRAM_ATTR and hw_timer_t is well known.


The problem was with an old project that was developed with the 2.0.14 version of the board library. Maybe there are some not compatible parts in the vcxproj file that cause the problem.

I will create a new porject and copy the source files manually to the new prject.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #4 - Aug 9th, 2024 at 8:52am
Print Post  
Is the old project still in the old format (i.e. doesn't display "(Arduino)" after the project name in Solution Explorer)?

If so it can be converted to use the new Intellisense System which is the default for new projects:
https://www.visualmicro.com/page/Upgraded-Intellisense-System-in-Visual-Micro.as...
  
Back to top
IP Logged
 
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #5 - Aug 9th, 2024 at 10:50am
Print Post  
Thank you! That solved the problem.
  
Back to top
 
IP Logged
 
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #6 - Aug 9th, 2024 at 11:14am
Print Post  
There is another problem when using IRAM_ATTR. Line number are wrong. Compiler error messages point to wrong lines. I wrote a small program to show the problem.

When function "func" gets the IRAM_ATTR line numbers in the generated cpp files are wrong. 'const int c = 5;' is on line # 7. Line # 10 is false. Without IRAM_ATTR the lines are correct.


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Red Baron
Member
***
Offline


Posts: 112
Location: Germany
Joined: Jul 29th, 2015
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #7 - Aug 9th, 2024 at 11:15am
Print Post  
correct line number without IRAM_ATTR
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2505
Joined: Feb 13th, 2019
Re: IRAM_ATTR in ESP32 Version 3.0.4
Reply #8 - Aug 9th, 2024 at 11:29am
Print Post  
Thanks for the updates, and glad the Intellisense is working as expected.

We will investigate the line numbers as a separate issue.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint