FRDM-MCXN947 i2c function with the multi-face detection cannot run in non-blocking mode

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

FRDM-MCXN947 i2c function with the multi-face detection cannot run in non-blocking mode

Jump to solution
516 Views
CarlLee
Contributor III

Dear all, @Alex_Wang  and @Alice_Yang,

1) I have put the i2c FLEXCOMM9 function into multi-face detection demo code.

2) I have two files " i2cTest.c " and " i2cTest.h " prepared to test the i2c function in the multi-face detection code.

3) I also modify the code in the main.cpp that only add the two lines " #include "i2cTest.h" " and " test() " into it.

4) "test()" is added to be the first line in main() such that only the uart and the i2c FLEXCOMM9 is inited.

5) After build, download, run the code, the i2c function is failed to run.

6) Then, I change the i2c function to blocking mode 

" reVal = LPI2C_MasterTransferBlocking(EXAMPLE_I2C_MASTER, &masterXfer); "

 

The i2c in blocking mode is function correctly.

 

But I need to run the i2c in non-blocking mode. So is there anything I need to modify to enable

the i2c non-blocking mode in the multi-face detection code?

 

The files are attached below.

 

Please advise,

Regards,

Carl

Labels (1)
0 Kudos
1 Solution
45 Views
CarlLee
Contributor III

Dear @Alice_Yang,

I modify the project such that dual cores are used and add the i2c devices to the second core. The i2c is function well.

 

Thanks for your help.

Regards,

Carl 

View solution in original post

0 Kudos
4 Replies
464 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @CarlLee 

We have ported your files into led_blinky demo, Flexcomm9 works well as I2C. Also attach the project for you.

You can refer to this project to porting to multi-face. If it still doesn't work, try to porting the code from multi-face to led_blinky project.

 

BR

Alice

 

0 Kudos
439 Views
CarlLee
Contributor III

Dear @Alice_Yang

  Thank you for your reply.

  Before putting the i2c function code into the face detection code, I already test the i2c function by creating a blank project and copy and paste the i2c code to it and try to understand it. The code is worked properly.

  I already ignore all the code in face detection and run the i2c code only (Start the i2c code before any face detection code.), but the i2c non-blocking code is not function.  

  Are there any setting (startup or project settings) used by face detection affect the Flexcomm9 i2c function?

  Since this new face detection code is written in C++ (the old one is written in C), is there anything I need to do before the i2c non-blocking mode can run?

  I already spend some time to study the startup code and project settings of the face detection demo but still don't find any clue.

  It is impossible for me to port the face detection code to led_blinky project. (I do not know how to debug it when error occurred.)  I can only do is to add code to the face detection demo. 


Please advise,

Regards,

Carl

0 Kudos
428 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @CarlLee 

How about opening an issue on GitHub ACH repository? The author of this application know it better.

https://github.com/nxp-appcodehub/dm-multiple-face-detection-on-mcxn947  

 

BR

Alice

 

 

0 Kudos
46 Views
CarlLee
Contributor III

Dear @Alice_Yang,

I modify the project such that dual cores are used and add the i2c devices to the second core. The i2c is function well.

 

Thanks for your help.

Regards,

Carl 

0 Kudos