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

Global variable

Hi

I have a strange question to ask for your help.In my program, I define and use a large number of global variables. However, when I define a global variable again and use it, the program will make an error. The phenomenon is that it keeps restarting. If it is defined as a local variable, the program also runs well. I think it is possible that it is caused by global variable overflow?

Thanks.

Parents
  • Hi,

    I guess it might be caused by a stack overflow. Have you been able to debug the application to see what kind of error you are getting? Also, have you configured the app error handler (see Error module) to not automatically reset the device when it receives an error?

    Please select the 'Debug' build configuration if you are using Segger embedded studio for debuging:

    You may also want to enable 'NRF_LOG_BACKEND_RTT_ENABLED' in sdk_config.h if you haven't already. This should make debug logs appear in the SES debug terminal when you debug the application.

Reply
  • Hi,

    I guess it might be caused by a stack overflow. Have you been able to debug the application to see what kind of error you are getting? Also, have you configured the app error handler (see Error module) to not automatically reset the device when it receives an error?

    Please select the 'Debug' build configuration if you are using Segger embedded studio for debuging:

    You may also want to enable 'NRF_LOG_BACKEND_RTT_ENABLED' in sdk_config.h if you haven't already. This should make debug logs appear in the SES debug terminal when you debug the application.

Children
No Data
Related