I am writing a program to talk to a device in the UEFI shell through Edk2. I've successfully been able to write and read to the bus through EFI_I2C_MASTER_PROTOCOL but for whatever reason at the end of every write it sends an extra byte of 0. I am wondering if it has to do with SmBus appending a byte for PEC but regardless is there any way to write without that extra byte? Thank you for your time, have a great day!
Hi, how can you write and read to the bus through EFI_I2C_MASTER_PROTOCOL ? Is there any sample code? Does it need to set acpi table?
I didn't have to set the acpi table. I was able to just call LocateHandleBuffer and OpenProtocol on the Udoo x86. Then I would use the StartRequest api with the parameters I prefer. i2c_master_protocol->StartRequest
You can write a UEFI application by using Edk2 on another platform and copying the binary executable to a thumb drive and execute it from the UEFI shell. To create the executable, you'll need to call open LocateHandleBuffer using the I2C master guid provided in Edk2. Then you'll want to go through the handle buffer and using the I2CMaster driver to send data by configuring i2c_master_protocol->StartRequest with the parameters found in the UEFI spec on UEFI.org. If you don't know how to get started on writing UEFI applications, I recommend going through the tianocore tutorial found on the tianocore GitHub.