Is it possible to use ARM compiler version 4.9.3 to compile code for newer ARM MCUs such as nRF52840 or STM32WB series?

huangapple go评论67阅读模式
英文:

Is it possible to use ARM compiler version 4.9.3 to compile code for newer ARM MCUs such as nRF52840 or STM32WB series?

问题

Do old ARM compilers support compilation for newer ARM MCUs? How to actually check it?
旧的ARM编译器是否支持为新的ARM微控制器进行编译?如何实际检查?

I am limited to usage of ARM compiler version 4.9.3. I want to know if I can use the same compiler to create binaries for new MCUs for example nRF52840 or STM32WB series.
我受限于使用ARM编译器版本4.9.3。我想知道是否可以使用同一编译器为新的微控制器创建二进制文件,例如nRF52840或STM32WB系列。

From what I know there shouldn't be any issues, but maybe I am missing something.
据我所知,不应该有任何问题,但也许我遗漏了什么。

英文:

Do old ARM compilers support compilation for newer ARM MCUs? How to actually check it?
I am limited to usage of ARM compiler version 4.9.3. I want to know if I can use the same compiler to create binaries for new MCUs for example nRF52840 or STM32WB series.

From what I know there shouldn't be any issues, but maybe I am missing something.

答案1

得分: 2

STM32WB是双核Cortex-M0+和Cortex-M4,而nRF52840是Cortex M4。它们并不特别“新”,设备的年龄无关紧要,关键是核心(更具体地说是核心使用的架构版本)何时引入的。以及是否由编译器支持。这应该在文档和可用的架构规范命令行开关中明确说明。

  • M0+是Armv6-M
  • M4是Armv7E-M

如果您指的是gnu-arm而不是ARM自己的传统ARM编译器ARMCC(没有4.9.3版本,4.1是最后一个v4版本,v5.x是最后一个ARMCC版本,v6基于LLVM/clang)。那么是的,这些架构得到支持 - 请参阅https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/ARM-Options.html#ARM-Options上的文档,特别是-march-mtune选项 - 它们允许您指定架构或核心 - 您不需要同时使用两者。

如果您正在使用提供了设备/制造商特定支持的工具链,包括库、链接器脚本、启动代码和调试器支持外设等,您可能无法获取所有(或任何)支持,而必须调整现有的支持以适应类似设备或创建自己的支持。

英文:

STM32WB is dual core Cortex-M0+ and Cortex-M4, while nRF52840 is Cortex M4. They are not particularly "new", the age of the device is irrelevant, it is when the core (or more specifically when the architecture version the core uses) was introduced that is key. And whether that is supported by the compiler. That should be clear from the documentation and the available architecture specification command line switches.

  • M0+ is Armv6-M
  • M4 is Armv7E-M

If you are referring to gnu-arm rather the ARM's own legacy ARM Compiler ARMCC (for which there is no such version as 4.9.3 - 4.1 was the last v4, and v5.x was the last ARMCC - v6 is based on LLVM/clang). Then yes, those architectures are supported - see documentation at https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/ARM-Options.html#ARM-Options, in particular the -march and -mtune options - they allow you to specify the architecture or the core respectively - you don't need both.

If you are using a toolchain that provides device/manufacturer specific support with libraries, linker scripts, start-up code and debugger support for peripherals for example, you may not get all (or any) of that and will have to adapt existing support for similar devices or create your own.

huangapple
  • 本文由 发表于 2023年5月29日 19:34:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76356981.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定