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

nRF9160 - send and receive user data bytes through SWD interface?

Hi.

As far as I know the SWD interface can be used to download/upload firmware and make debug, I would like to know if SWD also can make the function of sending and/or receiving user application data bytes, in my case this would be used to "configure the product", like it was acting as a serial port. Or will I need to have on the PCB an extra pin header for a UART communication? If yes, can I use 2-wire Uart? Tx and Rx only?

Regards.

Parents
  • Hi 

    The SWD interface can't be used to communicate directly with the application, but you can use the SWD interface to write to the memory of the nRF9160. Then it should be possible to reserve a small memory region in flash where you can write this configuration data, and then the application can read out the data later on when it is running. 

    Please note that this will not work if you have enabled the APPROTECT debug port protection, which you might want to enable in order to make it impossible for someone else to read out the memory content over the SWD interface. 

    If this configuration phase happens during production it should be possible to enable APPROTECT after you have written the configuration data. 

    Setting up a UART interface is also an option, either with or without flow control (4 or 2 pins). 
    A nice bonus of having a UART interface is that you can also use it to output serial logging information, in case you need to debug some software or hardware issue on your board. 

    Best regards
    Torbjørn

Reply
  • Hi 

    The SWD interface can't be used to communicate directly with the application, but you can use the SWD interface to write to the memory of the nRF9160. Then it should be possible to reserve a small memory region in flash where you can write this configuration data, and then the application can read out the data later on when it is running. 

    Please note that this will not work if you have enabled the APPROTECT debug port protection, which you might want to enable in order to make it impossible for someone else to read out the memory content over the SWD interface. 

    If this configuration phase happens during production it should be possible to enable APPROTECT after you have written the configuration data. 

    Setting up a UART interface is also an option, either with or without flow control (4 or 2 pins). 
    A nice bonus of having a UART interface is that you can also use it to output serial logging information, in case you need to debug some software or hardware issue on your board. 

    Best regards
    Torbjørn

Children
No Data
Related