2017-03-13 07:08 AM
Hi,
I need to use SMBus in a project and have come across the X-Cube-SMBus. There are no details given as to how to use CubeMX to integrate this library into my project. I use CubeMX in all my projects.
Can someone tell the appropriate steps/settings to be done in CubeMX to correctly use this library. Also, how to use this library, do I add all the files into my project as source files and I'm done?
I'm using an STM32F302r8-NUCLEO dev board on a windows machine.
#f3 #stm32f3 #smbus2017-03-13 09:18 AM
Hi
shreeyak
,Your request is forwarded to our MX team forchecking .
-Nesrine-
2017-03-13 02:45 PM
Alright! Thanks! Hope to get a reply soon!!
2017-10-05 04:03 PM
I'm also having issues using this library. I have tried to set it up similarly to the example in the STM32F072B-Discovery project in the x-cube-smbus Projects but I can't get anything out of the system.
Here is my initialization code:
/* USER CODE BEGIN 2 */
//HAL_SMBUS_EnableListen_IT(&hsmbus1); hsmbus1.pBuffPtr = context.Buffer;context.CMD_table = COMMANDS_TAB;
context.CMD_tableSize = 2; //COMMANDS_TAB_SIZE; context.Device = &hsmbus1; context.SRByte = 0x55; context.CurrentCommand = NULL; context.StateMachine = SMBUS_SMS_ARP_AR; context.OwnAddress = 0x10;STACK_SMBUS_Init(&context);
piobuf = STACK_SMBUS_GetBuffer( &context );
if (piobuf != NULL ) { HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, 1); for (int index = 0; index < STACK_NBYTE_SIZE; index++) { piobuf[index] = 0; } }But I get nothing when I try to do an SMBUS read with command. I see the address phase go out on the smbus, but the device never gets the command byte, I think the device may be stretching the clock during the ACK phase and never acking.
Are there any simple examples on how to get this library working? With just a few simple commands implemented, as an SMBUS Slave?
Thanks!
Mike
2018-01-16 12:42 AM
Hi
Sajjan.Shreeyak
andmike.panetta
,You can find some examples under STM32Cube\Repository\STM32Cube_FW_F3_V1.8.0\Projects\STM32303C_EVAL\Examples\SMBUS.
And to help you, you can read those threads :
I hope it will help you.
BR. Jeanne