Author Topic: IAR / CMake / Build Machine  (Read 1567 times)

0 Members and 1 Guest are viewing this topic.

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
IAR / CMake / Build Machine
« on: September 14, 2023, 12:12:58 pm »
Hello,

I'm working for a client on a project using IAR Embedded Workbench, which is .... archaic, i used VS Code for development

Recently i bought a MBP as day to day computer, and for confort i would like to use CLion for dev, as IAR is only on windows does someone know if it is possible to setup a computer as a builder and use it from the Mac (or other machine) ?
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3375
  • Country: ua
Re: IAR / CMake / Build Machine
« Reply #1 on: September 14, 2023, 07:03:54 pm »
you can use gcc to build project, but there are some pitfalls, since gcc optimizer is not so smart, the result code may not fit into memory. And I'm afraid that your client will not like your idea to use other environment for development. Just because you never know how it will be compiled and work with original environment.

Also there is IAR Build Tools for Linux.

If your client want firmware for IAR, you're needs to develop and debug it on IAR...

After all, you can install windoze on your MacBook Pro... :)
« Last Edit: September 14, 2023, 07:12:17 pm by radiolistener »
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: IAR / CMake / Build Machine
« Reply #2 on: September 14, 2023, 08:15:11 pm »
I already tried to use GCC but building that way exceed system flash size.

I must admit that i wanted to share IAR build machine to be able to build fron CI too but i think my client does not have the budget to buy IAR Build tool for linux :/
 

Offline eutectique

  • Frequent Contributor
  • **
  • Posts: 392
  • Country: be
Re: IAR / CMake / Build Machine
« Reply #3 on: September 14, 2023, 09:14:38 pm »
I already tried to use GCC but building that way exceed system flash size.

Exceeds by how much?

Is it a C++ project?

What GCC version did you use?

Do you have assert() in the code? You might see all the file names with full paths in the binary.

What about -Os compiler option? Did you specify right architecture? Does your MCU has FPU, and if yes, what floating-point ABI you used for compilation?

IAR compiler must do miracles, if its generated code fits the flash, and GCC's does not.

You could share the source code from your Linux (or Mac, for that matter) via Samba server, do development there, and dispatch compilation on Windose with ssh for example. Opportunities are plenty.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3375
  • Country: ua
Re: IAR / CMake / Build Machine
« Reply #4 on: September 15, 2023, 06:25:19 am »
IAR compiler must do miracles, if its generated code fits the flash, and GCC's does not.

Yes, it do. As I remember it produces about 30% smaller code than gcc and that smaller code works about 10-20% faster than code produced with gcc. Even if you use speed optimizations for iar and size optimizations for gcc, iar still produces much smaller size of code... I got that result for C code. I compared for loop from my code and found that iar code generator is much more smart than gcc. This is classic issue, when you're trying to compile code on gcc and it doesn't fit into memory, while on iar it fits and have a lot of free space... Sometimes it produce twice smaller code than gcc and it works much faster than gcc code even if you use size optimizations for iar and speed optimizations for gcc.
« Last Edit: September 15, 2023, 06:50:41 am by radiolistener »
 

Offline shangaorenTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: fr
Re: IAR / CMake / Build Machine
« Reply #5 on: September 15, 2023, 07:38:02 am »
i can't remember how much it exceed, i tested this some years ago,

i tested it this the latest version of stm32cubeide at the time using -Os and maybe LTO but btu even if it fits the code heavily use some specific fonction of IAR and it would take time to modify.

it's a C project (another problem to solve from my point of view xD ) no FPU, no assert()

IAR is (sadly) known to have a more efficient compiler and more optimized library for arm, just by seeing their tools you know that's not for this people are paying for ....
 

Online bingo600

  • Super Contributor
  • ***
  • Posts: 1989
  • Country: dk
Re: IAR / CMake / Build Machine
« Reply #6 on: September 15, 2023, 08:26:26 am »
If i seek for something like :
Windows execute program from remote linux i see some hits.

Might be a bit of a "kludge" , but if you setup a Windows share , and put sources etc there.
You might be able to access that from the MAC.

And then use some "Remote execution magic" to kick off a "make w. the  iar compiler" on the Win PC.




 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: IAR / CMake / Build Machine
« Reply #7 on: September 15, 2023, 01:46:32 pm »
Take a look at the GitHub runners. Windows is there. https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners You can have a beatiful CI
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 825
  • Country: es
Re: IAR / CMake / Build Machine
« Reply #8 on: September 15, 2023, 02:24:42 pm »
IMO, IAR's superiority over GCC is a myth based on outdated comparisons vs ST's bundled GCC 4.x and improper settings. A fresh GCC (v9+) from ARM web site configured to -Os -flto -ffunction-sections -fdata-sections -Wl,--gc-sections is on par with IAR's "optimize for size"+"single file mode". Enabling LTO is critical for GCC to achieve small size (and, perhaps, getting rid of blasphemous ST's asm startup files declaring tons of WEAK symbols, they are suspected for hindering the LTO).
One special case where IAR still can beat GCC seriously is data section compression feature (GCC doesn't have it). A 1000-byte global/static array initialized to 999 zeroes and a single 1 would occupy 1000 bytes with GCC and just few bytes with IAR (due to compression). We've coded an ELF post-processor and a custom startup to do the same with GCC.
Can't say much about bundled libraries, haven't seen anything bigger that memcpy/memset pulled from the lib, and those are ok from both.
Sorry for little derailing.
« Last Edit: September 15, 2023, 02:27:19 pm by abyrvalg »
 

Offline eutectique

  • Frequent Contributor
  • **
  • Posts: 392
  • Country: be
Re: IAR / CMake / Build Machine
« Reply #9 on: September 15, 2023, 04:35:32 pm »
Data section compression -- yes, but on expense of flash for decompressor code.

Also, GCC is not the only free tool available, there is LLVM.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf