Support for ARM Compiler C library.
This commit add support for the ARM Compiler C libary in:
- Kconfig
- libc/armstdc
A new Kconfig symbol is added to allow a toolchain to specify if they
support linking with the minimal C library.
Also the CMake variable `TOOLCHAIN_HAS_NEWLIB` is exported to Kconfig
so that CONFIG_NEWLIB_LIBS can only be enabled if the toolchain has
newlib.
The armclang toolchain selects the CMake scatter file generator and
disables support for the LD linker template which is not supported by
armlink.
For the ARM Compiler C library, a corresponding lib/libc/armstc/ folder
with a minimal implementation to work with the ARM Compiler C library
is added.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
A "Linker script" choice group has been added to the linker options
menu.
The existing HAVE_CUSTOM_LINKER_SCRIPT config has been relocated inside
the linker script menu.
Two new entries has been created:
- LD template, for using the old ld template files together with the C
pre-processor to create the final linker script.
- CMake linker generator, used for ARMClang / armlink toolchain.
The CMake linker generator is also supported for LD linker scripts
for the ARM architecture.
In CMake, the file cmake/linker/ld/target.cmake has been updated to
support the CMake LD linker generator.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With demand paging and pinned sections enabled, it is possible for
data to be brought into physical memory as required by current
execution context. However, the kernel still assumes that all data
pages are present at boot which may not be desirable for certain
scenarios. This introduces a new kconfig to specify that those
data pages other than the boot and pinned sections are not present,
and they would be paged in on demand.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Introduce new Kconfig option MCUBOOT_ENCRYPTION_KEY_FILE. If the
string is not empty Cmake will try to encrypt the final binaries using
the given key file.
Signed-off-by: Helge Juul <helge@fastmail.com>
Always source the Zephyr base soc and shield (board root) Kconfigs
directly from Kconfig instead of generated Kconfig files.
This has the benefit that it is no longer necessary to generate Kconfig
files to source SoC root and shield (board root) when no custom roots
are provided.
Also this cleans up the doc/CMakeLists.txt and ensures that the
doc/CMakeLists.txt is not getting out of sync with the Kconfig.cmake.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Add compatibility mode with old sam-ba flash bootloaders that don't have
offset capabilities. These bootloaders flash to a pre-defined flash
region. At end, bossac will suppress --offset parameter.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This adds the necessary bits for linker scripts and source code
to specify which symbols need to be pinned in memory. This is
needed for demand paging as some functions and data must reside
in memory all the time and cannot be paged out (e.g. paging,
scheduler, and interrupt routines for functionality).
This is up to the arch/SoC/board to define the sections in
their linker scripts as the pinned section may need special
alignment which cannot be done in common script snippets.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds the necessary bits for linker scripts and source code
to specify which symbols are needed for boot process so they
can be grouped together.
One use of this is to group boot related code and data so these
won't interval with other kernel and application for better
caching.
This is a must for demand paging as some functions and data
must be available during the boot process and before the memory
manager is initialized. During this time, paging cannot be used
so symbols linked in virtual memory space are unavailable.
This is up to the arch/SoC/board to define the sections in
their linker scripts as section may need special alignment
which cannot be done in common script snippets.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1. This will help us identify if the relocation is to
SRAM which is used when setting up the MPU entry
for the SRAM region where code is relocated
2. Move CODE_DATA_RELOCATION configs to ARM specific
folder
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add a new Kconfig symbol that explicitly controls whether the vector
table should be placed in RAM. This eliminates the side effect of
`IS_BOOTLOADER` controlling vector table location. Making the condition
a positive assertion also allows the config to be used in CMakeLists
conditions (`zephyr_linker_sources_ifdef()`, etc).
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
When compiler results are piped through a non-terminal (e.g. ninja)
the compiler disables colour diagnostics. Using `-fdiagnostics-color`
forces the compiler to enable colour output. This flag is always
enabled for clang and gcc.
Setting `CONFIG_COMPILER_COLOR_DIAGNOSTICS=n` disables this
feature and reverts to plain diagnostic messages with no formatting.
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
There actually is no need for a separate kconfig here, as
the kernel VM address and SRAM address can be used to figure
out if the kernel is linked in virtual address space.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Its been 2 releases since we deprecated the old zephyr integer types.
We can now remove support for the Kconfig option, code, and, test to
allow the old int types to be supported.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add ability to build a UF2 (https://github.com/Microsoft/uf2)
image as an additional output type. This leverages the code
partition offset for the UF2 base address, and a configurable
UF2 family ID.
Includes an unmodified (except for headers for licensing, pylit
disabling) version of the uf2conv.py script copied the UF2
format specification repository, used to convert the bin to UF2.
Origin: UF2 file format specification reference utilies
License: MIT
URL: https://github.com/microsoft/uf2/blob/master/utils/uf2conv.py
commit: 587abb8b909266e9b468d6284f2fbd425235d1b5
Signed-off-by: Pete Johanson <peter@peterjohanson.com>
This adds the kconfig CONFIG_KERNEL_LINK_IN_VIRT and supporting
kconfigs to indicate that the linker script can link the kernel
in virtual address space. This is needed for demand paging where
the kernel can be bigger than physical address space.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This adds a new kconfig CONFIG_SRAM_OFFSET to specify the offset
from beginning of SRAM where the kernel begins. On x86 and
PC compatible platforms, the first 1MB of RAM is reserved and
Zephyr should not link anything there. However, this 1MB still
needs to be mapped by the MMU to access various platform related
information. CONFIG_SRAM_OFFSET serves similar function as
CONFIG_KERNEL_VM_OFFSET and is needed for proper phys/virt
address translations.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add a new Kconfig CONFIG_BUILD_OUTPUT_EFI and select that for boards
that want to generate an EFI application.
Make qemu_x86_64 also generate an EFI file, however do not enable this
by default yet.
Goal is to boot qemu using EFI to be able to test this path in the
future.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit introduces MODULE_EXT_ROOT which allows CMake and Kconfig
glue code to be placed outside of the Zephyr module repository.
This allows for placing glue code in Zephyr, but also allows users to
specify custom MODULE_EXT_ROOTs for glue code using either
`-DMODULE_EXT_ROOT` or `zephyr/module.yml` with
`build:settings:module_ext_root` settings.
MODULE_EXT_ROOT' is a list of directories, similar to other roots such
as BOARD_ROOT, DTS_ROOT, etc.
The Zephyr repo folder ${ZEPHYR_BASE} is always to the MODULE_EXT_ROOT
list as lowest priority.
For each MODULE_EXT_ROOT, the file
`<module_ext_root>/modules/modules.cmake` will be processed.
In Zephyr repo, the folder `modules/<module>/` contains CMakeLists.txt
and Kconfig glue code for the Zephyr module.
A Zephyr module can specify that CMakeLists.txt and Kconfig glue code is
placed in an external module root by specifying:
```
build:
cmake-ext: True
kconfig-ext: True
```
It is still possible to place the CMakeLists.txt and Kconfig files
directly in the Zephyr module using the existing:
```
build:
cmake: <path>
kconfig: <file>
```.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Don't show the option for MCUBoot bootloader support
when the image being built is MCUBoot itself.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Allow Kconfig to override default values of Kconfig symbols
defined in modules' Kconfig files. For that, the .defonfig
files need to be source'd before the modules' Kconfig files.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE
and use PM_ as the prefix for all PM related Kconfigs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Fixes: #28462
This commit allows shields to be defined in other BOARD_ROOTs, either
using `-DBOARD_ROOT=<path>` or a Zephyr module defined BOARD_ROOT.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Instruct Zephyr images that are loaded by MCUboot to
force the initialization of architecture core HW registers,
if the architecture supports the functionality.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The legacy macros were first deprecated in Zephyr v2.3. Now that
Zephyr v2.4 has been released, that makes two releases where these
macros have been deprecated, so it's OK to remove them.
This leaves support for legacy binding syntax in place. Removing that
is left to future work.
We need to update various pieces of documentation related to flash
partitions that never got updated when the new API was introduced.
Consolidate this information in the flash_map.h API reference page,
since that's really where users will run into it. This also gives us
the opportunity to improve this documentation.
Adjust a couple of kconfigfunctions.py and sanitycheck bits to use
non-legacy edtlib APIs.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add --pad to imgtool.py command line arguments when generating confirmed
images, otherwise the image contains no trailer magic for writing the
confirmed status.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Add new Kconfig options which depend on CONFIG_BOOTLOADER_MCUBOOT:
- CONFIG_MCUBOOT_SIGNATURE_KEY_FILE: the path to the key pair which
should be used to sign the image, in PEM format. This is sent to
imgtool via 'west sign' when set to produce zephyr.signed.bin and
zephyr.signed.hex files as needed.
- CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS: additional arguments to pass to
imgtool.
- CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE: also generate
zephyr.signed.confirmed.{bin,hex}
Add build system support for these options.
This makes a separate 'west sign' step unnecessary when using MCUboot,
if the application image is properly configured with the location of
the key file.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add a Kconfig option to enable compiler flags that help to enforce
some code guideline rules.
Note: As the current code base is not in compliance with the adopted
code guideline, some rules will generate warnings during the
build. This is intended to help to spot violations.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The text "need by some platforms" in various CONFIG_BUILD_OUTPUT_FOO
help is grammatically incorrect. Fix this by rewording.
Move 'config BUILD_NO_GAP_FILL' to before the list of 'config
BUILD_OUTPUT_FOO' definitions instead of sandwiching it inside.
Fix the extension of the stripped binary.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit introduces support for multiple SOC_ROOT.
This means that additional SOC_ROOTs specified using -DSOC_ROOT as
argument to CMake will be forming a list together with ${ZEPHYR_BASE}.
This allows for greater flexibility, as developers can now specify
multiple out-of-tree SoCs and not worry about the SoC used for the
board they compile for.
Also it avoid code, such as:
if(BOARD STREQUAL my_board_using_out_of_tree_soc)
set(SOC_ROOT some/out/of/tree/soc/path)
endif()
in application CMakeLists.txt.
Finally, allowing multiple SOC_ROOTs prepares for specifying SOC_ROOTs
in Zephyr modules.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit relocates the generated Kconfig.modules file from
${CMAKE_BINARY_DIR} into ${CMAKE_BINARY_DIR}/Kconfig.
This is done as preparation of multiple SOC and ARCH root support.
A single Kconfig folder inside ${CMAKE_BINARY_DIR} helps to keep the
build folder tidy.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This adds a new config option for SAM0 targets that use the BOSSA
bootloader. If the CDC ACM driver is also enabled, then the
programmer can automatically reset the board into the bootloader for
programming.
Signed-off-by: Michael Hope <mlhx@google.com>
The `TEXT_SECTION_OFFSET` symbol is used to specify the offset between
the beginning of the ROM area and the address of the first ROM section.
This commit renames `TEXT_SECTION_OFFSET` to `ROM_START_OFFSET` because
the first ROM section is not always the `.text` section.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Description was updated so reflects fact that this
option activates SW_VECTOR_RELAY_CLIENT feature now.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Remove Kconfig, linker script, and related bits associated with
CUSTOM_RODATA_LD, CUSTOM_RWDATA_LD, CUSTOM_SECTIONS_LD,
SOC_NOINIT_LD, SOC_RODATA_LD, and SOC_RWDATA_LD options that have been
deprecated since Zephyr 2.2.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
As the int types defined in include/zephyr/types.h are typdef's we
utilize a Kconfig option (LEGACY_ZEPHYR_INT_TYPES) to enable/disable
the support for them. By default to LEGACY_ZEPHYR_INT_TYPES not
being enabled and add an explicit test to ensure the types continue to
function until removed in the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Set LEGACY_DEVICETREE_MACROS to default to no since we are deprecating
the old macro style and all in tree users are now converted.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added support for creating an assembly listing containing all sections
like rodata, data and debug sections, not just those expected to
contain instructions.
Signed-off-by: Rohit Gujarathi <gujju.rohit@gmail.com>
This default-y option allows continued use of the legacy devicetree
macros.
There are no functional changes yet, but when this is default n,
old-style DT code won't build. At that point, adding any of these will
be a fix to keep old-style code working:
- "CONFIG_LEGACY_DEVICETREE_MACROS=y" to prj.conf
- "-- -DCONFIG_LEGACY_DEVICETREE_MACROS=y" to the west build command
- "-DCONFIG_LEGACY_DEVICETREE_MACROS=y" to the cmake command
This option can be changed to default n in time for the Zephyr 2.3
release. That will provide users of Zephyr 2.2 with a smooth migration
path to the new devicetree.h API after 2.3 is released, which
nonetheless will alert them immediately that something is wrong due to
build errors.
Unfortunately, __DEPRECATED_MACRO is not sufficient in all cases as a
warning to users. This is because, at least in GCC, macros defined
using __DEPRECATED_MACRO cannot be used in preprocessor lines like
"#if DT_SOME_LEGACY_MACRO".
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Since we already have similarly licensed 3-clause BSD files in the tree,
and in particular in our minimal libc, move the fnmatch functionality
from ext/ to lib/.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
mcuboot.overlay is not used any more when BOOTLOADER_MCUBOOT Kconfig
option is selected. Update the documentation accordingly.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Group the 'source's of Kconfig.defconfig files together to make it
clearer what the comment is talking about. Remove blank lines between
the other 'source's too, splitting the 'source's into two groups.
Also touch up the comment to make it more concrete and shorten it a bit.
Mention that it applies to 'choice's as well.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Even though it looks logical to not expose BUILD_NO_GAP_FILL
when we don't expect to use objcopy for creation of .bin, .hex etc
in reality generation of at least zephyr.hex happens if one wants
to use openocd runner, see CMakeLists.txt:
---------------------------->8----------------------
if(CONFIG_BUILD_OUTPUT_HEX OR BOARD_FLASH_RUNNER STREQUAL openocd)
set(out_hex_cmd "")
set(out_hex_byprod "")
set(out_hex_sections_remove
.comment
COMMON
.eh_frame
)
bintools_objcopy(
RESULT_CMD_LIST out_hex_cmd
RESULT_BYPROD_LIST out_hex_byprod
STRIP_ALL
GAP_FILL ${GAP_FILL}
TARGET_OUTPUT "ihex"
SECTION_REMOVE ${out_hex_sections_remove}
FILE_INPUT ${KERNEL_ELF_NAME}
FILE_OUTPUT ${KERNEL_HEX_NAME}
)
list(APPEND
post_build_commands
${out_hex_cmd}
)
list(APPEND
post_build_byproducts
${KERNEL_HEX_NAME}
${out_hex_byprod}
)
endif()
---------------------------->8----------------------
So if there's a good reason to disable gap filling
(like funny memory map wit huuuuge holes) let's keep that opportunity
instead of relying on sanity of all the other code.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>