cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Participant
Participant
366 Views
Registered: ‎12-06-2011

[SDK 2019.1] US+ MPSoC PMU firmware - custom module scheduled task does not run

Jump to solution

Hi forum users,

Starting from the Xilinx "ZynqMP PMU Firmware" template, I'm trying to create a PMU image that schedules a task periodically, e.g. every second.

I have followed the instructions given in UG1137 chapter 10 for creating a module. When I run the PMU firmware, in the terminal connected to UART1, I see something like

PMU Firmware 2019.1 Jan 13 2020 17:09:59
PMU_ROM Version: xpbr-v8.1.0-0
XPFW: ModCustomInit: Done
DAP_WAKE (MOD-2): Initialized.
LEGACY PWR UP/DN/ISO (MOD-3): Initialized.
XPFW: ModCustomCfgInit: Done

So this means that my CfgInit handler is called and runs to completion, which schedules a task as follows:

 

static void ModCustomCfgInit(const XPfw_Module_t *ModPtr, const u32 *CfgData, u32 Len) {
	XStatus Status;

	Status = XPfw_CoreScheduleTask(ModPtr, 1000, ModCustomTimerCallback);
	if (XST_SUCCESS != Status) {
		XPfw_Printf(DEBUG_PRINT_ALWAYS, "XPFW: ModCustomCfgInit: *** Failed to schedule task; Status=%d\r\n", Status);
	}

	XPfw_Printf(DEBUG_DETAILED, "XPFW: ModCustomCfgInit: Done\r\n");
}

However, as far as I can tell, my callback is never executed. That callback is:

 

 

static void ModCustomTimerCallback(void) {
	XPfw_Printf(DEBUG_DETAILED, "XPFW: ModCustomTimerCallback: Timer callback\r\n");
}

I never see the message that this function should display.

 

One thing I noticed is that (as far as I can tell) nowhere in the PMU code is there a call to this Xilinx-authored function that I would expect to find somewhere in the code:

XStatus XPfw_SchedulerStart(XPfw_Scheduler_t *SchedPtr);

Adding a call to it in a reasonable place in the Xilinx code did not appear to help, though.

Before I dive in to try to debug this, can anybody confirm that the scheduler feature of the Xilinx PMU template works as advertised?

Thanks in advance for any tips.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Participant
Participant
319 Views
Registered: ‎12-06-2011

I figured out what the problem is, in case anybody encounters the same issue.

It seems that in SDK 2019.1, a feature where the PMU firmware busy-waits for the FSBL to start and then copies it to DDR4 memory has been added. If running the PMU in isolation, as I have been doing, it never gets past this busy-wait and hence never enters the main event loop.

After disabling the busy-wait for FSBL, I saw my callback function executing as expected.

View solution in original post

0 Kudos
2 Replies
Highlighted
Participant
Participant
358 Views
Registered: ‎12-06-2011

ps. ENABLE_SCHEDULER is #defined, by setting ENABLE_SCHEDULER_VAL in xpfw_config.h to 1.

0 Kudos
Highlighted
Participant
Participant
320 Views
Registered: ‎12-06-2011

I figured out what the problem is, in case anybody encounters the same issue.

It seems that in SDK 2019.1, a feature where the PMU firmware busy-waits for the FSBL to start and then copies it to DDR4 memory has been added. If running the PMU in isolation, as I have been doing, it never gets past this busy-wait and hence never enters the main event loop.

After disabling the busy-wait for FSBL, I saw my callback function executing as expected.

View solution in original post

0 Kudos