Where is the BSP built?

I could apparently build the BSP for aarch64/zynqmp_apu
but I would expect a *.bsp file to carry on with PetaLinux
I tried both the RSB way and manually with Waf,
there were no errors, but I can’t find what I need

My questions are:
I didn’t explicitly include RTEMS kernel sources, do I need to?
Did I miss a step to create such *.bsp file for Petalinux?
If not, is there another way to make a boot.bin for ZynqMP?

Currently, RTEMS does not produce a Petalinux-compatible .bsp file regardless of how you build it, but, given your question, I have to ask one in return:

What exactly do you expect a RTEMS .bsp file to do when provided to the Petalinux build system? RTEMS is an operating system and does not run on top of Linux nor it is a platform for Linux to run on. I don’t really see how it could fit into that ecosystem unless I’m missing something about how Petalinux works.

As for the bit about boot.bin, the fastest way to boot RTEMS is to use the existing boot.bin that came with the Petalinux reference design since it comes with u-boot. The most convenient way to load RTEMS on this platform is to package it in a u-boot image file and load that over TFTP. It’s entirely possible to take the pieces of the reference boot.bin and build RTEMS directly into a new boot.bin or to build the pieces yourself or to build them using Vitis. RTEMS is merely the payload that boot.bin immediately or eventually loads and executes.

Petalinux not only builds linux, it also packages bootable images and can use external binaries.
The normal package with petalinux includes FSBL (first stage bootloader), u-boot and the linux image plus the fpga configuration, etc.
I was expecting (haven’t yet researched much into that), petalinux to be able to bundle FSBL and RTEMS (and even u-boot in between).
What you say about using an existing boot.bin could, I think, be replaced by a specific packaging with petalinux-package
What FSBL does is just loading the config into the FPGA, sw into CPU RAM and hand over to it. But any software other than u-boot/ Linux could be used as payload, so petalinux doesn’t necessarily mean linux.

An option to explore, indeed
I think I will first prepare a boot image with just u-boot and try to load RTEMS via tftp

Yes, the Petalinux project does quite a bit more than building Linux but is tailored around building things that are necessary to boot Linux, building Linux itself, building things that run on Linux, and building the filesystem images necessary to tie that all together. There’s not really a place for RTEMS in there except as possibly a replacement for the Linux kernel itself (though Linux and RTEMS have wildly different capabilities and purposes) and that doesn’t seem to be how Petalinux BSP definition files are typically used.

In any case, I think there’s some confusion about what a “BSP” actually is. The RTEMS concept of a BSP is fundamentally different from a Petalinux BSP definition. If anything, the RTEMS build system could theoretically use a Petalinux BSP definition to better tailor RTEMS to a particular board.

That aside, there has been some chatter about the kind of thing you’re asking about since “just use the reference design boot.bin” isn’t the best answer even though it generally does Just Work for getting started. We haven’t quite assembled a top-to-bottom answer yet but we’re thinking about it.

Yes, I got the feeling that ‘BSP’ has a different meaning in Rtems and Xilinx Fpga.

I have quite an extensive experience with Fpga and fair to good with software. I work on the hw side of spacecraft and I’m exploring how Rtems could fit in our projects, instead of commercial VxWorks or FreeRtos, that I have used on Zynq MPSoC.

My idea of using petalinux packager was just the first take. Actually, Vitis can create boot images for FreeRtos and could work for Rtems. I’m just concerned that apparently Rtems wants its specific compiler, but Vitis uses its own.

Unfortunately, the use of the RTEMS toolchain is not optional for building RTEMS. There are quite a few configuration settings within the toolchain that RTEMS relies on to operate properly that just can’t be replicated (or would be exceedingly difficult to orchestrate) otherwise.

The other components of the boot chain can be built with the Vitis tools without issue.

Like @opticron said: You can’t use the Vitis compiler and similar tools because the RTEMS tools have a few special options set. That’s necessary for some mechanisms to work a bit better on RTEMS compared to a bare metal target (like FreeRTOS). I don’t know all features and I might be wrong with that example, but I think it was for example the C++ std::thread.

What works quite well is to compile the low level XilinxProcessorIPLib from the embeddedsw repo with the RTEMS compilers. You need some hacks to get the correct configuration headers but otherwise everything works without too much trouble.

Best regards

Christian