I'm using the zmod4410, I can read out sensor tracking number, sensor trimming data, sensor pid, but when I read results, use the following function:
void read_and_verify(zmod4xxx_dev_t* sensor, uint8_t* result, char const* id) { /* Verify completion of measurement sequence. */ ret = zmod4xxx_read_status(sensor, &zmod4xxx_status); if (ret) { HAL_HandleError(ret, "Reading sensor status"); } /* Check if measurement is running. */ if (zmod4xxx_status & STATUS_SEQUENCER_RUNNING_MASK) { /* Check if reset during measurement occured. For more information, * read the Programming Manual, section "Error Codes". */ ret = zmod4xxx_check_error_event(sensor); switch (ret) { case ERROR_POR_EVENT: HAL_HandleError(ret, "Reading result: Unexpected sensor reset!"); break; case ZMOD4XXX_OK: HAL_HandleError(ret, "Reading result: Wrong sensor setup!"); break; default: HAL_HandleError(ret, "Reading result: Unknown error!"); break; } } /* Read sensor ADC output. */ ret = zmod4xxx_read_adc_result(sensor, result); if (ret) { HAL_HandleError(ret, "Reading ADC results"); }
/* Check validity of the ADC results. * - ERROR_POR_EVENT: An unexpected reset appeared * - ERROR_ACCESS_CONFLICT: ADC data was read while the sensor was running * For additional information refer to section "Error Codes" in * Programming Manual. */ ret = zmod4xxx_check_error_event(sensor); if (ret) { HAL_HandleError(ret, "Reading ADC result status"); }}
The return value of zmod4xxx_check_error_event is -7 wich means ERROR_POR_EVENT and results are all 0.
I'm using the example Renesas-ZMOD4410-IAQ_2nd_Gen-Firmware-4.2.0.zip which from renesas official website.
We built 4 prototypes and all of them turned out to be this phenomenon.
My MCU is ERF32BG21.
Is there any Renesas counting support, and may I ask why this is happening?