I've been trying to use lpi2c for rtos to establish communication between mx rt1021 and arduino uno. I used the freertos_lpi2c demo app to make sure my hardware setup was correct and it worked just fine. I transferred that code into a larger project which uses the powermode_switch demo application rtos settings, but the code won't work in the new project. When the code reaches the lpi2c_transfer function, all tasks get suspended and transfer won't complete, even with error. I am a little lost because all of the code is the same and the hardware setup is the same as well. Are there any settings in the powermode_switch demo app that would affect i2c communication?
All of the code can be found in "peripherals.c" and "idle_task.c" at the link provided below, if it is of any help.
https://github.com/AA-CubeSat-Team/soci_cdh_rtos/tree/dev_idleTask/cdh_prototype
Hi,
According to your description, the idle_task seems like fail to transmit the data via the I2C interface.
If my understanding is right, I'd like to suggest you just initialize the I2C_1, then give it a try again.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Yes that's correct.
I've initialized the I2C_1 interface and made sure that all of the routing details are the same as when I run the demo project, but this still doesn't fix the problem.
Hi,
Thanks for your reply.
I was wondering if you can upload a simple demo project based on freertos_lpspi_b2b_master that can replicate the issue, then I can test it on my board and figure it out.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Thank you for your help.
Just to clarify, you would like me to switch to lpspi? Or upload the demo project code I've been using for lpi2c?
Hi,
Thanks for your reply.
1) Just to clarify, you would like me to switch to lpspi? Or upload the demo project code I've been using for lpi2c?
-- I'm sorry for the above typo error, I was wondering if you can upload a simple demo project based on freertos_lpi2c that can replicate the issue.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Hi,
Thanks for your reply.
The LPI2C_RTOS_Transfer function will haven't returned the kStatus_Success flag when the slave device doesn't give the correct response.
In another word, the LPI2C_RTOS_Transfer function will fail to transfer the complete data, just as the below shows, the slave device can't give ACK to the master device during the interaction process.
So I'd like to suggest to check the slave device work well.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
Before answering your question, I was wondering if you can list the steps of merging code in detail.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------
Thank you for your reply.
The code was copied and pasted into the demo app project environment. The only differences are that the initialization code for I2C1 itself is placed in a separate function which is called from main before tasks are created and the scheduler is started. This also includes setting the clock speed and priority at nvic.