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

nRF9160: LTE Sensor Gateway on Thingy:91

I am trying to fun the LTE Sensor Gateway on the Thingy:91.

The boards are missing from zephyr so I copied nrf52840_pca20035 and nrf9160_pca20035 from ncs\nrf\boards\arm.

When running samples/bluetooth/hci_uart.

The BLE and UART don't seem to be configured correctly. I get "warning: BT_CTLR_DTM_HCI" and "warning: BT_CTLR_ASSERT_HANDLER".

I created ncs\zephyr\samples\bluetooth\hci_uart\nrf52840_pca20035.overlay based on https://devzone.nordicsemi.com/f/nordic-q-a/51693/hci_uart-on-thingy-91

This still doesn't work.

Adding the lines below to nfr52840_pca20035\Kconfig.defconfig seem to fix the BLE issues? UART is not working so, I don't know if it is working.

config BT_CTLR
default BT

When running samples/nrf9160/lte_ble_gateway I get errors "warning: UART_2_NRF_UARTE" and "warning: UART_2_NRF_FLOW_CONTROL"

I see that nrf9160_pca20035ns.overlay is missing from the folder but I am not sure how to modify it. There is no status light configured. 

Help?

Parents
  • Hi,

    The Thingy:91 is not configured for this use-case at this time. A colleague of mine tested this a couple of days ago, and here it the changes/files used:

    thingy_91_lte_changes.zip

    nrf_changes.diff applies to ncs/nrf

    zephyr_changes.diff applies to ncs/zephyr

    nrf52840_pca20035.conf and .overlay should be placed in ncs/zephyr/samples/bluetooth/hci_uart/

    nrf9160_pca20035.overlay should be placed in ncs/nrf/samples/lte_ble_gateway/

    Use Segger RTT viewer to view the log output. Note that you need to manually keep the nRF52 in reset for several seconds before releasing it. Holding it in reset is done by grounding TP8 (apply patch to enable reset pin). On the nRF91-DK we are using a GPIO line between the nRF52 and nRF91 in order to reset the nRF52. I believe it should be possible to add this functionality to the thingy:91 as well, by using one of the lines originally used by the UART, e.g. pin 20. But there are some bugs on the master branch at the moment, so this reset functionality is currently not working reliably.

  • I don't see the device show up on nRF Cloud. I also am not able to see anything on the RTT viewer. 

  • Hey Sigurd,

    First of all, thanks for all your help.

    I can confirm the results that Dheeraj posted above, even with the default hex files that you provided the Thingy91 crashes with the same crash logs that Dheeraj provided.

    This is blocking our team as well.

  • Hi,

    The following steps works for me:

    Turn Thingy91 on, and plug in the 10-pin programming cable.

    Set the SWD select switch to nRF52, and program the nRF52:

    nrfjrpog -e
    nrfjprog -f nRF52 --program hci_uart_with_usb_uart_bridge_nrf52840_pca20035.hex --verify --reset

    Set the SWD switch to nRF91, and program the nRF9160:

    nrfjrpog -e
    nrfjprog -f nRF91 --program lte_ble_gateway_nrf9160_pca20035ns.hex --verify --reset

    Turn Thingy91 off. Remove 10-pin programming cable.

    Plug the USB cable into the Thingy91.

    Turn Thingy91 on.

    Open LTE link monitor, and select PCA20035.

    Again, note that the COM-port is re-enumerated if the nRF9160 resets the nRF52840. So you might need to select PCA20035 in LTE link monitor a second time when this happens.

    This patch was for UART logging. I have not tested Segger RTT logging with this patch.

  • Okay I am trying it again this morning and I have had a little bit of luck, following your directions exactly I can get the Thingy91 to boot up and blink blue LEDS then blue and red LEDS.

    This is with one caveat - I have to have the Thingy91 plugged in to my computer via USB. It appears that if I unplug the USB cable from the Thingy91 and attempt to reboot the device, it will fail.

  • This is with one caveat - I have to have the Thingy91 plugged in to my computer via USB. It appears that if I unplug the USB cable from the Thingy91 and attempt to reboot the device, it will fail.

    You are correct. In the original usb_uart_bridge sample, the nRF52840 is just put into system OFF sleep mode when there is no USB connected. But in our use-case with the LTE gateway, we need the nRF52840 powered on for the BLE HCI.

    Should be a simple fix for this, in hci_uart_with_usb_uart_bridge, modify the function power_thread() in main.c to look someting like this:

    void power_thread(void)
    {
    	while (1) {
    		if (!nrf_power_usbregstatus_vbusdet_get()) {
    			//nrf_power_system_off
    			k_sleep(100);
    		}
    		k_sleep(100);
    	}
    }

    I have not tested this, but alternatively we could perhaps just remove the power thread functionality completely, if the nRF52840 is on all the time anyways.

    I hope this helps. Let me know how it goes.

  • Thank you Sigurd, will attempt this as soon as I can.

    UPDATE: After applying the power thread related patch above, things appear to be working well. Testing continues, will let you know if I encounter additional issues.

Reply Children
No Data
Related