MKE06-SPI0configure

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

MKE06-SPI0configure

1,941 Views
binchengtao
Contributor I

Component documentation - Typical Usage

#define BLOCK_SIZE 4  uint8_t OutData[BLOCK_SIZE] = "0123"; uint8_t InpData[BLOCK_SIZE]; volatile LDD_SPIMASTER_TError ComError = 0U; LDD_TError Error; LDD_TDeviceData *MySPIPtr;  void main(void) {   ...   MySPIPtr = SM1_Init(NULL);                               /* Initialization of SM1 component */   SM1_SelectConfiguration(MySPIPtr, 1U, 1U);               /* Select chip select 1 and attribute set 1 */   Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */   Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE);    /* Start transmission/reception */   while (!SM1_GetBlockReceivedStatus(MySPIPtr)) {          /* Wait until data block is transmitted/received */     SM1_Main(MySPIPtr);   }   SM1_SelectConfiguration(MySPIPtr, 0U, 0U);               /* Select chip select 0 and attribute set 0 */   Error = SM1_ReceiveBlock(MySPIPtr, InpData, BLOCK_SIZE); /* Request data block reception */   Error = SM1_SendBlock(MySPIPtr, OutData, BLOCK_SIZE);    /* Start transmission/reception */   while (!SM1_GetBlockReceivedStatus(MySPIPtr)) {          /* Wait until data block is transmitted/received */     SM1_Main(MySPIPtr);   } }

Content of Event.c:

extern volatile LDD_SPIMASTER_TError ComError; extern LDD_TError Error; extern LDD_TDeviceData *MySPIPtr;  void SM1_OnError(LDD_TUserData *UserDataPtr) {   Error = SM1_GetError(MySPIPtr, (LDD_SPIMASTER_TError *)&ComError); /* Get communication errors if occured */ }

Why  SM1_OnError  and SM1_GetError not generate

According to the routine, did not achieve the expected function, how to solve?

Tags (1)
0 Kudos
Reply
7 Replies

1,802 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi bincheng,

Please check if you have enabled the Interrupt service/event.

SPI0 interrupt service event Enabled.png

GetError.png

OnError.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,802 Views
binchengtao
Contributor I

I use KDS software, but the interface is different from yours.1559707358(1).png1559707370(1).png

0 Kudos
Reply

1,802 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

You can switch Tab views:

Tabs view.png

0 Kudos
Reply

1,802 Views
binchengtao
Contributor I

Why is my software just not working?

2.png3.png

0 Kudos
Reply

1,802 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Did you have enabled the Interrupt service/event?

0 Kudos
Reply

1,802 Views
binchengtao
Contributor I

1.png

0 Kudos
Reply

1,802 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Really strange
Please check the attached project generated by KDS3.2

Best Regards,

Robin

0 Kudos
Reply