This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Debug and Release Configuration not working in SES

I was working with "Debug configuration" for my nrf board on Segger Embedded Studio. It was working perfectly. But when I changed it to "Release configuration", It doesn't work. Now even the debug configuration doesn't work.
I use latest SES version (Setup_EmbeddedStudio_ARM_v550d_win_x64).

In the image you can see that I cannot click the "Go button". 
What should I do. Please help me out.
Thank you.

Parents
  • Hello, 

    In the image you can see that I cannot click the "Go button". 
    What should I do. Please help me out.

    The image indicates that debugging is already running - since you are able to press stop, break and reset, for example.
    Could this be the case? If you click 'stop', are you then able to attach the debugger again, and click 'go'?

    I was working with "Debug configuration" for my nrf board on Segger Embedded Studio. It was working perfectly. But when I changed it to "Release configuration", It doesn't work. Now even the debug configuration doesn't work.

    The build configurations actually refer to the different ways to build a large C project. This allows you to generate different hex files with different levels of debugging output, or compiler optimization levels, etc.
    Build configuration does not actually have anything to do with the debugger's way of accessing the chip.

    Best regards,
    Karl 

  • Thank you for your response. I had these errors when I built the program in segger.

    1> File "c:\users\nishi\appdata\local\programs\python\python39\lib\site-packages\nordicsemi\__main__.py", line 53, in <module>
    1> from nordicsemi.dfu.dfu_transport_serial import DfuTransportSerial
    1> File "c:\users\nishi\appdata\local\programs\python\python39\lib\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 52, in <module>
    1> from nordicsemi.lister.device_lister import DeviceLister
    1> File "c:\users\nishi\appdata\local\programs\python\python39\lib\site-packages\nordicsemi\lister\device_lister.py", line 39, in <module>
    1> from nordicsemi.lister.windows.lister_win32 import Win32Lister
    1> File "c:\users\nishi\appdata\local\programs\python\python39\lib\site-packages\nordicsemi\lister\windows\lister_win32.py", line 43, in <module>
    1> from constants import DIGCF_PRESENT, DEVPKEY, DIGCF_DEVICEINTERFACE
    1> ModuleNotFoundError: No module named 'constants'
    Build failed

    So I changed the python version from 3.9.6 to 3.7.
    Now it shows as below when built.


    1> Compiling ‘ble_conn_state.c’
    7> Compiling ‘ble_db_discovery.c’
    3> Compiling ‘ble_srv_common.c’
    6> Compiling ‘nrf_ble_gatt.c’
    5> Compiling ‘nrf_ble_gq.c’
    8> Compiling ‘nrf_ble_scan.c’
    2> Compiling ‘utf.c’
    4> Compiling ‘ble_lbs_c.c’
    1> Compiling ‘nrf_sdh.c’
    3> Compiling ‘nrf_sdh_ble.c’
    7> Compiling ‘nrf_sdh_soc.c’
    1> Post-build command
    1> failed to create process.
    Build complete

    In Debug configuration, I have seen that it displays we have to click "Go" twice to see the working in the output window.
    But in Release configuration, I can click the "Go" only once. And Also my nrf board gets hanged. It doesn't send the data that it was sending in debug configuration. I have to erase the chip every time.
  • Prathik said:
    Here it shows failed to create process when built the program in "release configuration". When I try to debug in release configuration it doesn't work. So I changed back to debug configuration and when i did the debug, again it didn't debug. So I had to erase the device in order to make it run even in Debug configuration.
    Prathik said:
    Is there anything that I have to change for my device to run on Release Configurations?

    I understand. Could it be that you have only made changes to your debug build configuration during the development, instead of making them for the common configuration?
    Could you show me the difference between the release and the debug configuration? You can see this in plain text if you open your SES project file in an editor, instead of opening it with SES.
    It may look something like this:

    ..
      <configuration
        Name="Release"
        c_preprocessor_definitions="NDEBUG"
        gcc_optimization_level="Optimize For Size"
        link_time_optimization="No" />
      <configuration
        Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None" />
    ..


    Best regards,
    Karl



  • Is this what you wanted me to check? It's same as yours. Is it correct?

  • Yes. Could you try changing the gcc_optimization_level for release to "None", to see if this makes your Release build configuration behave the same as your debug configuration?

    Have you made any other changes to the project options's tab for the debug configuration, compared to the common or release configuration?

    Best regards,
    Karl


  • Changed it to "None". It works just like Debug configuration.



    No. I didn't make any other changes.

    Thank you.

  • Prathik said:
    Changed it to "None". It works just like Debug configuration.

    Great, so we have figured out why the two configurations behave differently.
    This might mean that you are doing something that is interpreted differently by the compiler based on the the optimization level, or that certain parts of your code is optimized away by your compiler. You might want to identify what the underlying cause is here, to avoid this being an issue in the future, or if you'd like to optimize the application for size. There are many threads on Stack Overflow discussing this issue, which could be helpful to have a look at, for example.

    What issue still remains - do you still need to press the go button twice, in order to begin debugging?

    Prathik said:
    No. I didn't make any other changes.

    Thank you for confirming this.

    Best regards,
    Karl

Reply
  • Prathik said:
    Changed it to "None". It works just like Debug configuration.

    Great, so we have figured out why the two configurations behave differently.
    This might mean that you are doing something that is interpreted differently by the compiler based on the the optimization level, or that certain parts of your code is optimized away by your compiler. You might want to identify what the underlying cause is here, to avoid this being an issue in the future, or if you'd like to optimize the application for size. There are many threads on Stack Overflow discussing this issue, which could be helpful to have a look at, for example.

    What issue still remains - do you still need to press the go button twice, in order to begin debugging?

    Prathik said:
    No. I didn't make any other changes.

    Thank you for confirming this.

    Best regards,
    Karl

Children
No Data
Related