Capturing Modem Trace on ARM System

Hi Team!

I need to capture a modem trace over a long period of time while driving around, and there is no way my laptop's battery can handle that. I thought I'd use a Raspberry Pi and a big power bank, but unfortunately nRF Toolkit doesn't work on ARM based Linux systems. Is it possible to capture the raw modem trace on a system and then feed it to trace collector?

Kind Regards,
Iman Biglari

Parents Reply Children
  • AFAIK, Nordic "always" asks about modem traces, but I'm not aware, that this long lasting issue about consolidating "long term modem traces" has been solved. I'm not even sure, if it's possible at all to read such long traces, if it's more than a few hours and MBs.

    In the meantime (I use NCS 2.9.2), the modem trace function comes with some more options. Especially the one using an external flash is pretty nice. It records the trace and to read it out, it just writes that to the UART and so it's possible to read it with the cellular monitor.

    If you want to use it with other boards than the DKs, you may need to add your boards to the "nrf/snippets/nrf91-modem-trace-ext-flash". One pitfall doing so may be the "CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE" and the "CONFIG_NRF_MODEM_LIB_TRACE_FLASH_SECTORS" which both must fit to the flash size.

    But it requires an external flash and is also limited by the size of the flash and the selected level.

  • Hi Achim Slight smile

    I think one of the more plausible and flexible ways to extract valid modem traces in the field with minimal effort is the solution suggested by ibiglari. To cache / intermediately store the trace bit by bit on an external device via UART (same process you'd use to get it in the lab, but mobile) and then convert it / play it back to a nrfutil compatible System at a later time. But I agree with you, I can't find a cohesive and well documented way of achieving this. I'm sure we'll figure it out soon, but some documentation and a sample to help more easily gather modem traces from field devices would be greatly appreciated. I'll try to make a post / guide as soon as I've figured out a way to reliably get the trace collection via ARM-device working.

  • For those who come after:

    the process is very simple in the end:

    1. On the ARM device, you need an FTDI cable capable of 1Mbaud communication.

    2. Plug this cable into one of the USB ports in the ARM device

    3. capture the raw input from the serial connection that opened when plugging in the cable. I recommend going as simple as possible; the following line worked for me:

    configure the serial device:
    stty -F {device_path} {baud_rate} raw -clocal -crtscts
    save the modem trace coming through the serial connection to your log file:
    cat {device_path} > {log_file}
    
    example:
    stty -F /dev/ttyUSB0 1000000 raw -clocal -crtscts
    cat /dev/ttyUSB0 > filename.bin

    4. then copy the .bin file to a non-ARM platform of your choice.

    5. Make sure you have nrfutil installed (download, move to path, make executable)

    6. make sure you have the correct plugin installed:

    nrfutil install trace

    7. convert the .bin file into a pcapng file using the nrfutil trace command:

    nrfutil trace lte --input-file /path/to/filename.bin --output-pcapng /path/to/wireshark_capture.pcapng

    8. Done. The trace can now be analysed as a wireshark capture.

    hope this helps. variations and other complementary info can be found in the nrfutil documentation

Related