sbourdelin / buildroot-pandaboard-amp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demonstration of Asymmetric Multiprocessing

This project aims to easily demonstrate the usage and benefits of the Linux remoteproc framework to do asymmetric multiprocessing between a Cortex A9 running Linux and a Cortex M3 Ducati running FreeRTOS on a Pandaboard (OMAP4430).

The project is based on Buildroot for the build system. It come with a Linux from Ti pre-configured to use the remoteproc framework and few packages to easily build and boot a demo FreeRTOS firmware compliant with the remoteproc framework on the Cortex M3 core.

Why?

The idea of this project is to show the benefits of combining a dedicated core for a real-time OS and an other core for a general purpose operating system. This way we can answer real-time constraints without loosing the advantages of a more evolved operating system.

How?

The standard use case is to treat a hard real-time constraints like handling an external event and respond to it within a guarantee time. We can, for example, simulate this behaviour by handling an IRQ which will represent our external event and toggle a GPIO in answer to it. We can do it using the core which run Linux then do the same in the core running FreeRTOS, and finally take measures for each case and compare them.


How to build:

Requirements: A toolchain for ARM Cortex M series is required to build the FreeRTOS firmware, you can find one at: https://launchpad.net/gcc-arm-embedded

make pandaboard_amp_defconfig
make menuconfig
  • go to Target packages > Pandaboard AMP
  • select rpfreertos and define the path to your ARM Cortex M toolchain
  • press escape until you are asked to save the configuration and answer Yes
make

You can now flash the output/images/sdcard.img on your sdcard and boot your Pandaboard.

sudo dd if=output/images/sdcard.img of=/path/to/sdcard bs=1M

How to use:

Login to the board:

login / pass : root

Test with the FreeRTOS firmware:

The demo FreeRTOS firmware uses the IRQ line linked to the GPIO bank 2, to avoid concurrency between the two cores, this IRQ line should be masked in the Cortex A9 APIC before use it in the Cortex M3 NVIC. To do so, we can pass the IRQ to be masked to the rpboot module which will disable it before booting the Cortex M3 Ducati core.

This IRQ can be identify in Linux using the following command:

cat /proc/interrupt | grep 48055000.gpio | cut -d':' -f1

Let's say this IRQ is 58, we can now boot the FreeRTOS firmware:

modprobe omap_remoteproc
modprobe rpboot irq=58

The LED D2 should blink indicating the FreeRTOS is running.

The GPIO2_MPU_IRQ line is now handle by FreeRTOS and will only care of the IRQ generated by the GPIO 37. When the IRQ handler is trigged it will toggle the GPIO 55 and the LED D1.

Test with Linux:

The same test can be reproduce inside Linux, this project comes with a simple kernel module to request the same IRQ and toggle the same GPIO.

Before loading this module you should remove the previously load FreeRTOS firmware if used to avoid concurrency:

modprobe -r rpboot

Then just insert the new module:

modprobe rpgpio

Take measures:

Each tests use the GPIO 37 (pin 20 on J6) as an input to trigger the IRQ and the GPIO 55 (pin 23 on J6) as the output to toggle. The GPIO 37 is set to HIGH (1.8v) by default, and the IRQ is configured to trigger on rising and falling edge. You can now use your prefered method to generate an alternate signal and measure the response time on the GPIO 55.

About

License:GNU General Public License v2.0


Languages

Language:Makefile 69.8%Language:C 13.2%Language:Python 6.4%Language:Shell 6.4%Language:C++ 1.8%Language:Perl 1.5%Language:Yacc 0.5%Language:Lex 0.2%Language:CMake 0.1%Language:Arc 0.0%Language:Batchfile 0.0%Language:Groff 0.0%