bring up test failed, power supply test and clock test... park here

This commit is contained in:
Yunhorn 2024-05-07 19:19:41 +08:00
parent dbb729a605
commit 41a5d983ea
7 changed files with 55 additions and 22 deletions

View File

@ -122,7 +122,8 @@ static void acc_hal_integration_sensor_transfer(acc_sensor_id_t sensor_id, uint8
static void acc_hal_integration_sensor_power_on(acc_sensor_id_t sensor_id) static void acc_hal_integration_sensor_power_on(acc_sensor_id_t sensor_id)
{ {
(void)sensor_id; // Ignore parameter sensor_id (void)sensor_id; // Ignore parameter sensor_id
PME_ON;
HAL_Delay(5);
HAL_GPIO_WritePin(A111_ENABLE_GPIO_Port, A111_ENABLE_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(A111_ENABLE_GPIO_Port, A111_ENABLE_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(A111_CS_N_GPIO_Port, A111_CS_N_Pin, GPIO_PIN_SET); HAL_GPIO_WritePin(A111_CS_N_GPIO_Port, A111_CS_N_Pin, GPIO_PIN_SET);

View File

@ -83,7 +83,7 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin : PtPin */ /*Configure GPIO pin : PtPin */
GPIO_InitStruct.Pin = A111_SENSOR_INTERRUPT_Pin; GPIO_InitStruct.Pin = A111_SENSOR_INTERRUPT_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING; GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_PULLDOWN; GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(A111_SENSOR_INTERRUPT_GPIO_Port, &GPIO_InitStruct); HAL_GPIO_Init(A111_SENSOR_INTERRUPT_GPIO_Port, &GPIO_InitStruct);
@ -123,6 +123,9 @@ void MX_GPIO_Init(void)
HAL_NVIC_SetPriority(A111_SENSOR_INTERRUPT_EXTI_IRQn, 0, 0); HAL_NVIC_SetPriority(A111_SENSOR_INTERRUPT_EXTI_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(A111_SENSOR_INTERRUPT_EXTI_IRQn); HAL_NVIC_EnableIRQ(A111_SENSOR_INTERRUPT_EXTI_IRQn);
HAL_NVIC_SetPriority(EXTI3_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
#else #else
/* EXTI interrupt init*/ /* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0); HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);

View File

@ -102,12 +102,7 @@ int main(void)
MX_LoRaWAN_Init(); MX_LoRaWAN_Init();
do //STS_Lamp_Bar_Self_Test_Simple();
{
STS_SENSOR_Function_Test_Process();
} while(0);
STS_Lamp_Bar_Self_Test_Simple();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */

View File

@ -356,6 +356,7 @@ void DMA1_Channel7_IRQHandler(void)
/** /**
* @brief This function handles EXTI Lines [9:5] Interrupt. * @brief This function handles EXTI Lines [9:5] Interrupt.
*/ */
#if 1
void EXTI9_5_IRQHandler(void) void EXTI9_5_IRQHandler(void)
{ {
/* USER CODE BEGIN EXTI9_5_IRQn 0 */ /* USER CODE BEGIN EXTI9_5_IRQn 0 */
@ -368,7 +369,7 @@ void EXTI9_5_IRQHandler(void)
#endif #endif
/* USER CODE END EXTI9_5_IRQn 1 */ /* USER CODE END EXTI9_5_IRQn 1 */
} }
#endif
/** /**
* @brief This function handles SPI1 Interrupt. * @brief This function handles SPI1 Interrupt.
*/ */

View File

@ -43,7 +43,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result);
int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result) int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
{ {
uint8_t t=0; uint8_t t=0;
uint8_t test_result[12]={0x0}; uint8_t test_result[20]={0x0};
APP_LOG(TS_OFF, VLEVEL_H,"-- 0 -- Acconeer software version %s\n", acc_version_get()); APP_LOG(TS_OFF, VLEVEL_H,"-- 0 -- Acconeer software version %s\n", acc_version_get());
@ -62,8 +62,6 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
// Enable and run: Read Test // Enable and run: Read Test
acc_rss_assembly_test_configuration_communication_read_test_enable(configuration); acc_rss_assembly_test_configuration_communication_read_test_enable(configuration);
if (!run_test(configuration)) if (!run_test(configuration))
{ {
test_result[t++] = 0; //(3) test_result[t++] = 0; //(3)
@ -104,9 +102,45 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 1; test_result[t++] = 1;
} }
APP_LOG(TS_OFF, VLEVEL_H,"-- Interrupt Test --- End ********************\r\n");
acc_rss_assembly_test_configuration_communication_interrupt_test_disable(configuration); acc_rss_assembly_test_configuration_communication_interrupt_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Interrupt Test --- End ********************\r\n");
// Enable and run: Clock Test
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- Start ********************\r\n");
acc_rss_assembly_test_configuration_clock_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; // (8)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
} else {
test_result[t++] = 1;
}
acc_rss_assembly_test_configuration_clock_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- end ********************\r\n");
// Enable and run: Power cycle test
APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- Start ********************\r\n");
acc_rss_assembly_test_configuration_power_cycle_test_enable(configuration);
if (!run_test(configuration))
{
test_result[t++] = 0; //(9)
acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate();
//return EXIT_FAILURE;
} else {
test_result[t++] = 1;
}
acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- end ********************\r\n");
// Enable and run: Hibernate Test // Enable and run: Hibernate Test
APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- Start ********************\r\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- Start ********************\r\n");
@ -122,9 +156,8 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 1; test_result[t++] = 1;
} }
APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- End ********************\r\n");
acc_rss_assembly_test_configuration_communication_hibernate_test_disable(configuration); acc_rss_assembly_test_configuration_communication_hibernate_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Hibernate Test --- End ********************\r\n");
// Enable and run: Supply Test // Enable and run: Supply Test
APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- Start ********************\r\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- Start ********************\r\n");
@ -140,9 +173,8 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 1; test_result[t++] = 1;
} }
APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- End ********************\r\n");
acc_rss_assembly_test_configuration_supply_test_disable(configuration); acc_rss_assembly_test_configuration_supply_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Supply Test --- End ********************\r\n");
// Enable and run: Clock Test // Enable and run: Clock Test
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- Start ********************\r\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- Start ********************\r\n");
@ -157,7 +189,7 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 1; test_result[t++] = 1;
} }
//APP_LOG(TS_OFF, VLEVEL_H,"-- test step: [%d] --result=%d \n", t-1, test_result[t-1]);
acc_rss_assembly_test_configuration_clock_test_disable(configuration); acc_rss_assembly_test_configuration_clock_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- end ********************\r\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- Clock Test --- end ********************\r\n");
@ -175,14 +207,14 @@ int sts_presence_rss_bring_up_test(uint8_t *rss_self_test_result)
test_result[t++] = 1; test_result[t++] = 1;
} }
acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration); acc_rss_assembly_test_configuration_power_cycle_test_disable(configuration);
APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- end ********************\r\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- Power cycle test --- end ********************\r\n");
APP_LOG(TS_OFF, VLEVEL_H,"-- 10 -- Bring up test: All tests passed\n"); APP_LOG(TS_OFF, VLEVEL_H,"-- 10 -- Bring up test: All tests passed\n");
test_result[t++] = 1; //(10) test_result[t++] = 1; //(10)
memcpy(rss_self_test_result, test_result, t); memcpy(rss_self_test_result, test_result, 12);
APP_LOG(TS_OFF, VLEVEL_H,"--Bring up test result #=%d \r\n", t); APP_LOG(TS_OFF, VLEVEL_H,"--Bring up test result #=%d \r\n", t);
acc_rss_assembly_test_configuration_destroy(&configuration); acc_rss_assembly_test_configuration_destroy(&configuration);
acc_rss_deactivate(); acc_rss_deactivate();

View File

@ -2301,6 +2301,7 @@ void STS_SENSOR_Function_Test_Process(void)
tstbuf[i++] = (uint8_t) sts_hardware_ver; tstbuf[i++] = (uint8_t) sts_hardware_ver;
tstbuf[i++] = (uint8_t) (99*((GetBatteryLevel()/254)&0xff)); tstbuf[i++] = (uint8_t) (99*((GetBatteryLevel()/254)&0xff));
APP_LOG(TS_OFF, VLEVEL_H, "\r\nStart Function Test \r\n");
STS_SENSOR_MEMS_Get_ID(mems_Dev_ID); STS_SENSOR_MEMS_Get_ID(mems_Dev_ID);
if ((mems_Dev_ID[0]==0X0) && (mems_Dev_ID[1]==0x0)) { if ((mems_Dev_ID[0]==0X0) && (mems_Dev_ID[1]==0x0)) {

Binary file not shown.