Receive data via uart with nrf5340

hello, I am currently working on a project that involves sending data via serial from a device to the nordic nr5340.

but I can't find an example that shows how it would be in this case, in the course it tells me to use the asynchronous api, but in this case it is to enter the parameters in the console, so I would like you to please tell me an example so that I can make the configuration.

Currently what I know is that a configuration must be made to specify the pins since by default the nrf5340 receives is through the gpios that are connected to the usb, however in the case of how the data is handled it is still confusing for me

So could you please tell me where to start.

Parents
  • Hello,

    What will you be communicating with? What are the requirements for your application? If low power is important, then I suggest you have a look at the Low Power UART(lpuart) sample.

    As you may know, if you click 'Browse' next to "Application template" in VS Code you can search for 'uart' to get a long list of relevant samples. However, we are happy to guide you further.

    Currently what I know is that a configuration must be made to specify the pins since by default the nrf5340 receives is through the gpios that are connected to the usb, however in the case of how the data is handled it is still confusing for me

    You may use an .overlay file to specify which pins to use for the UART on the nRF5340 DK. I could get back to you with an example.

  • hello, thanks for answering me, the connection will be with another board which transmits the information given by a sensor connected to it, through uart, at the moment they are a numerical data, my idea is that the nordic receives the information and prints it on the console at the moment.

  • Hi brando,

    I will get back to you with more details.

  • hello thanks for answering this problem too i tried to run the uart example from dev academy course but every time i build it gives me the following error:

    I tried to change the version, taking into account that in version 2.2.0 every time I build the application, some files are not generated in the zephir folder inside the build, but the error still persists, not only that but also when I try to pass it al nordic opens the folder where the segger part is, what do you suggest I do?

  • Hi brando,

    Sorry for the delay.

    brando14 said:
    every time i build it gives me the following error:

    Could you please check the build log from the 'terminal' tab in nRF Connect for VS Code?

    Sorry, I am a little confused regarding what you are working on. Is nRF5340 connected to a sensor or to another MCU that has a sensor connected to it? What would you like to do with the data you receive over UART on nRF5340?

  • Hello I have the next scenario:

    I work with two boards:

    Texas PCB: EVM430-FR6047 MCU018 PCB Rev A

    Nordic Semiconductor PCB: nRF5340 DK

    The texas board is connected with a ultrasonic sensor and sends the flow volume data through uart protocol. So the idea if forwarding the data coming from the MSP430 (ultrasonic flow sensor) to the nRF5340 DK for further processing via uart.

    So I am wiring both PCBs this way:

     J3: TXD (black cable) --> nRF5340 DK P1.15 

    J3: RXD (purple cable) --> nRF5340 DK P1.14

    I'm trying to use the dev academy example as a guide but it doesn't even work for me, it builds fine but every time I pass them to nordic it only opens the segger folder.

    .

  • brando14 said:
    when I try to pass it al nordic opens the folder where the segger part is, what do you suggest I do?

    The window should normally not pop up. What exactly do you click on when this occurs? Does this only happen with this specific application? Are you able to build and flash other samples, like the hello_world sample?

    brando14 said:
    it builds fine

    Could you try flashing the .hex file using nRF Connect for Desktop Programmer? Are you able to flash hello_world this way?

Reply
  • brando14 said:
    when I try to pass it al nordic opens the folder where the segger part is, what do you suggest I do?

    The window should normally not pop up. What exactly do you click on when this occurs? Does this only happen with this specific application? Are you able to build and flash other samples, like the hello_world sample?

    brando14 said:
    it builds fine

    Could you try flashing the .hex file using nRF Connect for Desktop Programmer? Are you able to flash hello_world this way?

Children
  • Hello, thank you very much for the help, Answering your questions:

    1) It only happens to me when I try to pass the uart example from devacademy to nordic and try to connect with the console, with any other example it works fine.

    2) I have not tried it but I will do that test, to have that option.

    On the other hand, over the weekend I tried only connecting the nordic to the pc without having the other board connected to the nordic, and if I was able to run the example correctly, I had left another query in another topic and where they already indicated another way to proceed to those kinds of cases.

    I don't know if it is because since the texas is sending data this could cause some interference, since the example uses the interface that is in the console, that is, the uart0.

  • Hi

    Håkon is currently unavailable, and I will handle your case in the mean time. 

    Can you give me a quick update what your status is at the moment? 

    Where you able to solve your issue through the other case?

    Best regards
    Torbjørn

Related