This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

hts 221 ERROR 4 [NRF_ERROR_NO_MEM]

Hi!

I am developing a network of temperature and humidity sensors, using nrf52832 and hts221 with the ide ses ... for this, I am using thingy 52 as a peripheral that sends the data to a central. When trying to read the hts221 sensor, I receive the ERROR 4 on the console. I checked the code again and again, but I can't find out what I'm doing wrong.
I'm using SDK16, thingy 52 1.0.1 and delete the thingy firmware using nrfjrog and then upload my own firmware.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//
// Set up the TWI instance for the HTS221 sensor
//
/* TWI instance ID. */
#define TWI_INSTANCE_ID 0
#define MAX_PENDING_TRANSACTIONS 33
NRF_TWI_MNGR_DEF(m_nrf_twi_mngr, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID);
NRF_TWI_SENSOR_DEF(m_nrf_twi_sensor, &m_nrf_twi_mngr, HTS221_MIN_QUEUE_SIZE);
HTS221_INSTANCE_DEF(m_hts221,&m_nrf_twi_sensor,HTS221_BASE_ADDRESS);
// TWI (with transaction manager) initialization.
static void twi_config(void)
{
uint32_t err_code;
nrf_drv_twi_config_t const config = {
.scl = 8,
.sda = 7,
.frequency = NRF_DRV_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_LOWEST,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



1 2