Hello Fatih,
In your last post you asked if the legend of the LEDs (e.g. “Out-of-service LED”) can be changed.
These legends are currently defined in a file that a user cannot access (unless they have signed a NDA). Do you want to define custom strings or would a more generic string (e.g. “FRU LED 1”) work for you as well?
The FRU LED3 has been added to the code.
As far as the LED control is concerned, I have figured out a few things:
In ipmc-user/user_mainfile.c · master · ep-ese-be-xtca / ipmc-project · GitLab the lines 102 – 121 show how Julian proposed to control the LEDs from the user code. According to Pigeon Point we should do it this way:
#include <mainfru.h>
#include <fru.h>
#include <fru_led.h>
(…)
MAIN_LOOP_CALLBACK(usermain_mainloop)
{
static int waitabit = 0;
static char led_toggle = 0;
waitabit++;
if (waitabit == 1000)
{
if (led_toggle == 0)
{
fru_led_set_local(&mainfru, 1, 1, 0, LED_COLOR_RED, 0);
debug_printf(“MAIN_LOOP_CALLBACK: FRU_LED 1 ON\n\r”);
led_toggle = 1;
}
else
{
fru_led_set_local(&mainfru, 1, 0, 1, LED_COLOR_RED, 0);
debug_printf(“MAIN_LOOP_CALLBACK: FRU_LED 1 OFF\n\r”);
led_toggle = 0;
}
waitabit = 0;
}
}
Here is a definition of the parameters of the function:
void fru_led_set_local(fru_desc_t *fru, unsigned char lednum, unsigned char on, unsigned char off, unsigned char color, unsigned char off_first)
*fru: This is is a pointer to the fru_desc structure. Use “&mainfru” (from the include file “mainfru.h”)
lednum: 0 = HS LED; 1,2,3 = FRU LEDs
on/off: 1,0: LED ON, 0,1: LED OFF. More generally, these parameters define the timing for blinking the LED, they can be in range 0 – 255.
color: My understanding is that this parameter only matters for multi-color LEDs. FRU_LED1, for example, can be red or green.
off_first: is a parameter defining that the “off” timing should be applied before the “on” timing. Set it to 0 for your case.
As you want to use the LEDs for the power sequencing, we have also looked into this issue.
Stefan pointed out that it is possible (via the PSQ_CALL_FUNC macro) to inject user code into the power sequencing.
In my “config.xml” file I have:
<PowerONSeq>
<step>PSQ_ENABLE_SIGNAL(CFG_PAYLOAD_DCDC_EN_SIGNAL)</step>
<step>PSQ_CALL_FUNC(hello_psq_function)</step>
<step>PSQ_END</step>
</PowerONSeq>
To the file “ipmc-user/user_mainfile.c” I have added:
unsigned int hello_psq_function(void)
{
debug_printf(“User function hello_psq_function called \n\r”);
}
When I install this F/W on the IPMC and look at the UART debug port, I can see:
<>: FRU 0 state: M1->M2, cause = 2
MAIN_LOOP_CALLBACK: FRU_LED 1 ON
<>: FRU 0 state: M2->M3, cause = 1
<>: CORE_10100: Link is UP, 100Mb FD
User function hello_psq_function called
<>: FRU 0 state: M3->M4, cause = 0
With these tricks you should be able to use the FRU LEDs in the power monitoring. We are, however, wondering if using the LEDs to track the power sequencing is the best strategy. Would it, if it was possible, be useful to you if e.g. event messages could be sent from the power sequencing macros to have information about problems with the powering of a card logged in the SEL? We can ask PigeonPoint for advise on how to do that.
Cheers,
Markus