ICM20948 icon indicating copy to clipboard operation
ICM20948 copied to clipboard

ICM20948.c and ICM20948.h doesn't have two functions

Open ghost opened this issue 5 years ago • 1 comments

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'

ghost avatar Aug 05 '19 12:08 ghost

Hi! In function ICM_readBytes(uint8_t reg, uint8_t *pData, uint16_t Siz) you should add after HAL_SPI_Transmit_DMA(SPI_BUS, &reg, 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)

raf329 avatar Jun 20 '20 17:06 raf329