2023-06-23 03:12 AM - edited 2023-06-23 03:15 AM
Hello
I'm using NUCLEO-H503 to make an I3C master, and I have some issues.
1. I sent the ENTDAA command for I3C communication, but it does not go to HAL_I3C_STATE_READY.
The code written after several attempts is as follows.
HAL_I3C_Ctrl_DynAddrAssign(&hi3c1, &payload, I3C_RSTDAA_THEN_ENTDAA, timeout);
HAL_I3C_Ctrl_SetDynAddr(&hi3c1, DynAddr);
hi3c1.State = HAL_I3C_STATE_READY;
Is this a normal way to use the Library?
2. Please tell me how to read and write data on I3C slab.
For I2C, HAL_I2C_Master_Transmit and HAL_I2C_Master_Receive were used to communicate with the slave device.
Is there a function like this for I3C?
The function I found is HAL_I3C_Ctrl_Transmit, but do not work in my board.
Please let me know the functions you use for I3C communication and if you have a suitable example.
I am sorry for my poor English.
Solved! Go to Solution.
2023-07-06 06:43 AM - edited 2023-07-06 06:47 AM
Hello @sh.lee ,
I suggest you this code :
/* Assign dynamic address processus */
do
{
status = HAL_I3C_Ctrl_DynAddrAssign(&hi3c1, &payload[1], I3C_RSTDAA_THEN_ENTDAA, 5000);
if (status == HAL_BUSY)
{
HAL_I3C_Ctrl_SetDynAddr(&hi3c1, DynAddr);
}
TargetDesc1.TARGET_BCR_DCR_PID = (uint64_t) payload;
}while (status == HAL_BUSY);
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-06-23 03:57 AM
Here are the examples. You can find them also in the "repository" directory on your PC where the STM32H5 cube firmware has been installed.
https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H503RB/Examples/I3C
2023-06-23 11:34 AM
Dear @sh.lee ,
Here is our application Note that describes I3C vs I2C and practical examples and use case . In I3C we have Controllers and Targets and no more the old terminology used in legacy I2C .
have a great day
ciao
2023-07-06 06:43 AM - edited 2023-07-06 06:47 AM
Hello @sh.lee ,
I suggest you this code :
/* Assign dynamic address processus */
do
{
status = HAL_I3C_Ctrl_DynAddrAssign(&hi3c1, &payload[1], I3C_RSTDAA_THEN_ENTDAA, 5000);
if (status == HAL_BUSY)
{
HAL_I3C_Ctrl_SetDynAddr(&hi3c1, DynAddr);
}
TargetDesc1.TARGET_BCR_DCR_PID = (uint64_t) payload;
}while (status == HAL_BUSY);
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-07-06 06:53 AM
Hi @sh.lee ,
For I3C bus, there are four main types of devices :
• I3C main controller
• I3C secondary controller
• I3C targets
• Legacy I2C target
You can communicate using functions like :
HAL_I3C_Ctrl_Transmit()
HAL_I3C_Ctrl_Receive()
HAL_I3C_Tgt_Transmit()
HAL_I3C_Tgt_Receive()
For more details you can refer to the I3C application note ( section 9 Examples of I3C communications )
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-02-01 03:59 PM
When I used the code above, I was stuck in hi3c1.State=HAL_I3C_STATE_BUSY_DAA.
What should I do to return to HAL_I3C_STATE_READY?
2024-02-07 08:30 AM
Did you get this error also when using IT mode ? (I3C_Controller_ENTDAA_IT example in the cubefw)
Could you check the available examples in the STM32H5 CubeFW :
STM32Cube_FW_H5_V1.1.1\Projects\NUCLEO-H503RB\Examples\I3C
And for for more information about I3C communication you can check the I3C AN section 9.8 : Introduction to I3C for STM32H5 series MCU - Application note
Foued
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.