Associate II
October 6, 2017
Question
X-CUBE-SMBUS Does not work with CubeMX (STM32F072RB)
- 2 replies
- 887 views
Posted on October 06, 2017 at 22:22
I've tried everything I can think of, but I can't get the library to work at all. I see on my oscilloscope where it tries to get data from the device (I am using STM32F072RB as SMBUS SLAVE), but it never gets what I try to send. Attaching my code below.
Are there any examples of how to get SMBUS working with CubeMX software?
I put some prints in the lib code and here is what I get... Why does it think I want SMBUS QUICK transfer? I am not sending a quick, I am sending a read byte request with command....
The following is 2 attempted transfers:
SMBUS_Slave_ISR
SMBUS_FLAG_ADDRCall HAL_SMBUS_AddrCallback()HAL_SMBUS_AddrCallback()Call STACK_SMBUS_AddrAccpt()STACK_SMBUS_AddrAccpt()MATCH? 44:44MATCHComplete, ret: SUCCESSELSEWRITEComplete...SMBUS_Slave_ISRSMBUS_FLAG_ADDRCall HAL_SMBUS_AddrCallback()HAL_SMBUS_AddrCallback()Call STACK_SMBUS_AddrAccpt()STACK_SMBUS_AddrAccpt()MATCH? 44:44MATCHComplete, ret: SUCCESSELSEREADCall STACK_SMBUS_ExecuteCommand() Where does this go?:(
STACK_SMBUS_ExecuteCommand(0x20003fa8) Time to make the donuts!context: 0x20003fa8, Buffer: 0x20003fcb, piobuf: 0, CurrentCommand: 0, state: 4aSMBUS_FLAG_STOPFHAL_SMBUS_ListenCpltCallback()Call HAL_SMBUS_ExecuteCommand() FOR SMBUS_SMS_QUICK_CMD_WSTACK_SMBUS_ExecuteCommand(0x20003fa8) Time to make the donuts!context: 0x20003fa8, Buffer: 0x20003fcb, piobuf: 0, CurrentCommand: 1, state: 1Got command 0x01HAL_SMBUS_ListenCpltCallback() - COMPLETEComplete...SMBUS_Slave_ISRComplete...SMBUS_Slave_ISRSMBUS_FLAG_ADDRCall HAL_SMBUS_AddrCallback()HAL_SMBUS_AddrCallback()Call STACK_SMBUS_AddrAccpt()STACK_SMBUS_AddrAccpt()MATCH? 44:44MATCHComplete, ret: SUCCESSELSEWRITEComplete...SMBUS_Slave_ISRSMBUS_FLAG_ADDRCall HAL_SMBUS_AddrCallback()HAL_SMBUS_AddrCallback()Call STACK_SMBUS_AddrAccpt()STACK_SMBUS_AddrAccpt()MATCH? 44:44MATCHComplete, ret: SUCCESSELSEREADCall STACK_SMBUS_ExecuteCommand() Where does this go?:(
STACK_SMBUS_ExecuteCommand(0x20003fa8) Time to make the donuts!context: 0x20003fa8, Buffer: 0x20003fcb, piobuf: 0, CurrentCommand: 1, state: 4aGot command 0x01SMBUS_FLAG_STOPFHAL_SMBUS_ListenCpltCallback()Call HAL_SMBUS_ExecuteCommand() FOR SMBUS_SMS_QUICK_CMD_WSTACK_SMBUS_ExecuteCommand(0x20003fa8) Time to make the donuts!context: 0x20003fa8, Buffer: 0x20003fcb, piobuf: 0, CurrentCommand: 1, state: 1Got command 0x01HAL_SMBUS_ListenCpltCallback() - COMPLETEComplete...SMBUS_Slave_ISRComplete...Attached is my code in zip form.
Thanks for any help!
Mike
#x-cube-smbus