[PATCH v2] doc/raspberrypi: Added instructions for raspberrypi

Jiri Gaisler jiri at gaisler.se
Sun Jan 12 15:51:43 UTC 2020


You should build devel/qemu4 with RSB, the older devel/qemu does not build on newer systems ...

Jiri.


On 1/12/20 4:48 PM, Niteesh wrote:
> I can't build QEMU using RSB, there seems to be a problem with GLib(see attachment)
> but I had no problem building it from the source. Should I just mention build qemu from
> source?
>
> On Tue, Jan 7, 2020 at 11:12 PM Niteesh <gsnb.gn at gmail.com <mailto:gsnb.gn at gmail.com>> wrote:
>
>     I didn't use the QEMU build from RSB, I built it from the source directly for another project
>     I'll try QEMU from RSB, and will also add instructions for it in a couple of days.
>
>     On Tue, Jan 7, 2020 at 1:00 AM Gedare Bloom <gedare at rtems.org <mailto:gedare at rtems.org>> wrote:
>
>         On Mon, Jan 6, 2020 at 11:25 AM Niteesh <gsnb.gn at gmail.com <mailto:gsnb.gn at gmail.com>> wrote:
>         >
>         > Do you want to add a build section or just add in a statement that states "it was built
>         > using xx version of RSB"?
>         >
>
>         Just a simple statement. Don't even  need to mention a specific
>         version, if they use RSB to build QEMU it should just work, right?
>
>         > On Mon, Jan 6, 2020 at 11:51 PM Gedare Bloom <gedare at rtems.org <mailto:gedare at rtems.org>> wrote:
>         >>
>         >> On Mon, Jan 6, 2020 at 2:47 AM Christian Mauderer <list at c-mauderer.de <mailto:list at c-mauderer.de>> wrote:
>         >> >
>         >> > Looks a lot better.
>         >> >
>         >> > On 05/01/2020 20:19, G S Niteesh wrote:
>         >> > > Added instructions to run examples on raspberrypi.
>         >> > > ---
>         >> > >  user/bsps/arm/raspberrypi.rst | 74 ++++++++++++++++++++++++++++++++++-
>         >> > >  1 file changed, 73 insertions(+), 1 deletion(-)
>         >> > >
>         >> > > diff --git a/user/bsps/arm/raspberrypi.rst b/user/bsps/arm/raspberrypi.rst
>         >> > > index 4ef75bd..7eccca5 100644
>         >> > > --- a/user/bsps/arm/raspberrypi.rst
>         >> > > +++ b/user/bsps/arm/raspberrypi.rst
>         >> > > @@ -5,4 +5,76 @@
>         >> > >  raspberrypi
>         >> > >  ===========
>         >> > >
>         >> > > -TODO.
>         >> > > +This BSP supports `Raspberry Pi 1` and `Raspberry Pi 2` currently.
>         >> > > +The support for `Raspberry Pi 3` is work under progress.
>         >> > > +The default bootloader on the raspberrypi which is used to boot raspbian
>         >> >
>         >> > raspberrypi -> Raspberry Pi
>         >> > raspbian -> Raspbian
>         >> >
>         >> > > +or other OS can be also used to boot RTEMS. U-boot can also be used.
>         >> > > +
>         >> > > +Setup SD card
>         >> > > +----------------
>         >> > > +
>         >> > > +The Raspberry Pis have an unconventional booting mechanism. The GPU
>         >> > > +boots first, initializes itself, runs the bootloader and starts the CPU.
>         >> > > +The bootloader looks for a kernel image, by default the kernel images must
>         >> > > +have a name of the form `kernel*.img` but this can be changed by adding
>         >> >
>         >> > Please highlight all files in the same way. Other BSPs use the following
>         >> > syntax:
>         >> >
>         >> >     The ``ticker.exe`` elf file must be translated ...
>         >> >
>         >> > So here it is:
>         >> >
>         >> > `kernel*.img` -> ``kernel*.img``
>         >> >
>         >> > > +`kernel=<img_name>` to config.txt.
>         >> >
>         >> > config.txt -> ``config.txt``
>         >> >
>         >> > > +
>         >> > > +You must provide the required files for the GPU to proceed. These files
>         >> > > +can be downloaded from this
>         >> > > +`link <https://github.com/raspberrypi/firmware/tree/master/boot>`_.
>         >> >
>         >> > I would suggest:
>         >> >
>         >> > ... can be downloaded from
>         >> > `the Raspberry Pi Firmware Repository
>         >> > <https://github.com/raspberrypi/firmware/tree/master/boot>`_.
>         >> >
>         >> > I think you shouldn't break links so if this is too long you can
>         >> > exceptionally break the 80 character rule. It's done for other links too.
>         >> >
>         >> > > +You can remove the kernel*.img if you want, but don't touch the other files.
>         >> >
>         >> > kernel*.img -> ``kernel*.img``
>         >> >
>         >> > > +
>         >> > > +Copy these files in to a SD card with FAT filesystem.
>         >> > > +
>         >> > > +Kernel image
>         >> > > +------------
>         >> > > +
>         >> > > +The following steps show how to run hello.exe on a Raspberry Pi 2.
>         >> >
>         >> > hello.exe -> ``hello.exe``
>         >> >
>         >> > > +The same instructions can be applied to Raspberry Pi 1 also.
>         >> > > +Other executables can be processed in a similar way.
>         >> > > +
>         >> > > +To create the kernel image:
>         >> > > +
>         >> > > +.. code-block:: none
>         >> > > +
>         >> > > +     arm-rtems5-objcopy -Obinary hello.exe kernel.img
>         >> > > +
>         >> > > +Copy the kernel image to the SD card.
>         >> > > +
>         >> > > +Make sure you have these lines below in your config.txt.
>         >> > > +
>         >> > > +.. code-block:: none
>         >> > > +
>         >> > > +     enable-uart=1
>         >> > > +     kernel_address=0x200000
>         >> > > +     kernel=kernel.img
>         >> > > +
>         >> > > +Testing
>         >> > > +-------
>         >> >
>         >> > Maybe change that chapter to "Emulation" or "Testing using QEMU". When
>         >> > reading I had expected a hardware setup in this chapter after the
>         >> > SD-card has been prepared in the previous one.
>         >> >
>         >> > > +
>         >> > > +Qemu along with GDB can be used for debugging, but it only supports
>         >> >
>         >> > Please always use the capitalization that the project uses. In this case:
>         >> >
>         >> > Qemu -> QEMU
>         >> >
>         >> > > +``Raspberry Pi 2`` and the emulation is also incomplete. So some of the
>         >> >
>         >> > Again: One formatting for one phrase. So that would be:
>         >> >
>         >> > ``Raspberry Pi 2`` -> Raspberry Pi 2
>         >> >
>         >> > > +features might not work as expected.
>         >> > > +
>         >> > > +Make sure you have latest version of qemu, because older ones don't support
>         >> >
>         >> > qemu -> QEMU
>         >> >
>         >> My only other comment is if this version is built by RSB already it is
>         >> worth mentioning here.
>         >>
>         >> > > +Raspberry Pi.
>         >> > > +
>         >> > > +.. code-block:: none
>         >> > > +
>         >> > > +     qemu-system-arm -M raspi2 -m 1G -kernel hello.exe -serial mon:stdio -nographic -S -s
>         >> > > +
>         >> > > +This starts qemu and creates a socket at port ``localhost:1234`` for GDB to
>         >> >
>         >> > qemu -> QEMU
>         >> >
>         >> > > +connect.
>         >> > > +
>         >> > > +In a new terminal, run GDB using
>         >> > > +
>         >> > > +.. code-block:: none
>         >> > > +
>         >> > > +     arm-rtems5-gdb hello.exe
>         >> > > +     tar remote:1234
>         >> > > +     load
>         >> > > +
>         >> > > +This will connect GDB to qemu and load the application.
>         >> >
>         >> > qemu -> QEMU
>         >> >
>         >> > > +
>         >> > > +**Note**: Add ``set scheduler-locking on`` in GDB if you have any issues
>         >> > > +running the examples.
>         >> > > \ No newline at end of file
>         >> > >
>
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200112/f346438f/attachment.html>


More information about the devel mailing list