Code: Select all
PANIC [mag_ist8310] i2c_lld_master_transmit_timeout
Core registers:
CONTROL 2
IPSR 0
APSR 600000
The code I wrote is as follows,
Code: Select all
static auto& I2C = I2CD1;
int write(std::uint8_t reg, std::uint8_t val)
{
const std::array<uint8_t, 2> tx{ reg, val};
return int(i2cMasterTransmitTimeout(&I2C,
HAL_COMPASS_IST8310_I2C_ADDR,
tx.data(),
tx.size(),
nullptr,
0,
TIME_INFINITE));
}