changing app optimization level of application only works with debug bootloader

Hi,

I have the following 2 scenarios:

Scenario 1: I create an image with nrfutil containing SD, App and debug bootloader. I flash this image and it works. Then I change the optimization level of the app, and I flash the app only, this works.

Scenario 2: I create an image with nrfutil containing SD, App and "normal" bootloader. I flash this image and it works. Then I change the optimization level of the app, and I flash the app only. Now the application won't boot. Because there is no debug information from the bootloader I can't see with logging what's going on.

I compared the 2 sdk_config.h files of the debug and "normal" bootloader, but I can only see that it has to do with logging. Other settings are the same.

What can cause the issue that only with a debug loader I'm able to flash an application with a different optimization level?

  • Hi, 

    Scenario 2: I create an image with nrfutil containing SD, App and "normal" bootloader. I flash this image and it works. Then I change the optimization level of the app, and I flash the app only. Now the application won't boot. Because there is no debug information from the bootloader I can't see with logging what's going on.

    Do you also program with the Bootloader settings page? Could it work without optimization?

    Regards,
    Amanda

  • Do you also program with the Bootloader settings page?

    Yes, in both scenario's I initially program with the bootloader settings page.

    Could it work without optimization?

    If I execute scenario 2, and then after I flash an application without optimization it works.

    However, what I found out is that it's not the optimization, but the fact that the application is different. Because when I use the same optimization level, and make a small change in the app, it's also not booting.

    I don't have this problem with the _debug bootloader, which I don't understand because the only difference is the logging as far as I know.

  • Hi,

    Gueston said:

    If I execute scenario 2, and then after I flash an application without optimization it works.

    However, what I found out is that it's not the optimization, but the fact that the application is different.

    Seems the application without debug log and optimization can run without the issue. Right? Then, I would say the issue might be in the optimization. Do you agree with that?

    -Amanda 

  • Then, I would say the issue might be in the optimization. Do you agree with that?

    Well, the applications runs, but only if I create a merged image (so first create settingspage, then merge it with bootloader, sd app etc.). But then only after I change the application and only flash the application (in the correct region) then it's not working.

    Besides that, if the optimization is the problem, then why the app runs without any problem with the debug bootloader?

  • Hi,

    Gueston said:
    But then only after I change the application and only flash the application (in the correct region) then it's not working.

    What do you charge? Is it another application? How do you flash the application, by nRF Programmer app or nrfjprog -e? Maybe you could try to regenerate the settings page for the app and program it. 

    Gueston said:
    Besides that, if the optimization is the problem, then why the app runs without any problem with the debug bootloader?

    I have no idea. I just suspect the optimization because the same code without the optimization can work.

    -Amanda

Related