VS Arduino
Visual Micro >> Installation & Troubleshooting >> Build error: a15 cannot be used in asm here (SOLVED core does not support no optimization)
https://www.visualmicro.com/forums/YaBB.pl?num=1590249146

Message started by Arnaud on May 23rd, 2020 at 3:52pm

Title: Build error: a15 cannot be used in asm here (SOLVED core does not support no optimization)
Post by Arnaud on May 23rd, 2020 at 3:52pm
Hi everybody,

New user here.

I am using an esp8266 Wemos D1 mini pro.
My desktop environment is Win 10 64.
My Arduino version is 1.8.12.


I got the error in the title with my Arduino sketch when trying to debug. It compiled fine in Release mode and I was able to upload the sketch to my board where it behaved as expected. When I try to debug, the compiler fails to build and the debugging process cannot even start, as a result there is no output in the Output window for debug.

I followed the information here to try and use the debug mode: https://www.visualmicro.com/page/ESP8266-Debugging.aspx

My sketch shows "No issues found" with a white tick mark on a green background.

I switched on verbose and build properties for the compiler.

The crux of the problem seems to be linked to a file called pgmspace.h on line 107 but I am not sure what that problem is.


Code (]stdio.h:6: In file included from
stdio.h:63: from
cstdio:42: from
random:39: from
stl_algo.h:65: from
algorithm:62: from
WiFiClientSecureBearSSL.cpp:27: from

pgmspace.h: In function uint32_t pgm_read_dword_unaligned(const void*)

pgmspace.h: 107:1: error: a15 cannot be used in asm here
  Using previously compiled file: C:\Users\addiv\AppData\Local\Temp\VMBuilds\20200523_RootaBoota_01\esp8266_d1_mini_pro\Debug\ESP8266WiFi\WiFiServer.cpp.o
  Using previously compiled file: C:\Users\addiv\AppData\Local\Temp\VMBuilds\20200523_RootaBoota_01\esp8266_d1_mini_pro\Debug\ESP8266WiFi\WiFiServerSecureAxTLS.cpp.o
  Using previously compiled file: C:\Users\addiv\AppData\Local\Temp\VMBuilds\20200523_RootaBoota_01\esp8266_d1_mini_pro\Debug\ESP8266WiFi\WiFiServerSecureBearSSL.cpp.o
  Using previously compiled file: C:\Users\addiv\AppData\Local\Temp\VMBuilds\20200523_RootaBoota_01\esp8266_d1_mini_pro\Debug\ESP8266WiFi\WiFiUdp.cpp.o[/code):



Line 107 in that file is the closing curly bracket in that function: [code c++]static inline uint32_t pgm_read_dword_unaligned(const void *addr) {
  uint32_t res;
  pgm_read_dword_with_offset(addr, res);
  return res;
}


If anybody knows how to get solve that issue it would be great. I am attaching the build log as well as the pgmspage.h file that crashed the party in the attached zip file.

Thanks,
Arnaud
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=BuildProblem.zip ( 31 KB | 22 Downloads )

Title: Re: Build error: a15 cannot be used in asm here
Post by Visual Micro on May 23rd, 2020 at 3:58pm
Thanks for the info. The error is with the DNSServer which I expect does not support switching off optimization. I suggest you set "disabled optimization" to "project only" or "off".

When you switch off optimization we add the -O0 flag to the compiler. We are due to experiment with -Og or a high optimization value than 0.

Does this help?

Title: Re: Build error: a15 cannot be used in asm here
Post by Arnaud on May 24th, 2020 at 2:46am
Thank you for your feedback and suggestions.

In terms of debugging optimizations, I have 4 choices. Following what the debugging tutorial was suggesting, I used "No Project + Libraries Optimization" which failed. I have tested all 4 configurations and the results are below:

* Default Optimization: No error, builds ok.
* No Project Optimization: Error
* No Project + Libraries Optimization: Error
* No Optimization : Error

So changing to "Default" fixed my problem eventually.

If there is anything else you want to investigate with this problem you need my help with, feel free to ask, happy to provide additional data.

In the meantime, your suggestion to play around with the optimizations did help me to fix my problem.  8-)

Thank you!

Title: Re: Build error: a15 cannot be used in asm here
Post by Visual Micro on May 24th, 2020 at 1:26pm
Off-Topic replies have been moved to this Topic.

Title: Re: Build error: a15 cannot be used in asm here
Post by Visual Micro on May 24th, 2020 at 1:28pm
The optimization settings that each board can support is different. Some toolchains and cores have been written in a way that does requires optimization to remain at default.

It is not something we can directly control but we are always looking to see if we can improve.

Title: Re: Build error: a15 cannot be used in asm here
Post by Arnaud on May 25th, 2020 at 12:30am
Understood, thanks.

For the second part of my issue I saw that you moved it to another topic in another part of the forum. I was hesitating whether I should do that or not.

So for this specific issue in the current thread, it is solved as far as I am concerned and then we can look to deal with the other problem in the other thread.

Cheers.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.