How to increase RTT download buffer in Modem Shell

I am trying to program modem keys using pylink and Modem_Shell with RTT enabled and it is almost working.

I find that the maximum download size for a command that I send is 32. How do I increase this?

JLink Viewer allows me to send a large string with no problems. That makes me think the problem is in pyLink, but they state that the size comes from the nrf9160. I do not see where the size is set or how I can change the download buffer.

Ive attached the script. It installs the Modem_Shell and has other support files.

Thanks,

Rich

Nordic_20250919.zip

  • I actually figured this part out... dice up the output with a little delay between chunks. Still not quite working, but getting closer.

    def cmdToRTT(data_to_write):
        print ("RTT>>" + data_to_write)
        data_to_write = data_to_write + "\n"
        byteData_to_write = data_to_write.encode('utf-8')
        for i in range(0, len(byteData_to_write), 30):
            print (byteData_to_write[i:i+30])
            bytesWritten = jlink.rtt_write(0, byteData_to_write[i:i+30])
            print (i, bytesWritten," Bytes were written")
            time.sleep(1)

  • Hi,

     

    Glad to hear that you found a solution to your problem. What you can also check is the buffering setting on the nRF, specifically this one:

    CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN

     

    RTT is mostly used from nRF->PC, so the buffering from PC->nRF is kept smaller.

     

    Kind regards,

    Håkon

Related