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

I am running one mesh light and 3 mesh switch for a successful mesh demo with nRF5340 DKs. Next is implement UART0 simple communication on the mesh light board. How should I do UART init and basic TX/RX ?

Just no clue on including the proper files, initialization and how to use API in main or handler. My intent is once a led is on trigged by a button pressed up from the other board I should send some characters through the UART0 in application core. Thanks for the help!

Parents Reply Children
  • Hey Qtang! Sorry for the delay!

    I would suggest taking a look at our Mesh Chat example in the nRF Connect SDK, and see how sending characters through a mesh network is implemented there. This will also show you what files are necessary to include etc. To start off you could try to to combine this with what you already have. 

    Best regards,

    Elfving

  • Thanks! Elfving,

    I am trying to combine hci_lpuart and light together. However I am struggling add a hci_raw.ca file into zephyr host project under light. Looks like "path" error which SDK Segger 1.7.0 could not find the files.

    Where is the place to add paths under Preprocessor?

    Quite embarrassed on this.

    Best.

    Qi 

  • Hey Qtang!

    No worries, all questions are allowed here!

    First of all, that error could be caused by several things. There might have been a missing library (you might have to merge the prj.conf files of the two projects) and there might have been a missing path (update CMakeLists.txt). For more info on configurations like these, see this tutorial. The second part might be more relevant to this subject, but I would recommend the entire thing.

    Though I now see that the Mesh Chat example wasn't really what you were looking for, but I don't think that the hci_lpuart is either. Do you want one of the switches to make the light node send characters through UART? Hci_lpuart implements a bluetooth controller. The regular lpuart example might be more along the lines of what you need. 

    Best regards,

    Elfving

  • Elfving,

    I am make progress on send out characters through UART0 under mesh light sample. But I want to know more details on receiving messages from UART0 as sending stuff requires no any code merge.

    I could see lpuart here: \ncs\v1.6.1\nrf\samples\peripheral\lpuart

    But I could not find an option under SDK project window with lpuart and that is the reason I chose hci-_lpuart. Could you give me clues on this?

    Thanks a lot!

    Qi

  • Hey Qtang!

    qtang said:

    But I could not find an option under SDK project window with lpuart and that is the reason I chose hci-_lpuart. Could you give me clues on this?

    You couldn't find it in the project drop-down menu? If not then you can allways find the folder yourself using the options button and then browsing through to nrf/samples/peripheral/lpuart.

    Was this what you were asking?

    Best regards,

    Elfving

Related