Beta12 : Compilationerror: error 13 INTERNAL

As subject says, unable to compile.
(same code compiles just fine for the same uC using the old/standard IDE.)

Please tell me how to provide relavant log or anything, og almost 1GB of classic bloated ms-developed code, it is hard to get to see any meaningful output of this(or understand the message)
:slight_smile:

I assume that you realise that this is a Beta version

Where are you seeing the error message ?

Hi, Oh .. I thought VScode was that big by now, but I do realize it's a Beta - and I love what I see.
The same error spawns in two places:

Hi @AndreK. I'm going to ask you to post some additional information that might help us to identify the problem.

Please do this:

  1. Select File > Preferences from the Arduino IDE's menus.
  2. Check the box next to "Show verbose output during: compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE's menus.
  5. Wait for the compilation to end.
  6. Right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
  7. From the context menu, click Copy All.
  8. Open a forum reply here by clicking the Reply button.
  9. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  10. Press Ctrl+V. This will paste the compilation output into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the Reply button to post the output.

Yeah, it really blew up in size between 2.0.0-beta.11 and 2.0.0-beta.12.

I'm not sure there has been a lot of Microsoft involvement in the code base. It's true that Arduiino IDE 2.x uses Electron, and Electron was made by GitHub, which Microsoft owns, but Electron was around long before Microsoft bought GitHub. Arduino IDE 2.x uses the Eclipse Theia IDE framework, which is based on Electron, and does mirror the VS Code UI in many ways, but Theia is a different project from VS Code and I don't think Microsoft has had any involvement in the Theia development.

Of course, if you want to dive even deeper, you will find the IDE code is written in Microsoft's TypeScript programming language!

1 Like
Using board 'GenF1' from platform in folder: /home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0
Using core 'arduino' from platform in folder: /home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0
/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/extras/prebuild.sh /tmp/arduino-sketch-14507020203B036972B28102B016E542 /home/andre/Arduino/projects/Mav2HoTT-bluepill
Detecting libraries used...
/home/andre/.arduino15/packages/STM32/tools/xpack-arm-none-eabi-gcc/9.2.1-1.1/bin/arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb @/tmp/arduino-sketch-14507020203B036972B28102B016E542/sketch/build_opt.h -c -Os -w -std=gnu++14 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -I/home/andre/Arduino/projects/Mav2HoTT-bluepill -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/avr -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32 -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32/LL -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32/usb -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32/OpenAMP -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32/usb/hid -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/stm32/usb/cdc -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Drivers/STM32F1xx_HAL_Driver/Inc -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Drivers/STM32F1xx_HAL_Driver/Src -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/STM32F1xx -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Inc -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/ST/STM32_USB_Device_Library/Core/Src -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/OpenAMP -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/OpenAMP/open-amp/lib/include -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/OpenAMP/libmetal/lib/include -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Middlewares/OpenAMP/virtual_driver -w -x c++ -E -CC -DSTM32F1xx -DARDUINO=10607 -DARDUINO_BLUEPILL_F103C8 -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"BLUEPILL_F103C8\"" -DSTM32F103xB -DUSBCON -DUSBD_VID=0 -DUSBD_PID=0 -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DHAL_UART_MODULE_ENABLED -I/home/andre/.arduino15/packages/STM32/tools/CMSIS/5.5.1/CMSIS/Core/Include/ -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Include/ -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/system/Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/ -I/home/andre/.arduino15/packages/STM32/tools/CMSIS/5.5.1/CMSIS/DSP/Include -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino -I/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/variants/PILL_F103XX /tmp/arduino-sketch-14507020203B036972B28102B016E542/sketch/Mav2HoTT-bluepill.ino.cpp -o /dev/null
Alternatives for uTimerLib.h: []
ResolveLibrary(uTimerLib.h)
  -> candidates: []
Compilation error: Error: 13 INTERNAL: exit status 1

What does this tell you? / What should I try next?
(please have in mind that I already tested that the Arduino 1.8.13, 1.8.16 compiles it just fine)

This is the Arduino IDE 2.x's more cryptic version of the "No such file or directory" error you might be familiar with from using the classic Arduino IDE.

it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

Note that libraries may have dependencies on other libraries.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  1. Select Sketch > Include Library > Manage Libraries... from the Arduino IDE's menus.
  2. In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  3. Scroll through the results for the right library. Click on it.
  4. Click the Install button.
  5. Wait for the installation to finish.
  6. Click the Close button.
  7. Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results from github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out.

After downloading the library you found, you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

Thank you.
The big cause of trouble is that:
Arduino 1.8 is using the path :
/home/andre/Arduino/projects/libraries/
while
Arduino IDE 2.x is using:
/home/andre/Arduino/libraries/ (which is quite logical.)

So the question is:
how can I make both happy?
Can I make 1.8x use /home/andre/Arduino/libraries/ (just like older Arduino 1.x did?)
..or can I make 2.0 use projects/libraries ?
I hope to make both happy without symlinking them.

/home/andre/Arduino/projects and /home/andre/Arduino are your sketchbook folders. You can set the path of the sketchbook folder to anything you like in File > Preferences > Sketchbook location. The libraries that are installed in the libraries subfolder of the sketchbook folder are recognized by the Arduino IDE.

The classic Arduino IDE and Arduino IDE 2.x use a different preferences system, so that's why your custom sketchbook location preference setting from Arduino IDE 1.8 was not used by Arduino IDE 2.x. /home/andre/Arduino is the default sketchbook location.

1 Like

@in0 Once again, "thank you"
Now I learned that when setting the sketchbook location, then the libraries directory is always set relative to that location.
-now it compiles just fine.

I have my UploadMethod set to "STM32CubeProgrammer(SWD)"
and I get the error:

--------------------------
Compilation complete.
Upload error: Error: 9 FAILED_PRECONDITION: Property 'upload.tool.' is undefined

The same environment works for 1.8.x , so I suspect the "upload.tool." is an IDE 2.x thing.?

It's actually an Arduino CLI bug:

The same bug would likely affect Arduino IDE 1.8.x as well. It's only that Arduino IDE 2.x was updated to use the version of Arduino CLI with the bug while Arduino IDE 1.8.x is using an older Arduino CLI without the bug.

Here are the instructions for the workaround described in the bug report:

  1. Open this file in a text editor:
    /home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/boards.txt
    
    Note: /home/andre/.arduino15 is a hidden folder, so you won't see it in the file browser or command line with default settings.
  2. Change this line:
    Nucleo_32.menu.upload_method.swdMethod.upload.tool=stm32CubeProg
    
    to this:
    Nucleo_32.menu.upload_method.swdMethod.upload.tool.default=stm32CubeProg
    
  3. Save the file.
  4. Close all Arduino IDE windows.
    This is necessary because the IDE only loads the board platforms on startup so it won't recognize changes made to boards.txt until after a restart.
  5. Start the Arduino IDE again and try another upload.

I see followed your instructions, and see that compilation refer to
/home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/cores/arduino/avr - (among other)

  • so we are on the right path.
    however, editing
    /home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/boards.txt

did not fix or change the error - having read on github about option to add other versions I ended up with this :

# Upload menu
Nucleo_32.menu.upload_method.MassStorage=Mass Storage
Nucleo_32.menu.upload_method.MassStorage.upload.protocol=
Nucleo_32.menu.upload_method.MassStorage.upload.tool=massStorageCopy

Nucleo_32.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
Nucleo_32.menu.upload_method.swdMethod.upload.protocol=0
Nucleo_32.menu.upload_method.swdMethod.upload.options=-g
Nucleo_32.menu.upload_method.swdMethod.upload.tool.default=stm32CubeProg
Nucleo_32.menu.upload_method.swdMethod.upload.tool.=stm32CubeProg
Nucleo_32.menu.upload_method.swdMethod.upload.tool=stm32CubeProg

but the issue remains

Sorry for the confusion. I forgot that I had arbitrarily chosen the "Nucleo-32" board while I was verifying the workaround. So my instructions only apply to that board. I can see that you are instead using the "Generic STM32F1 series" board. I'll provide the instructions again, only adjusted to make the fix for that board:

  1. Open this file in a text editor:
    /home/andre/.arduino15/packages/STM32/hardware/stm32/1.9.0/boards.txt
    
    Note: /home/andre/.arduino15 is a hidden folder, so you won't see it in the file browser or command line with default settings.
  2. Change this line:
    GenF1.menu.upload_method.swdMethod.upload.tool=stm32CubeProg
    
    to this:
    GenF1.menu.upload_method.swdMethod.upload.tool.default=stm32CubeProg
    
  3. Save the file.
  4. Close all Arduino IDE windows.
    This is necessary because the IDE only loads the board platforms on startup so it won't recognize changes made to boards.txt until after a restart.
  5. Start the Arduino IDE again and try another upload.
1 Like

@in0 Thank you. It worked beautifully. - kind of embarassing I did not spot that myself.

Replacing the text broke 1.8.x - keeping the old and adding the new line kept both 1.8 and 2.0 happy.

You're welcome. I'm glad to hear it's working now and that you were able to fix the backwards incompatibility issue. Hopefully the bug in Arduino CLI will be fixed soon.

I have news about the problem of the IDE displaying this sort of cryptic user unfriendly error message. It was found to be caused by a bug in the Arduino CLI tool Arduino IDE 2.x uses under the hood for compiling sketches. That bug has now been fixed:

That fix is not yet in Arduino IDE 2.x, but it will be in one of the upcoming releases.

There is also a proposed improvement to the other unhelpful "Error: 13 INTERNAL" part of the error here:

To in0: This patch in boards.txt fixes the bug in IDE 2.0.0-beta.12 with the Blue Pill for me.
Thanks!

1 Like

A post was split to a new topic: Alternatives for IRLremote.h: []