SPI drivers for MK12DN512, confusion between CMSIS and MCUXpresso SDK apis

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI drivers for MK12DN512, confusion between CMSIS and MCUXpresso SDK apis

935 Views
DeepakKukreja
Contributor III

Hi,

I am creating and application for the Kinetis MK12DN512VLK5 part. The application makes use of the ADC DAC and the SPI peripheral for communication.

I am new to the Cortex M ecosystem and have some doubts.

I am referring the MCUXpresso SDK examples to get a hang of the peripheral support available.

There are several structure and function definitions for programming the SPI peripheral are available in the

  • fsl_dspi_cmsis.h and the fsl_dspi_cmsis.c files as a well as
  • fsl_dspi.c and fsl_dspi.h

For creating and application what interfaces do I use? 

The MCUXPresso SDK API reference manual only documents the APIs and data structures in the fsl_dspi.c and fsl_dspi.h files, that too only very superficially.

One of the specific doubts that I have is if as an SPI slave if from my device I want to wait for incoming data from the master, then which function should I call:

  • ARM_SPI_Receive() which is a CMSIS function or
  • DSPI_SlaveTransferNonBlocking() which is defined in the fsl_dspi.c 

Also I am not able to find how the CMSIS peripheral functions:

  • Initialize
  • Send
  • Receive
  • Transfer

linked to the backend peripheral code.

I do not intend to use the DMA with the SPI data transfer since each transaction would involve upto 100 bytes

0 Kudos
2 Replies

897 Views
DeepakKukreja
Contributor III

Thanks Felipe,

I decided to use the CMSIS drivers, the issue I faced though was that the source in the fsl_dspi_cmsis.c is all disabled. I put a query seeking help here: https://community.nxp.com/t5/MCUXpresso-SDK/CMSIS-SPI-driver-code-disabled/m-p/1190991/highlight/tru...

What could be missing at my end

0 Kudos

903 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Deepak,

CMSIS drivers are Cortex Microcontroller Software Interface Standard (CMSIS) developed by ARM. This drivers defines generic peripheral driver interfaces for middleware making it reusable across a wide range of supported microcontroller devices. The API connects microcontroller peripherals with middleware that implements for example communication stacks, file systems, or graphic user interfaces. More information and usage method see http://www.keil.com/pack/doc/cmsis/Driver/html/index.html

fsl_xx.c drivers are NXP drivers that we offer for a variety of modules.

The decision of which want to use will totally depend on your application.

Best regards,

Felipe

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored. Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

------------------------------------------------------------------------------ 

0 Kudos