Creating a new BSP

Mr. Andrei Chichak groups at chichak.ca
Mon Jun 30 20:26:56 UTC 2014


Well, I’m in the process of creating a BSP for an STM32F373, and managed to get it working last week.

There was a surprising number of differences between the 32F407 on the F4 Discovery and the 32F373, even though they are both Cortex M4 devices. I spent a lot of time tracing through the boot process, adjusting device register addresses to keep the processor from trapping out. (Put a breakpoint in the unhanded interrupt trap code)

When building a BSP from scratch you seem to only have to munge a bunch of files, put it into place in the source tree, run the various forms of bootstrap to process your modifications to the .ac and .am files. The big deals come in when adjusting some of the frequencies in configure.ac, where you have to do a bootstrap -c to get the config file processed.

Anyway, the ‘373 only has 32K of RAM and it took a bit of stack size adjustment to get 5 processes and two queues to successfully create, it’s very tight but can be done.

From your configure command, do you really want to enable networking? I can’t see a F3 that has an ether module.

Below is the script that I use to rebuild the BSP (as well as the F4 Discovery BSP since I’m working on another project derived from that board).

rm -r rtems/rtems/c/src/lib/libbsp/arm/stm32f37x
cp -R ~andreichichak/BSP/stm32f37x/ rtems/rtems/c/src/lib/libbsp/arm/stm32f37x
cd rtems/rtems
./bootstrap -c
./bootstrap -p
./bootstrap
cd ../..
rm -r rtems/rtems-4.11
mkdir -p rtems/rtems-4.11
cd rtems/rtems-4.11
../rtems/configure --target=arm-rtems4.11 --disable-posix --disable-networking --disable-cxx --enable-bsp="stm32f4 stm32f37x" --prefix=/Users/andreichichak/development/rtems/4.11 --disable-tests
make -j7 RTEMS_BSP=stm32f4 install
make -j7 RTEMS_BSP=stm32f37x install


Andrei in the Great White North

On 2014-June-30, at 1:23 PM, Steven Grunza <steven.grunza at gmail.com> wrote:

> Can I create a new BSP by copying a very similar BSP (such as stm32f4) and then adding the new directory to the acinclude.m4 file in c/src/lib/libbsp/arm, then running bootstrap from the top level directory?
> 
> As far as I can remember this is the procedure I used to create a BSP for the STM32F3Discovery board; however, now that I need to use a STM32F4Discovery (with really different pinouts than the current BSP) I'm having trouble getting the system to configure.  My configure output ends with ...
> 
> checking whether gmake sets $(MAKE)... yes
> checking whether gmake supports nested variables... yes
> checking whether to enable maintainer-specific portions of Makefiles... yes
> checking that generated files are newer than configure... done
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating Makefile
> 
> 
> My STM32F3Discovery configuration output ends with ...
> 
> configure: creating ./config.status
> config.status: creating Makefile
> 
> target architecture: arm.
> available BSPs: stm32f3.
> 'gmake all' will build the following BSPs: stm32f3.
> other BSPs can be built with 'gmake RTEMS_BSP="bsp1 bsp2 ..."'
> 
> config.status: creating Makefile
> 
> 
> 
> My best guess is that I've forgotten to update a file but I haven't been able to figure out which file.  Any suggestions would be appreciated.
> 
> My development system is Fedora 20, I'm using recent "arm-rtems4.11-xxx" tools from yum and my source code is from GIT HEAD (albeit a while ago).
> 
> My configuration commands are:
> 
> ../rtems/configure --prefix=/home/rtems/rtems-411 --target=arm-rtems4.11 --enable-posix --enable-networking --enable-cxx --enable-maintainer-mode --enable-rtemsbsp="stm32f3"
> 
> ../rtems/configure --prefix=/home/rtems/rtems-411 --target=arm-rtems4.11 --enable-posix --enable-networking --enable-cxx --enable-maintainer-mode --enable-rtemsbsp="m4robot"
> 
> 




More information about the users mailing list