Running FreeRTOS OS on Zynq AMP setup

dje666 wrote on Tuesday, July 02, 2019:

Dear Forum,

I understand that its possible to setup the Zynq devices as AMP and have a separte FreeRTOS OS executing on each APU-core wholly independantly of each other. I have a specific requirement to update the application running on a given FreeRTOS O/S pair with out clearing the PL in the Zynq chip, and am wondering if I can use a Dual OS AMP setup to achieve this aim.

In this system I need CPU-0 and OS-0 running after 1st bootup, with CPU-1 and OS-1 being held in reset. I then need CPU-0 to release CPU-1 from Reset whilst putting itself into Reset such that there is no over lap in how OS-0 and OS-1 access the PL and PS peripherals.

Finally I need CPU-1 and OS-1 to drop back into reset (under SW control) releasing CPU-0 and OS-0 from reset.

Essentailly only one CPU-OS pair will ever be running, with the second pair being held in reset.

Is the above possible?



rtel wrote on Tuesday, July 02, 2019:

I’m not sure about the hardware specifics. For example I think it is
possible for a boot master to release a slave from reset, but I’m not
sure if it is then possible for what was the slave to put what was the
boot master into reset (or for the boot master to put itself into reset)

  • for all that stuff you will need to look at the Zynq specific hardware

I do however know that Xilinx provide AMP examples with Linux on one
core and FreeRTOS on the other - I think using the OpenAMP library for
core to core communication - so that example might be a good place for
you to start as a reference. If you want something lighter weight for
core to core communications you can use FreeRTOS Stream Buffers as
described here:

1 Like

dje666 wrote on Tuesday, July 02, 2019:

Dear Richard,

Thanks for the prompt reply. I will need to investigate the reset options open to me here.

If I simplify the question further. Is it possible to have two implementations of FreeRTOS that exist in wholly separate areas of DDR memory, and have one CPU jump between them? That is to say the one CPU will terminate all processes in OS-0 and jump over to OS-1, then at some point in the future it will close all processes in OS-1 and revert back to OS-0.

The reason behind this is that I need the system to jump from OS-0 to OS-1, and whilst in OS-1 over-write OS-0 with a “new” version of OS-0. Once this update is complete the system can then jump back to the newly updated OS-0.

I am aware of other mechanisms in Zynq that could accomplish this update flow, but they all result in the programmable logic part of the Zynq chip being reprogrammed, and I must avoid this.



richarddamon wrote on Wednesday, July 03, 2019:

I would think that if you prepare two completely seperated images that both include FreeRTOS, linked to different sets of memory addresses, it should be possible for one version of it to basically shut down that version of FreeRTOS and then jump over to the other version to start up. You would need to reset the hardware state to be compatible with entering the new image, which would include at a minimum disabling interrupts and loading the stack pointer for the new image. It shouldn’t need anything Zynq specific, but would basically just recreate how the Zynq bootload starts the final program.