I'm missing something, bsps building

Okay, I’m missing something.

  • I cloned the RTEMS source in ./rtems-src
  • I cloned the Source Builder into ./rsb
  • I uses the source builder to build the tools into ~/.local/rtems/7
  • I cannot build any of the stm32 flavors bsps.

What I can do, in rtems-src run rtems-bsps which lists a number of bsps associated with various ST dev boards. (I’ve also got blackpill’s in addition to ST nucleos and discovery boards to play with.) So one that it lists under the arm: tag, is stm32f446ze with space then stm32f4.

I have tried a number of variants. If I use the example bsps/beagleboneblack that works fine. If I try bsps/stm32f4 it fails saying it can’t find a bset file. Similarly with bsps/stm32f446ze.

So specific questions:

  1. Must I run sb-set-builder from a specific directory?
  2. Once I have successfully run it and the tools it built are in my path, can I use those tools to build an RTEMS application for that BSP in it’s own directory?
  3. When I launch GDB to flash the elf file and debug, will it be able to find RTEMs source or will I have to tell gdb where to look?

If get though these three steps I think I’ll be in much better shape.
–Chuck

  1. Why the . in the tools path. ie .local?

  2. The sb-set-builder command looks for build set and then configuration files in the config directory under the directory you run it from. If you review the documentation you will see cd rtems before the set builder command is run and under rtems in the RSB is a config directory with the RTEMS build sets and configurations. You could make a directory anywhere, add a config directory and populate with build set and configurations making your own custom builds. For RTEMS the RSB repo contains rtems and bare for you as a working set. The RTEMS Deployment repo provides a config directory and when you run sb-set-builder within that repo that config directory is added to the list searched.

  3. Yes. To build an application you first need to build an RTEMS BSP. You use the tools built by the RSB to do that. By default RTEMS’s ./waf configure ... will look for tools in the configure --prefix path. If you want to keep the tools and BSP separate you can provide --rtems-tools to the RTEMS configure command (try ./waf --help). Once a BSP is built you install it to use to build an application. This puts the BSP files you need to build an application with under the --prefix path you used with configure.

  4. If you leave the sources where they are after building and installing they should be found. We should have absolute paths in the debug information for this exact reason. If you use the RSB to build a BSP you will not have the sources as the RSB cleans up when it has finished building. Newlib and C++ sources will not be found but you can untar them some where and use the GDB’s dir command to add the source paths. The only problem with Newlib is the paths embedded in the debug info are all relative, ie ../../../../libc/something/something.

1 Like

Thanks Chris. I decided to restart from scratch once again and try to be precise in my following of the quick start doc to see where I went wrong.

It’s currently building 7/rtems-arm (the tools build step). And that completed, now on to building the bsps… and that worked. So I think I’m off to the races. We’ll see after I try to build the Hello World example.

Where I got lost was in the various discussions of sources and paths and where to build. So the small number of words version is:
Create a directory
foo/
CD to that directory and clone into it the RTEMS Source Builder giving you
foo/rtems-source-builder
CD into that directory and clone the RTEMS source into it giving you
foor/rtems-source-builder/rtems
CD into that directory and build tools, then build a BSP. Set your prefix to somewhere else. Since I build non-system wide stuff in my ~/.local directory I put everything in ~/.local/rtems/7
Now add ~/.local/rtems/7/bin to your path. Go to the next step where you create a project directory.

That’s where I am now. I’m pretty confident I’ll be able to build HelloWorld and run it on my Nucleo board, and probably Ticker as well. We’ll see.

Real shout out to the tremendous amount of documentation you guys have put together. It’s a lot and I find skim too much and miss critical details, but now that I’ve gone through that process. I think I understand the directory structure you’re trying to achieve and where I have flexibility within that structure.

–Chuck