different errors with different compiler optimization settings

Hello,

I'm having a very strange issue where changing the compiler optimization level will generate different errors in the ble_ess_init() function (sometimes even in sd_enable() )

in particular:

optimization set to None = everything works fine

optimization set to Level 2 for size= NRF_ERROR_DATA_SIZE

optimization set to Level 2 for speed = NRF_ERROR_INVALID_ADDR

 

how do I fix this issue?

Regards,

Rocco

  • Hi Rocco

    My bad. It seems the file was there all along, it was just not added to the project for some reason (the project had ble_nus.c added rather than ble_ess.c). 

    Adding the right file to the project I can now get it to build. 

    As for the original issue I am wondering if this could be related to an inconsistency in Segger Embedded Studio when flashing SoftDevice based applications to the device. When the issue happens, what will happen if you reset the board by pressing the reset button on the DK?

    Alternatively, try to start the application in the debugger and see if the same issue occurs. 

    If a reset or starting a debug session solves the issue then this is a known issue in the way that Segger Embedded Studio starts the application after downloading an application update. 

    The various Thingy52 files can be found here (the source code is located in the SDK), but there is no ble_ess module in the original Thingy52 firmware. There is a ble_tes module (Thingy Environment Service), but I must assume that ble_ess is something this other person implemented. 

    Best regards
    Torbjørn 

  • hi,

    I have managed to fix the issue.

    As I have been told in this other thread   can't compile bootloader SES SDK v17.1.0, linker error , SDK v17.1.0 needs SES v5.42a, but I was using the latest version of Segger Embedded Studio. Installing SES  v5.42a has fixed the issue, I can compile the release code with different optimization levels without any errors

  • Hi

    That is great news Slight smile

    I didn't think of this possibility, often when using the latest SES version it is impossible to build the application at all. Anyway, good to hear that you figured it out. 

    Best regards
    Torbjørn

Related