10-24-2023 10:23 AM
Hello i cant use BMI270 with NRF52. Pleas Help me. Cannt found any thıng.
here my code.
BMI2_INTF_RETURN_TYPE bmi2_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
(void)(intf_ptr);
static uint8_t txarr[500];
uint8_t rxarr[500];
txarr[0] = 0x80 | reg_addr;
nrf_drv_spi_transfer(&spi, &txarr[0], 1, rxarr, len+1 );
for (int i = 0; i < len+1; i++)
{
*(reg_data + i) = rxarr[i+1];
}
return BMI2_INTF_RET_SUCCESS;
}
BMI2_INTF_RETURN_TYPE bmi2_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
(void)(intf_ptr);
volatile static uint8_t txarr[5000];
txarr[0] = reg_addr;
for (uint8_t i = 0; i < len; i++)
{
txarr[i + 1] = *(reg_data + i);
}
nrf_drv_spi_transfer(&spi, &txarr[0], (uint16_t)len + 1 , (void *)0, 0);
return BMI2_INTF_RET_SUCCESS;
}void bmi2_delay_us(uint32_t period, void *intf_ptr)
{
nrf_delay_us(period);
}
10-24-2023 11:57 PM
Hi Mess,
I saw your msg in different loop. You got -9 error correct?
That means when you downloaded config file, there is some issue.
I assume your read write length is not enough for our default length 46.
Could you go common.c and change READ_WRITE_LEN value as 8?
Also, it would be great if you capture and share it to me.
Thank you.
10-25-2023 04:49 PM
Hello Minhwan
do you mean #define READ_WRITE_LEN UINT8_C(8) here?
i do but stil same 😞
i add picture. please help me
thank you for your ansver.
11-09-2023 08:35 PM
Hi @MESS ,
Sorry for late response.
Did you solve your issue? If not, could you capture your data and share it with me?
Thank you.
11-15-2023 10:16 AM
Merhaba Minhwan
hala bu sorunu yaşıyorum.
Hata [-9] : Yapılandırma yükleme hatası. Konfigürasyonun sensöre yüklenmesi sırasında arıza gözlemlendiğinde meydana gelir.
BMI270-Sensor-API kütüphanelerini kullanıyorum
Tüm kodlarımı ekliyorum.
ve bu benim yazma ve okuma işlevlerim.
BMI2_INTF_RETURN_TYPE bmi2_spi_read(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
(void)(intf_ptr);
statik uint8_t txarr[500];
uint8_t rxarr[500];
txarr[0] = 0x80 | reg_addr;
nrf_drv_spi_transfer(&spi, &txarr[0], 1, rxarr, len+1 );
for (int i = 0; i < len+1; i++)
{
*(reg_data + i) = rxarr[i+1];
}
BMI2_INTF_RET_SUCCESS'i döndür;
}
/*!
* SPI fonksiyon haritasını COINES platformuna yazar
*/
BMI2_INTF_RETURN_TYPE bmi2_spi_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
{
(void)(intf_ptr);
uçucu statik uint8_t txarr[500];
txarr[0] = reg_addr;
for (uint8_t i = 0; i < len; i++)
{
txarr[i + 1] = *(reg_data + i);
}
nrf_drv_spi_transfer(&spi, &txarr[0], (uint16_t)len + 1 , (void *)0, 0);
BMI2_INTF_RET_SUCCESS'i döndür;
}
Bana yardım için teşekkür ederim 🙂