I read about Segger studio (on their website) that it reduces the code size. I try to check it out Here's my opposite result I've compiled the same app (e.g uart_example) in different IDE: keil and segger. the result for Keil:
for Segger:
I read about Segger studio (on their website) that it reduces the code size. I try to check it out Here's my opposite result I've compiled the same app (e.g uart_example) in different IDE: keil and segger. the result for Keil:
for Segger:
And what is a question? Indeed different compilers and linkers make different binary output sizes (also note that most of modern toolchains have several optimization levels so even with one chain you can easily have different sizes depends on project settings). And indeed creators of these tools will claim on their home page that their optimizations are better. What is the surprise?
The question is .. isn't it good for Segger studio users to have in almost three time bigger code side in compare with Keil users for the same app? I think it's very important to generate less size of hex file for MC compilers because MC's flash is very a critical resource
Sure, it's typically better to have smaller code, especially on embedded system with less NVM. But again no surprise, that's why the companies who develop their compilation chains are charging such a money for it. If you really care about the code size or performance such as CoreMark or similar banchmark (operation per clock or mW) then you might need to invest into Keil or IAR. Others are fine with flexibility and zero price mark of tools like GCC. Note that this market is still very active so while IAR and Keil might be market leaders today GCC are working hard to generate more compact and more performance-optimized code on ARM Cortex-M, you might see it in almost every major release. See this blog post which is 18 months old.
Just a foot note: Nordic don't produce any of these compiles, they just support as many as possible (like 4 or 5) so you can choose. If you have complains to any of them you might consider to contact the vendor (Keil, IAR, ARM, SEGGER, GCC community). If you want to really optimize some project with given tool chain then submit that as clear question, show us all the options you use for compilation/linking and there might be some advises how to optimize for given quality (like code size, RAM size, faster execution...)
Hi, Code size is dependent on various factors. For a useful comparison for your project make sure that you use the same / similar compiler options, such as optimization level. We would also recommend to compare the size of the actual release build, since with debugging enabled the code will be less optimized in most cases. For a generally useful / fair comparison one should also use various different target applications. Optimization is always highly dependent on the code. In some cases Keil or IAR will produce faster or smaller code, but there are also cases where GCC or clang outperform the commercial toolchains. (Where did you read that Embedded Studio reduces code size? I do not think we do stat this on our website)