9160/LTE; no return from lte_lc_connect() and keeps resetting

Hi,

I'm having trouble with my custom 9160 board. It won't connect to LTE-M network and keeps resetting.

My prototype was developed using the 9160DK. I can connect to LTE-M network and send data to nrf Cloud. The combination is 9160 B1A, mfw 1.3.1, and NCS SDK1.7.1.

Now my custom board is using B0A silicon, with mfw 1.1.1. I have upgrade/downgrade between 1.1.1 and 1.3.1 multiple times. But that doesn't seem to make any difference.

My test code is simplified to like this:

LOG_INF("modem init");
lte_lc_register_handler(lte_lc_evt_handler);
err = lte_lc_init();
LOG_DBG("lte_lc_init(): %d", err);
err = lte_lc_connect();
LOG_DBG("lte_lc_connect(): %d", err);
LOG_INF("modem init done");

The log message looks like this:

00> I: modem init
00> D: Sending AT command to set system mode: AT%XSYSTEMMODE=1,0,1,0
00> D: System mode (4) and preference (0) configured
00> D: lte_lc_init(): 0
00> D: Sending AT command to set system mode: AT%XSYSTEMMODE=1,0,1,0

So it went through lte_lc_init(), but never returned from lte_lc_connect(). It will stays there for various amount of time, from a few seconds to a minute or so, then it resets.

Since this is a custom board, I try to figure out if any hardware issue could cause such problem. I assume lte_lc_connect() will search for the network and try to make a connection. The document says it has a timeout. I assume if it timed out, it should return from lte_lc_connect() with an error code? But it never returned and always resets after a while. Any possible explaination lte_lc_connect() could cause this? Or should I more look at hardware side? How can I get more debug information to troubleshoot this? I already set CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y.

The same code runs fine on the 9160DK and get connected in a few seconds.

Thanks!

Parents
  • Hi Bluebeam,

    Is it possible for you to modify from ncs\v1.5.1\zephyr\boards\arm\nrf9160dk_nrf9160 for your custom board?

    I think it is much easier to debug the issue caused by the board files mismatch between the two ncs versions.

    Best regards,

    Charlie

  • Hi Charlie,

    That's exactly what I did. I attached the two sets of board files here. The first one is basically the nrf9160dk_nrf9160 board file. I modified a few things in the nrf9160dt_nrf9160_common.dts where I actually have some peripherals I need to use on my custom board. So this at least compiles and links fine.

    Now I made a copy of that and changed everything 'nrf9160dk' to 'xxxxx', both in file names and names in files. Then it stopped working. It seems having trouble finding something. Error is:

    No SOURCES given to target: boards__arm__xxxxx_nrf9160

    If you unzip the two files you will find they are essentially the same except the name change. So I suspect I can bluntly change all the names. I suspect I can't change the 'model' or 'compatible' to any arbitrary thing? But I saw you did that too in the sample files you posted. So I'm confused.

    Any thoughts? Thanks!

    nrf9160dk_nrf9160.zip

    xxxxx_nrf9160.zip

Reply
  • Hi Charlie,

    That's exactly what I did. I attached the two sets of board files here. The first one is basically the nrf9160dk_nrf9160 board file. I modified a few things in the nrf9160dt_nrf9160_common.dts where I actually have some peripherals I need to use on my custom board. So this at least compiles and links fine.

    Now I made a copy of that and changed everything 'nrf9160dk' to 'xxxxx', both in file names and names in files. Then it stopped working. It seems having trouble finding something. Error is:

    No SOURCES given to target: boards__arm__xxxxx_nrf9160

    If you unzip the two files you will find they are essentially the same except the name change. So I suspect I can bluntly change all the names. I suspect I can't change the 'model' or 'compatible' to any arbitrary thing? But I saw you did that too in the sample files you posted. So I'm confused.

    Any thoughts? Thanks!

    nrf9160dk_nrf9160.zip

    xxxxx_nrf9160.zip

Children
  • I have a new discovery of the problem. When I started to change the original nrf9160dk_nrf9160 board files, I made a copy it and rename it to be 'nrf9160dk_nrf9160.ori'. It's in the same ncs/zephyr/boards/arm/ directory. It turns out that, I thin, the build tool is using the board files from this directory the whole time even I changed the name of it. It's not using the newly created 'nrf9160dk_nrf9160' that I'm changing.

    So I think during the whole time my changes of the board files are not being used. Until I deleted the 'nrf9160dk_nrf9160.ori' directory, suddenly all the errors are back.

    So the conclusion is taking the original nrf9160dk_nrf9160 and change it to my own files never worked. The attached zip file above should not work. But you can try it on your end to see if you can have same results as I do.

  • Ok now I realize you were changing from the thingy91_nrf9160 board files. I should have stayed with that since it works. But I don't understand why starting from the 9160DK board files doesn't work. And how come the format in these two sets of files are so different?

    If I stay with the thing91 board files, how do I get rid of things like the ADP536X? Just remove those functions in board_secure.c ?

Related