BSP_CONSOLE_MINOR option for Zynq board with new build system

Gedare Bloom gedare at rtems.org
Fri Sep 25 15:08:21 UTC 2020


On Fri, Sep 25, 2020 at 8:13 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> Hello Jan,
>
> On 25/09/2020 15:36, Jan.Sommer at dlr.de wrote:
> > Hello,
> >
> > I am currently making my first steps with the new build system and so far it is amazing.
> > Especially, the inheritance option is very handy for maintaining different configurations.
> > Therefore, a big thank you to Sebastian and everyone else involved.
> thanks for having a look at it.
> >
> > I ran into a smaller problem when compiling for a zynq-board.
> > I tried to override BSP_CONSOLE_MINOR=0, but it seems that the option is interpreted as a Boolean and then the define not set.
> > At least I run into:
> > ../../../bsps/arm/xilinx-zynq/start/bspreset.c: In function 'bsp_reset':
> > ../../../bsps/arm/xilinx-zynq/start/bspreset.c:37:49: error: 'BSP_CONSOLE_MINOR' undeclared (first use in this function)
> >     37 |   zynq_uart_reset_tx_flush(&zynq_uart_instances[BSP_CONSOLE_MINOR]);
>
> Yes, this could be a potential problem in several BSPs. I used a script
> to convert the BSP options, but to detect if it was an integer or
> boolean type was just an heuristic. In order to fix this, you first have
> to find the build specification item of the option:
>
> spec/build/bsps/arm/xilinx-zynqmp/optconminor.yml:name: BSP_CONSOLE_MINOR
> spec/build/bsps/arm/xilinx-zynq/optconminor.yml:name: BSP_CONSOLE_MINOR
>
> So, we have this option duplicated. This is an issue on its own. At some
> point in time we should unify the options across the BSPs.
>
Yes, I imagine we should like to use 'shared' folders at several
levels of the spec/.../bsps tree

> Then open the file (spec/build/bsps/arm/xilinx-zynq/optconminor.yml):
>
> SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> actions:
> - get-boolean: null
> - define-condition: null
> build-type: option
> copyrights:
> - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> default: true
> default-by-variant: []
> description: |
>    minor number of console device
> enabled-by: true
> links: []
> name: BSP_CONSOLE_MINOR
> type: build
>
> Under actions you see what is done with the value specified by the
> configuration file (or the default value). See also:
>
> https://docs.rtems.org/branches/master/eng/req/items.html#spectypebuildoptionaction
>
> This patch fixes probably the issue:
>
> diff --git a/spec/build/bsps/arm/xilinx-zynq/optconminor.yml
> b/spec/build/bsps/arm/xilinx-zynq/optconminor.yml
> index 55074c6dac..486eb92d33 100644
> --- a/spec/build/bsps/arm/xilinx-zynq/optconminor.yml
> +++ b/spec/build/bsps/arm/xilinx-zynq/optconminor.yml
> @@ -1,15 +1,16 @@
>   SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
>   actions:
> -- get-boolean: null
> -- define-condition: null
> +- get-integer: null
> +- define: null
>   build-type: option
>   copyrights:
>   - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> -default: true
> +default: 1
>   default-by-variant: []
>   description: |
>     minor number of console device
>   enabled-by: true
> +format: '{}'
>   links: []
>   name: BSP_CONSOLE_MINOR
>   type: build
>
> The integer options need a "format" attribute.
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list