Skip to content

Commit 8cab0dc

Browse files
committed
Check payload power voltage twice before updating pp_good [afcv4.0]
We observed that a specific AFCv4.0 card suffers a loss of power in the payload power rails event though the MCH indicates that the card is in M4 state. It seems that the MMC detects a voltage dip in the 12V power rail and turns off the DC/DC converters, but we suspect it is a false reading. This is a workaround to try avoiding turning off the payload power if the AMC +12V voltage measurement dips below 8V for a single measurement.
1 parent 0b1d05c commit 8cab0dc

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

port/board/afc-v4/payload.c

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ void vTaskPayload( void *pvParameters )
298298
uint8_t new_state = -1;
299299

300300
/* Payload power good flag */
301-
uint8_t PP_good = 0;
301+
uint8_t pp_good = 0;
302+
uint8_t last_pp_goods[2] = {0, 0};
302303

303304
/* Payload DCDCs good flag */
304305
uint8_t DCDC_good = 0;
@@ -362,13 +363,19 @@ void vTaskPayload( void *pvParameters )
362363
xEventGroupClearBits(amc_payload_evt, PAYLOAD_MESSAGE_REBOOT | PAYLOAD_MESSAGE_WARM_RST);
363364
}
364365

365-
PP_good = payload_check_pgood(&pp_adc_val);
366+
last_pp_goods[1] = last_pp_goods[0];
367+
last_pp_goods[0] = payload_check_pgood(&pp_adc_val);
368+
369+
if (last_pp_goods[0] == last_pp_goods[1]) {
370+
pp_good = last_pp_goods[0];
371+
}
372+
366373
DCDC_good = gpio_read_pin(PIN_PORT(GPIO_PGOOD_P1V0), PIN_NUMBER(GPIO_PGOOD_P1V0));
367374

368375
switch(state) {
369376

370377
case PAYLOAD_NO_POWER:
371-
if (PP_good) {
378+
if (pp_good) {
372379
new_state = PAYLOAD_POWER_GOOD_WAIT;
373380
}
374381
break;
@@ -383,7 +390,7 @@ void vTaskPayload( void *pvParameters )
383390
hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_SHUTDOWN_MASK );
384391
hotswap_clear_mask_bit( HOTSWAP_AMC, HOTSWAP_BACKEND_PWR_FAILURE_MASK );
385392

386-
if ( QUIESCED_req || ( PP_good == 0 ) ) {
393+
if ( QUIESCED_req || ( pp_good == 0 ) ) {
387394
new_state = PAYLOAD_SWITCHING_OFF;
388395
} else if ( DCDC_good == 1 ) {
389396
new_state = PAYLOAD_STATE_FPGA_SETUP;
@@ -414,9 +421,12 @@ void vTaskPayload( void *pvParameters )
414421
break;
415422

416423
case PAYLOAD_FPGA_ON:
417-
if ( QUIESCED_req == 1 || PP_good == 0 || DCDC_good == 0 ) {
418-
printf("QUIESCED_req = %d, PP_good = %d, DCDC_good = %d\n", QUIESCED_req, PP_good, DCDC_good);
424+
if (last_pp_goods[0] == 0) {
419425
printf("Payload power ADC value %u\n", pp_adc_val);
426+
}
427+
428+
if ( QUIESCED_req == 1 || pp_good == 0 || DCDC_good == 0 ) {
429+
printf("QUIESCED_req = %d, pp_good = %d, DCDC_good = %d\n", QUIESCED_req, pp_good, DCDC_good);
420430
new_state = PAYLOAD_SWITCHING_OFF;
421431
}
422432
break;
@@ -447,7 +457,7 @@ void vTaskPayload( void *pvParameters )
447457

448458
case PAYLOAD_QUIESCED:
449459
/* Wait until power goes down to restart the cycle */
450-
if (PP_good == 0 && DCDC_good == 0) {
460+
if (pp_good == 0 && DCDC_good == 0) {
451461
new_state = PAYLOAD_NO_POWER;
452462
}
453463
break;

0 commit comments

Comments
 (0)