Trying to connect nrf52833 with BG95 via PPP and creating a socket to ping google.com

I am trying to ping google.com using PPP connection using BG95 interfaced with nrf52833. I have used the gsm_modem sample code for PPP connection and when "Network connected" event occurs, creating a socket connection for http request. But when connect function is called it gives "Data Access Violation" error. In prj.conf file stack size configuration is "CONFIG_MAIN_STACK_SIZE=4096".

Here is the code file for the reference

kodiak-fw.zip

.

Parents
  • Hi,

    Could you increase your stack sizes? As the Error suggests in the image you attached, "Stack overflow on CPU 0" means that the stack size is too small. Try with 8192 or 16384 (whatever you can spare on the nRF52833).

    I would also recommend that you have a look at this lesson in the intermediate course for some tips and tricks for debugging: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/ 

    Kind regards,
    Andreas

  • Even after increasing the size to 8192 and 16384, still the error is same.

  • Thank you for providing this.

    Can you follow the steps in the debugging lesson I sent you to trace back to which thread and which function calls it is that triggers the MPU fault? Another thought is that you're trying to access something that is outside of the legal memory address range (i.e physical access range).

    Kind regards,
    Andreas

  • Thanks for the support,

    I want to ask one more question, How can we configure the username and password(for sim card) along with the APN name for PPP.
    Like if we need to set APN name, we can change that using CONFIG_MODEM_GSM_APN.

  • Hi,

    To my understanding the following the following resources should contain what you need:

    To configure the username and password for the SIM card along with the APN name for PPP, you can use the Kconfig settings provided by the PDN library.

    Here are the relevant Kconfig options:

    - `CONFIG_PDN_DEFAULTS_OVERRIDE`: This option is used to override the default PDP context configuration. Set this option to `y` to override the default PDP context configuration. https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/pdn.html#configuration 

    - `CONFIG_PDN_DEFAULT_APN`: This option is used for manual configuration of the APN. For example, you can set it as `apn.example.com`. https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/net/http_server/README.html#overview 

    - `CONFIG_PDN_DEFAULT_USERNAME` and `CONFIG_PDN_DEFAULT_PASSWORD`: These options are used to set the authentication credentials. https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/libraries/modem/pdn.html#configuration 

    Please note that the default PDP context configuration must be overridden before the device is registered with the network.

    For GSM modem support, you can use the following Kconfig options:

    - `CONFIG_MODEM_GSM_PPP`: This option enables GSM PPP support.  MQTT With GSM PPP and TLS  

    - `CONFIG_MODEM_GSM_APN`: This option is used to set the APN for the GSM modem.  MQTT With GSM PPP and TLS   

    Please refer to the respective documentation for more details on how to use these options.

    Kind regards,
    Andreas

  • I have added below config in prj.conf, It is showing warning on compile time. 
    CONFIG_PDN_DEFAULTS_OVERRIDE=y
    CONFIG_PDN=y

    It shows PDN dependency on NRF_MODEM_LIB and AT_MONITOR as they are by default set to "n".
    I have configured by setting both NRF_MODEM_LIB and AT_MONITOR to "y". And again it shows dependency on other configuration.

  • Hi,

    pulkit said:
    I have configured by setting both NRF_MODEM_LIB and AT_MONITOR to "y". And again it shows dependency on other configuration.

    Did you continue to implement the dependencies that were required? You can use https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html to help you finding dependencies

    Did it work despite of the warnings? What did you see?

    Kind regards;
    Andreas

Reply Children
No Data