Skip to main content
Associate
June 18, 2025
Solved

library compiled for stm32F4 series compatible for custom Cortex M4?

  • June 18, 2025
  • 3 replies
  • 556 views

Edited to clarify that this is specifically STM32F4 (originally just said "Fx").


I've a library .a file compiled using STM32CubeIDE for STM32F4 series.

Is the .a file be compatible to Custom ARM Cortex M4 to use in IAR Embedded Work bench?

Best answer by TDK

Yes, if it doesn't include anything STM32F4-specific, it should work on other Cortex-M4 processors. Something like a DSP library would be compatible.

3 replies

Andrew Neil
Super User
June 18, 2025

There's two independent questions there:

  1. Is the .a library compatible with this "Custom ARM Cortex M4" ?
    I guess if the Custom part has the exact same options as in the STM32Fx, it should work.
     
  2. Can IAR use a GCC .a library created by CubeIDE ?
    You would have to ask IAR that one:
    https://www.iar.com/support 

If you have the source, surely rebuilding from source would be the safest option?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
KnarfB
Super User
June 18, 2025

Fx can be Cortex-M0 or Cortex-M4.

"Custom  ARM Cortex M4" could have other HW features implemented than STM32.

Also check the floating point options which are used on either side.

hth

KnarfB

Andrew Neil
Super User
June 18, 2025

@KnarfB wrote:

Fx can be Cortex-M0 or Cortex-M4.


Also M3, M33, M7, M55:

AndrewNeil_0-1750243613546.png

 

@dwarakanath so did you mean F4 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
June 18, 2025

Hi @Andrew Neil 

Yes. F4 here in my case.

Also the .a file doesn't have any peripheral related inclusions. Its purely some algo part.

@KnarfB 

No float support in either the cores.

TDK
TDKBest answer
Super User
June 18, 2025

Yes, if it doesn't include anything STM32F4-specific, it should work on other Cortex-M4 processors. Something like a DSP library would be compatible.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
June 18, 2025

Let me check and update 

Associate
June 19, 2025

It didn't work. some stack related linking error popped up. I think this is compiler dependent.

 

Thanks folks for the encouraging support.