Compile error with ARMC6

Hey I compiled a TensorFlow Lite project in Mbed-CLI and that worked. Now I want to use Mbed Studio but at 99% of compiling I get the following errors:

Compile [ 98.8%]: arm_bitreversal2.S

[ERROR] “.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 65 (column 5): Error: A1137E: Unexpected characters at end of line

65 00000000 .syntax unified

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 68 (column 2): Error: A1137E: Unexpected characters at end of line

68 00000000 .section .text

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 69 (column 2): Error: A1137E: Unexpected characters at end of line

69 00000000 .thumb

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 78 (column 2): Error: A1137E: Unexpected characters at end of line

78 00000000 .global arm_bitreversal_32

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 79 (column 2): Error: A1137E: Unexpected characters at end of line

79 00000000 .global arm_bitreversal_16

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 86 (column 2): Error: A1137E: Unexpected characters at end of line

86 00000000 .type arm_bitreversal_16, %function

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 87 (column 2): Error: A1137E: Unexpected characters at end of line

87 00000000 .type arm_bitreversal_32, %function

^

“.\tensorflow\lite\experimental\micro\tools\make\downloads\cmsis\CMSIS\DSP\Source\TransformFunctions\arm_bitreversal2.S”, line 142: Fatal error: A1355U: A Label was found which was in no AREA

142 00000000 arm_bitreversal_32 :
8 Errors, 0 Warnings


I found that at Mbed-CLI the GCC_ARM compiler was used and at Mbed Studio this one can not be used, so ARMC6 is used.

Can anyone help me?

Thanks

Hi Daniel,

Would you mind sending a link to the project you are compiling? Is it publicly available? We would be able to check it then. Please mention also the target you are using.
I guess that this project was not enabled for Arm Compiler 6. Mbed Studio is shipped with Arm Compiler 6.13 and doesn’t support GCC_ARM out of the box.
It is worth mentioning that Mbed Studio allows to switch compiler to GCC_ARM installed on the system. It is however has an experimental feature so not all functionalities may work correctly. We are planning to document it soon.

Thanks,
Arek

Thanks for your answer.
My project is just a simple MNIST example which I wanna execute on the STM32F746NG.

How could I Upload my project or send it you?

Thanks,
Daniel

Hi Daniel,

Thanks. I would recommend a source control system like git or mercurial. Mbed Studio supports both. You can either:

After that you can send me a link to the project. Feel free to read about Source control management support in Mbed Studio: Working with Git - Source control | Mbed Studio Documentation

Mbed Studio 0.9.1 is shipped with both git and mercurial so you do not need to have them present on your system. They are accessible from terminal inside Mbed Studio. More information about it can be found here: Using tools in the terminal - Using tools in the terminal | Mbed Studio Documentation

Thanks,
Arek - Mbed Studio team

Hi Arek,

here is my project:

I also wanted to mention that I use the mbed-os 5.12.0 as library

Thanks,
Daniel

Hi Daniel,

Thank you for posting an example. It is using a very old version of Mbed OS (from 2017). It is much lower than 5.12.0. I’ve updated it to use Mbed OS 5.15.0 and now I can see the same errors as you described above.
It seems that tensorflow library fails to compile with ARMC6. I’ll ask if there is anyone that can help you in updating this library to work with ARMC6 compiler.
In the meantime you can switch Mbed Studio to use GCC_ARM. We added today a documentation with details on how to enable it: Switching to GCC - Installing | Mbed Studio Documentation

I recommend also updating your example. You uploaded it with one extra folder. Most Mbed examples have mbed-os.lib in root folder.

Thanks,
Arek - Mbed Studio team

Hi Arek,

Thank you.
I tried to use GCC_ARM compiler and followed the steps in the link above. But when I compile my project says that it’s still using ARMC6 compiler. I checked if I have the right version of gcc. Do I have to do any further things to use GCC_ARM or do you know what could be my fault?

Thanks,
Daniel

What platform are you on and what Mbed Studio version are you using? Those steps should work in Mbed Studio 0.9.1 and all 3 platforms.
The only step that is not listed in docs is that it requires a Mbed Studio restart. It is because Mbed Studio is reading external-tools.json file on startup.
Please also make sure that the path to your installed version of GCC is valid.

Thanks,
Arek - Mbed Studio team

I am using Mbed Studio 0.9.1 and also restarted Mbed Studio and my notebook.
The path to GCC is also valid. So I don’t know whats the reason.

Thanks,
Daniel

I guess that you are on Windows 10 then. I’ve just checked steps from docs on Windows 10 and it worked for me correctly. The only things that come to my mind are:

  • Please check that you haven’t made any typo and file is called external-tools.json (without any other file extensions. I recommend disabling: Hide extensions for known file types in View->Options->View->Advanced settings in File Explorer).
  • The path to the file is invalid. Do you see recentworkspace.json and mbed-studio.log files in that folder?

Thanks,
Arek

2 Likes

Oh thank you very much, it was the file extension!!!
I made the mistake that when I named the file. It was called as external-tools.json.txt.
Now after restarting Mbed Studio it works and GCC_ARM compiler is used during compilation.
There are also no compiler errors anymore and the binary was flashed to the STM-Board.

Thank you again,
Daniel

2 Likes

I’m glad it worked for you. We will add information to the documentation that this change requires Mbed Studio restarts.

Thanks,
Arek

I was facing similar issues but the name of the file extension was correct. I realized the file directory name (in the external-tools.json file) has a separator " \ " instead of " / ". After this correction, Mbed Studio started successfully!

This is the content in the external-tools.json:

{
    "bundled": {
        "gcc": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin"

    },
    "defaultToolchain": "GCC_ARM"
}