Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52 development using clang

Hello, 

We are running a pretty massive nRF52832, SDK14.2, softdevice5.0.0, freertos based project built using Keil's "default compiler version 5"

For various reasons we are considering moving to llvm clang compiler either in SES environment or using Keil V6 compiler (which I understand is clang)

My questions are:

  1. I've seen some pretty old posts (e.g. RK's comment here, and here) that the app breaks/softdevice calls not supported when using clang compiler. Is this still the case?
  2. Is there a (reasonably) easy way to make the project clang/Keil V6 compatible?
  3. Are there any Code/RAM/Performance deltas when comparing Keil V5 and clang? (I've found this old post , but it compares gcc only and its outdated)

Thanks for any insight

Parents
  • Hello,

    I can confirm that the problem exists in SDK 15.3.0 (SVCALL is implemented in the same way). We're also considering to use 6.x compiler, so looking forward..

    Concerning code/RAM results, maybe statistics from our project will be interesting for you.

    v5.06 (-O2): Full build time 0:43, Program Size: Code=27962 RO-data=13030 RW-data=308 ZI-data=10024
    v6.9 (-Os balanced): Full build time 2:06, Program Size: Code=32600 RO-data=8392 RW-data=92 ZI-data=10236

    A noticeable difference in RO-data is because LLVM removes unused constant sections (for example, we have sha256/512 common source where sha512 functions are not called, v5.06 leaves sha512 transform tables in resulting image).

Reply
  • Hello,

    I can confirm that the problem exists in SDK 15.3.0 (SVCALL is implemented in the same way). We're also considering to use 6.x compiler, so looking forward..

    Concerning code/RAM results, maybe statistics from our project will be interesting for you.

    v5.06 (-O2): Full build time 0:43, Program Size: Code=27962 RO-data=13030 RW-data=308 ZI-data=10024
    v6.9 (-Os balanced): Full build time 2:06, Program Size: Code=32600 RO-data=8392 RW-data=92 ZI-data=10236

    A noticeable difference in RO-data is because LLVM removes unused constant sections (for example, we have sha256/512 common source where sha512 functions are not called, v5.06 leaves sha512 transform tables in resulting image).

Children
No Data
Related