ICM20948
ICM20948 copied to clipboard
ICM20948.c and ICM20948.h doesn't have two functions
ICM20948.c and ICM20948.h doesn't have two functions which are used in code example: ICM_ReadAccelGyroData() ICM_ReadMagData(mag_data)
So as a reason of if there are two build errors:
/STM32CubeIDE/workspace_1.0.1/SPI_IMU/Debug/../Core/Src/main.c:115: undefined reference to ICM_ReadAccelGyroData' /STM32CubeIDE/workspace_1.0.1/SPI_IMU/Debug/../Core/Src/main.c:119: undefined reference to
ICM_ReadMagData'
Hi! In function ICM_readBytes(uint8_t reg, uint8_t *pData, uint16_t Siz) you should add after HAL_SPI_Transmit_DMA(SPI_BUS, ®, 1); and HAL_SPI_Receive_DMA(SPI_BUS, pData, Size); also this line: while (HAL_SPI_GetState(SPI_BUS) != HAL_SPI_STATE_READY); In my case is it help me)