Questions on using NXP S32K144 with nrF52840 for bluetooth communication

Hello Team, 

I have  board that I have build using NXPS32K144 and nRF52840 module. I am trying to communicate between the MCU and nRF52840 module via SPI. I would like to know the following:

1. Can you help me with the C library and example to enable me getting kick started with this project.

2. At the beginning I would like turn on an LED that I have connected via GPIO point of the nRF52840 module. Any sample codes for this please? 

3. Eventually, I would like to enable the Bluetooth communication between two boards that use the above MCU and 52840 modules and communicate. Do you have any sample codes for that? 

Your help is greatly appreciated. 

Looking forward to your response. 

Regards

Surya

Parents Reply Children
  • Thanks Pauleffect. 

    Hello Andreas:

    1. Thank you so much for providing useful information and links. 

    Some questions for you:

    1. I am using an another IDE (for the MCU that acts as a master/ Controller) to the nordic nrf52840 (that is acting as a slave/ peripheral). How do i import the drivers into my IDE from the spi slave example ? 

    2. What are the libraries that are required to make sure that my MCU can toggle a GPIO on the nordic nrf52840. 

    3. What is the exact sequence that I would need to do to import all the related libraries and low level spi codes so that I can communicated to the nordic module using my MCU. 

    Kindly let me know. 

    Regards

    SUrya

  • I am using S32 Design Studio as my IDE. As mentioned, I am using NXP S32k144 as my MCU. 

  • Zephyr is an unweildly beast  of ~ 5GB worth of boards, configuration files, overlays etc. There's no such thing as a drop and drop into S32 (like you can do with the SDKs you download off NXP's website). You need to clone a git repository and configure it manually. Nrf went with Nrf Connect in order for the customers to be able to get a board up and running in less than 30 minutes. I betcha that if you try building zephyr from sources yourself, it's gonna take you more than that (understatement). On another note, nrf does not support anything other than Visual Code and their extension for it.

    On the plus side, your NXP MCU could very well be an USB TTL or NASA's supercomuter, the 52840 does not know, nor does it care who it talks to. So I would propose the following (easy and quick) solution for you:

    Keep using S32 for your NXP target. Download visual code and install it, as per  instructions. Before diving into connectivity with NXP, wire a loopback SPI example. That is, set two spi instances on the same nrf board, connect the pins via jumper cables and get the comms up and running. After that, hook the jumpers to the NXP target.

    hal_nordic/nrfx/samples/src/nrfx_spim/blocking at 140140ea047f441fe076d26f79eb54dc9a38bcb6 · zephyrproject-rtos/hal_nordic (github.com)

    hal_nordic/nrfx/samples/src/nrfx_spim/non_blocking at 140140ea047f441fe076d26f79eb54dc9a38bcb6 · zephyrproject-rtos/hal_nordic (github.com) The DMA version.

    Anyway, back to the main point, and I can't stress this enough, get Visual Code. After you're comfortable with Zephyr and you actually get what's underneath the hood, well, you're free to use any IDE you wish. I, for example, use CLion for everything embedded (including NXP, via CMake). But trust me, I spent hoooooooours getting everything to work just right. And I'm not that much of a beginner in the field. It won't take you more than a week to familiarize yourself with Zephyr and the nrf connect, at least at the most basic of levels.

    As a personal note (and it's just my two cents, so please don't take this the wrong way), while the Nordic team is probably the friendliest and most helpful you're ever likely to interact with, this is not an arduino forum. You're going to get pointers, but asking stuff like "hey, how can I blink a led" usually won't net you a copy-paste ready piece of code. I mean, this is a customer support forum, not a public school.

    Kindly check the links provided and take those as a starting point.

    Regards.

  • Perfect. Thank you. I will try it out and keep you posted. 

    Regards

    Surya

Related