Commit Graph

1136 Commits (8c4258ceb50333685624ea506b9db760dd3c1a39)

Author SHA1 Message Date
Jimmy Brisson 6fa1de2161 Generate GNU ARM Eclipse's .mbedignore with Jinja2 2017-04-11 14:11:44 -05:00
0x6d61726b 5be47f1e2b Update c_blob_mbed.tmpl
- critical.h is deprecated, replaced with "platform/mbed_critical.h"
- typo corrected
2017-04-11 20:30:34 +02:00
Sam Grove e3edbabbcc Merge pull request #4107 from theotherjimmy/config-name-app
Allow configuration of artifact name in app config
2017-04-10 16:37:34 -05:00
Jimmy Brisson 55884de07e Merge pull request #4115 from cvtsi2sd/master
Support for Qt Creator Generic project export and associated Makefile
2017-04-10 16:17:14 -05:00
Sam Grove 0b1117793f Merge pull request #4069 from theotherjimmy/preproc-linker-gnuarmeclipse
Update gnuarmeclipse to preprocess linker scripts
2017-04-10 11:10:58 -05:00
Sam Grove cef31a7fa6 Merge pull request #4106 from theotherjimmy/fix-typo-toolchain
Fix a scoping typo in toolchains
2017-04-10 10:51:07 -05:00
Sam Grove 09de12161a Merge pull request #4013 from theotherjimmy/fix-subtract-basepath
Fix a small bug in subtract_basepath
2017-04-10 10:22:57 -05:00
Bartek Szatkowski cc71f3f5d4 Introduce MBED_DEBUG macro for debug build profile 2017-04-10 11:40:04 +01:00
Jan Jongboom 336e036e74 Visual Studio Code exporter 2017-04-10 09:26:25 +02:00
Anna Bridge a514216c8b Merge pull request #4098 from theotherjimmy/fail-on-bad-config
Raise error when mbed_app.json is bad
2017-04-07 12:35:49 +01:00
Matteo Italia 2baa215487 Updated year in license header 2017-04-06 23:19:52 +02:00
Brian Daniels 4d4e4a3ef9 Removing old filesystem test 2017-04-06 14:18:37 -05:00
Sam Grove 9c141b6547 Merge pull request #3911 from anangl/fix_iar_exporter
IAR exporter: extended debugger settings template with modifiable options needed for Nordic targets
2017-04-06 10:58:38 -05:00
Sam Grove 14eadf389e Merge pull request #4085 from wdwalker/master
Fix mbed-cli issue #468. Add LPCTargetCode.lpc_patch to POST_BINARY_WHITELIST
2017-04-06 10:47:12 -05:00
Sam Grove caded3805e Merge pull request #4072 from seppestas/patch-3
Removed superfluous space
2017-04-06 10:40:58 -05:00
Sam Grove 2ab3eda361 Merge pull request #4070 from theotherjimmy/optionally-add-regions
Elide adding regions to profile when empty
2017-04-06 10:35:05 -05:00
Sam Grove fdf1ed623e Merge pull request #3994 from theotherjimmy/fix-output-ext
Use OUTPUT_EXT to pick binary type
2017-04-06 08:37:52 -05:00
Matteo Italia 92eae30c40 Qt Creator exporter: added derivation from GccArm Makefile
this allows Qt Creator to build the generated project "out of the box",
enabling integration with the "Issues" list
2017-04-06 11:22:21 +02:00
Matteo Italia 70412ec5a6 QtCreator exporter: switch to jinja-based templates
this also makes so that the export directory setting is honored
2017-04-06 11:22:01 +02:00
Matteo Italia f3ccfbe267 Added minimal support for Qt Creator projects 2017-04-05 11:43:50 +02:00
Jimmy Brisson 6a646eb4b2 Allow configuration of artifact name in app config 2017-04-04 14:36:01 -05:00
Jimmy Brisson d5ecd7adf8 Fix a scoping typo in toolchains 2017-04-03 15:43:22 -05:00
Jimmy Brisson 74998d649a Change target hooks to use correct input format
The input format is now determined by the OUTPUT_EXT key in
targets.json, and defaults to "bin" when not specified. This changes the
Teensy3_1 and the NRF51x targets' post bulid hooks.

Teensy3_1 just converted to intelhex, so we do nothing instead.

NRF51x assumed that it was taking in a bin format file. I made it detect
file type by extension.
2017-04-03 14:54:38 -05:00
Jimmy Brisson 20edbe3525 Fix a small bug in subtract_basepath
It was causing tracebacks on the website
2017-04-03 11:44:25 -05:00
Jimmy Brisson 1faf44e82b Raise error when mbed_app.json is bad 2017-03-31 15:09:17 -05:00
Michael Bartling 91ed457ce0 resolved import conflict 2017-03-31 09:56:58 -05:00
Michael Bartling aebd9810f9 make.py -S toolchains now just prints the toolchains, no more mbed OS x 2017-03-31 09:55:08 -05:00
Michael Bartling 111a65b53d Added ability to list ides 2017-03-31 09:55:08 -05:00
Michael Bartling f142939937 Added ability to list targets and toolchains in a non matrix form.
This is super helpful for the tab completion generation script as we no
longer have to parse the matrix output.
2017-03-31 09:54:03 -05:00
Willie Walker 13247426f9 Fix mbed-cli issue #468. Add LPCTargetCode.lpc_patch to POST_BINARY_WHITELIST. 2017-03-30 15:22:57 -04:00
Seppe Stas 886713d290 Removed superfluous space
The extra space between "--no_wrap_diagnostics" and "-e" is inconsistent with the development and release targets.

It bugs people (like me) that have little OCD tics 😉.
2017-03-30 10:19:36 +02:00
Sam Grove 782395dfa7 Merge pull request #4049 from tung7970/fix-tools
tools - turn off page alignment of sections
2017-03-29 23:05:47 +01:00
Jimmy Brisson 09afe23762 Upgrade OUTPUT_EXT and use it to pick binary type
targets.json contained a key for some targets, `OUTPUT_EXT`, which I
moved to `Target`, the root of all targets. Following on that, the tools
now use this extension provided by `OUTPUT_EXT` to determine the file
type of the output executable.
2017-03-29 16:46:21 -05:00
Sam Grove 405ab0c005 Merge pull request #4000 from theotherjimmy/config-typechecking
Add some type checking of configs
2017-03-29 22:39:57 +01:00
Sam Grove c958eb45bb Merge pull request #3998 from theotherjimmy/remove-dead-code
Remove dead code in tools
2017-03-29 22:28:29 +01:00
Sam Grove 432162f9e3 Merge pull request #3997 from theotherjimmy/remove-project-api
Move contents of project_api to export/__init__.py
2017-03-29 22:26:59 +01:00
Sam Grove 8784913052 Merge pull request #3995 from theotherjimmy/targets-refactor
Move target related code into it's own directory
2017-03-29 22:25:46 +01:00
Jimmy Brisson 8b3f08ed49 Elide adding regions to profile when empty 2017-03-29 15:49:16 -05:00
Jimmy Brisson 6a3c71c002 Update gnuarmeclipse to preprocess linker scripts 2017-03-29 14:52:11 -05:00
0xc0170 137e47f5e8 tools: add new examples
Bootloader, bootloader blinky and fat filesystem examples added.
2017-03-29 17:27:11 +01:00
Tony Wu 72589dfef3 tools - turn off page alignment of sections
By default, ld sets page alignment of sections to 0x8000, which bloats
up elf file size. This behavior is unnecessary for MCU.

Example:

1. page alignment on

mbed.elf file size 144936

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x008000 0x00000000 0x00000000 0x00400 0x00400 R   0x8000
  LOAD           0x008400 0x00000400 0x00000400 0x00010 0x00010 R   0x8000
  LOAD           0x008410 0x00000410 0x00000410 0x0ab3c 0x0ab3c RWE 0x8000
  LOAD           0x018000 0x20000000 0x0000af4c 0x008d0 0x008d0 RW  0x8000
  LOAD           0x01b81c 0x0000b81c 0x0000b81c 0x00000 0x00004 RW  0x8000
  LOAD           0x020000 0x1fff0000 0x1fff0000 0x00000 0x00400 RW  0x8000
  LOAD           0x0188d0 0x200008d0 0x200008d0 0x00000 0x08860 RW  0x8000

2. page alignment off

mbed.elf file size 91792

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000114 0x00000000 0x00000000 0x00400 0x00400 R   0x4
  LOAD           0x000514 0x00000400 0x00000400 0x00010 0x00010 R   0x1
  LOAD           0x000528 0x00000410 0x00000410 0x0ab3c 0x0ab3c RWE 0x8
  LOAD           0x00b068 0x20000000 0x0000af4c 0x008d0 0x008d0 RW  0x8
  LOAD           0x00b938 0x0000b81c 0x0000b81c 0x00000 0x00004 RW  0x1
  LOAD           0x00b938 0x1fff0000 0x1fff0000 0x00000 0x00400 RW  0x1
  LOAD           0x00b938 0x200008d0 0x200008d0 0x00000 0x08860 RW  0x8

Signed-off-by: Tony Wu <tonywu@realtek.com>
2017-03-29 05:48:30 +08:00
Sam Grove cd7abc019f Merge pull request #3996 from c1728p9/algo_generation
Check in algo generation code
2017-03-27 10:32:14 +01:00
0xc0170 424fd78161 flash: fix flash algo generated - protect with DEVICE_FLASH 2017-03-26 17:59:40 +01:00
Anna Bridge a49144a0b2 Merge pull request #3922 from adbridge/master
Fixed/improved error parsing from API messages.
2017-03-24 14:16:30 +00:00
Russ Butler 70f32526b3 Check in algo generation code
Check in scripts which are able to generate flash algos for supported
targets.

To initially download all packs the following command should be run:
"python extract.py --rebuild_all"

After that all supported targets can be rebuilt by running:
"python extract.py"

Finally, to rebuild an individual target you can used its pack name:
"python extract.py --target STM32F302R8"
2017-03-23 13:57:12 -05:00
Jimmy Brisson 75ec7b744e Remove dead code in tools 2017-03-23 11:39:40 -05:00
Jimmy Brisson d5637bb785 Add some type checking of configs
Before, the types were not checked and just expected. The old behavior
would cause lots of tracebacks, or, much worse, convert things like:
```
{
     "target_overrides": {
        "*": {
		"target.macros_add": "CONFIG_GPIO_AS_PINRESET"
        }
     }
}
```
into a definition of each of the letters as macros that expand to
nothing, causing massive compilation problems.

I resolved this by adding some type checking to the config data. Now
there is a type check for most of the fields within a library and
application configurations.
2017-03-22 16:55:07 -05:00
Jimmy Brisson 70ac60710c Move contents of project_api to export/__init__.py
The file `project_api.py` was poorly named and caused much confusion.
Given that it was actually a front end to the exporters, I put it into
the export sub-dir.
2017-03-22 15:56:35 -05:00
Jimmy Brisson f590dc11bd Move target related code into it's own directory
This should make it easier to navigate the code base
2017-03-22 15:20:09 -05:00
Sam Grove ead3170d0f Merge pull request #3933 from phyokyaw/master
#3593 Added template entry to fix exported project build error.
2017-03-22 12:05:12 +00:00
Sam Grove 16304ae18d Merge pull request #3924 from theotherjimmy/fix-export-build-dir
Don't set the build_dir to anything on export
2017-03-22 12:04:34 +00:00
Anna Bridge 6850ff06b9 Updated script to add an extra feature and general improvements.
Added the ability to specify a branch to update rather than a fork
Replaced print commands with the use of a logger
Updated the run_cmd functions in line with previous improvements
2017-03-16 16:59:11 +00:00
Anna Bridge 828b7ac7c6 Add an ignore list so that sets of test, target can be excluded from the
compilation set.
2017-03-16 15:46:20 +00:00
Anna Bridge 9649d36dbb Added running total for target being compiled. 2017-03-14 17:46:53 +00:00
Jimmy Brisson 4219d9cfc6 Don't set the build_dir to anything on export
When constructing a toolchain for export, we currently set the
`build_dir` to the `export_dir`. When exporting offline, the
`export_dir` is always set to the root of the project. The toolchains
ignore their `build_dir` when scanning for sorces, so when the exporters
use the toolchains to scan for their resources, they get nothing.

In this patch we set the `build_dir` of the toolchain that the exports
use to nothing. A path of nothing should not match anything, and will
therefore not ignore everything when scanning for resources.
2017-03-14 11:27:19 -05:00
Anna Bridge 63fb7bd58d Merge pull request #3931 from c1728p9/arm_pack_manager_improvements
Arm pack manager improvements
2017-03-14 14:47:35 +00:00
Anna Bridge ae10ca8787 Merge pull request #3895 from theotherjimmy/find-exec-in-path
Use PATH env variable when gcc found in PATH
2017-03-14 14:41:32 +00:00
Phyo Kyaw a301527c71 This change is for RZ_A1H and VK_RZ_A1H target. 2017-03-14 14:08:01 +00:00
Anna Bridge ca6bfe0cfa Review comments: Add a child logger, close json file after reading, minor
formatting updates.
2017-03-14 12:45:56 +00:00
Russ Butler cefdce2a37 tools: fix usage of aliases.json
Load aliases.json from mbed-os rather than from a temporary
directory.
2017-03-13 18:05:28 -05:00
Russ Butler 47ee9677e5 tools: Rebuild index.json and aliases.json
Rebuild the json files used by arm-pack-manager now that a bug in
version selection has been fixed.
2017-03-13 16:32:57 -05:00
Russ Butler fa38fbb7b3 tools: fix package version in arm pack manager
Use python's LooseVersion to get the correct version.
2017-03-13 16:32:53 -05:00
Russ Butler 44bc754be5 tools: Allow all flash algos to be retrieved
Add an 'all' parameter to get_flash_algorthim_binary. When set
an enumerator of all flash algorithms is returned. rather than just
the first flash algorithm.
2017-03-13 16:32:49 -05:00
Jimmy Brisson a937ee00f2 Fix toolchain path names in Mbed 2 builds
I accidentally broke only uARM mbed 2 builds. Here is the story: When
scanning for resources, toolchains look for any `TOOLCHAIN_<classname>`
folders to include. These `<classname>`s mostly match the name passed in
on the command line with one exception: `uARM` on the command line maps
to `ARM_MICRO` the class. This would not be a problem except for the bug
that I introduced in a prior commit. The bug is that the mbed2 library
builds will use the name passed in on the command line to construct
`TOOLCHAIN_<cli-name>`. This will not match when scanning.

I fixed it by translating the `<cli-name>` into the `<classname>`.
2017-03-10 11:08:56 -06:00
Anna Bridge e3dbb82634 Fixed/improved error parsing from API messages.
Fixed results output summary.
General tidy up of long lines.
Added a new field to json file, target_list, to allow the user to
override the set of targets used for the compilation.
2017-03-10 12:21:32 +00:00
Martin Kojtal e9158f4782 Merge pull request #3852 from theotherjimmy/ignore-build-dir
Ignore build directory from scan resources
2017-03-09 15:45:47 +00:00
Martin Kojtal 93b6a21db6 Merge pull request #3897 from theotherjimmy/supress-levenshtein
Ignore FuzzyWuzzy warnings
2017-03-09 15:33:25 +00:00
Głąbek, Andrzej 377f759304 IAR exporter: extended debugger settings template with modifiable options needed for Nordic targets. 2017-03-08 11:06:35 +01:00
Jimmy Brisson 4408c01522 Add unit test for gcc path specifications 2017-03-07 11:41:56 -06:00
Jimmy Brisson b2901098cd Update test_api call to prepare_toolchain
An earlier patch in this series changed the API for
`build_api.prepare_toolchain`. This commit updates the `find_test`
function to call `prepare_toolchain` correctly.
2017-03-06 18:37:46 -06:00
Jimmy Brisson d20bcba89b Remove static analysis scan
An earlier patch in this series relies on the assumption that all
toolchain construction goes through `prepare_toolchain`. This is still
not the case. The only remaining user of the `mbedToolchain` object that
does not go through `prepare_toolchain` is the static analysis scanner.
It's basically dead-code at this point. I say we remove it. So this
patch removes it.
2017-03-06 18:29:46 -06:00
Jimmy Brisson 51aa3330dd Re-factor mbed2 lib builds to use prepare_toolchain
The prior patch in this series makes the assumption that any building
will go through `build_api.prepare_toolchain`. This was not a valid
assumption for the mbed2 build process. So, instead of maintaining 2
ways of using the toolchain classes, I elected to unify on
`prepare_toolchain`.
2017-03-06 18:23:16 -06:00
Jimmy Brisson fbb6f71be8 Ignore build directory from scan resources
This is a bug fix for the following bug (Github issue #437):

If two builds were run specifying a non-default build folder, the second
build would fail to link with duplicate symbols and may not fit on the
device. The root of this problem is that these non-default build folders
are not ignored by scan-resources, and therefore included in the build.

We fix this bug by ignoring the build directory passed into the tools.
2017-03-06 17:10:57 -06:00
Jimmy Brisson f306ffa4ee Ignore FuzzyWuzzy warnings
Nobody actually cares.
2017-03-06 17:07:14 -06:00
Jimmy Brisson a5745cadd9 Use PATH env variable when gcc found in PATH
Resolves the github issue #3790: Blinky fails to build (on Mac) after
addition of linker script preprocessing feature. Paraphrasing, this
issue is that Homebrew on mac does not install `arm-none-eabi-gcc` in
the same location as `arm-none-eabi-cpp`, the C Pre-Processor. The tools
prior to this commit, and after turning on the pre-processing of the
linker-script will fail on any Mac homebrew installed toolchains.

This commit resolves the above issue by allowing the toolchain's path to
the executable to remain empty after a call to `check_executable`. When
this path is empty, the tools will search the PATH environment variable
for the executable.
2017-03-06 15:24:58 -06:00
Martin Kojtal bc8e2ec887 Merge pull request #3875 from theotherjimmy/export-postbuild-whitelist
Add post-build hook white-list to exporters
2017-03-06 16:57:36 +00:00
Martin Kojtal 2b60e0334a Merge pull request #3870 from 0xc0170/fix_issue#3865
Export: fix issue #3865 - cmsis-dap swd
2017-03-03 14:52:10 +00:00
Jimmy Brisson fcef9a7c50 Add post-build hook white-list to exporters
We have scripts (written in python) that are run after a binary image is
created in the tools. These scripts are not really exportable, as they
are part of the tools and may include and use any bits of python code
they please. So we don't export them. This patch disables export
combinations that would not work because the post-binary hook is not
exported. A white-list is used for forward compatibility.
2017-03-02 15:01:14 -06:00
Martin Kojtal e116b38c8d Export: fix issue #3865 - cmsis-dap swd
From JTAG to SWD by default. This was causing flashing error.
2017-03-02 12:52:35 +00:00
Jimmy Brisson d2f2603892 Add the FPU field to the <Cpu> tag it Keil
Recently the Keil IDE has released version 5.23. This version requires
the FPU to be set as part of the <Cpu> tag in the .uvprojx (XML project
file). This patch adds the appropriate FPU settings based on the
trailing F (FPU enabled) or FD (Double precesion FPU enabled) string of
the core.
2017-03-01 14:16:12 -06:00
Sam Grove 9844a390d9 Merge pull request #3762 from simonqhughes/ms_20170213_fs_integration
STORAGE: Merging feature-storage branch commits to master
2017-02-24 11:37:42 -06:00
Sam Grove 2e5f2e96fb Merge pull request #3818 from adbridge/master
Add new script to automate compilation of all mbed-os 2 targets in online IDE
2017-02-23 15:44:41 -06:00
Anna Bridge 415486e780 Removed unecessary exception and replaced with a logging error. 2017-02-23 19:02:55 +00:00
Anna Bridge e95092c91a Address review comments
Replace use of print and write with logging (with different levels).
Add the ability to choose the logging level on the command line.
Fix the exclusion of uARM from compilation.
Remove print_on_fail from run_cmd() functions, now use logging.
2017-02-23 17:51:23 +00:00
Simon Hughes 7b7db588ff STORAGE: remove RTOS_9 test from tests.py. 2017-02-23 16:39:53 +00:00
Simon Hughes 5a977eff30 STORAGE: PR 3762 fix to remove FAT_FS, SD_FS, FS_LIBRARY from tools scripts. 2017-02-23 16:39:46 +00:00
Simon Hughes e43f667174 STORAGE: PR 3762 fix to remove FAT_FS, SD_FS, FS_LIBRARY from tools/libraries.py and tools/tests.py 2017-02-23 16:39:44 +00:00
Simon Hughes 840c77793b STORAGE: Pull request 3762 review feedback changes.
- Fixing code formatting errors with astyle tool.
- Replaced use of TOOLCHAIN_xxx macros with compiler emitted macros.
- Added const to BlockDevice::get_xxx_size() member functions.
- Added documentation for FAT filesystem thread support.
- Added documentation for fat_filesystem_set_errno().
- Added documentation clarifying the reasons for errno/stat symbol definitions in retarget.h.
- Removed FAT filesystem from mbed 2 testing.
- Fixed FATMisc.h Copyright (c) 2016 year to 2017 as its a new file.
- Removed #ifndef NDEBUG from HeapBlockDevice.cpp.
- Removed unnecessary todo comment in retarget.cpp.
2017-02-23 16:39:42 +00:00
Simon Hughes a79062f876 Remove build_travis.py NUCLEO_F412ZG usb tests which requires other commits. 2017-02-23 16:39:34 +00:00
Christopher Haster 90429f60c8 Fixed mbed 2 build_travis with block device
Conflicts:
	tools/build_travis.py
2017-02-23 16:37:15 +00:00
Simon Hughes 5c7fdc13c7 FILESYSTEM: renamed features/TESTS/fs-fat features/TESTS/filesystem. 2017-02-23 16:30:23 +00:00
Simon Hughes 4acf33f436 FILESYSTEM: moved FAT filesystem implemenation to features/filesystem subdir, and fs-fat tests to features/TESTS. 2017-02-23 16:30:21 +00:00
Sam Grove ba2176323c Merge pull request #3733 from theotherjimmy/feature-bootloader
Enable boot-loader builds
2017-02-23 10:18:31 -06:00
Jimmy Brisson d62f046e57 Fail bootloader builds on targets that don't support it
This patch will prevent building bootloader builds on targets that have
not yet had their linker scripts/scatter files changed to allow for the
ROM space shrinking expected by bootloader builds. At the point of this
patch, bootloader linker script modifications are only supported by the
NUCLEO_F429ZI, K64F, KL46Z, and Odin.
2017-02-22 18:27:23 -06:00
Jimmy Brisson 9a63bfb1fb Enable boot-loader builds
To enable a boot-loader style application, override
"targets.bootloader_exec" or "targets.restrict_size" on a particular
target. These parameters are a bin or hex file, and an integer, in bytes,
respectively. If either override is present, then an application region
is created after the boot-loader region, when "targets.bootloader_exec"
is present, and before post-application, when "targets.restric_size" is
present. The size of the boot-loader region is read from the file
provided in the configuration.
2017-02-22 18:20:26 -06:00
Sam Grove 067f5a0fef Merge pull request #3791 from theotherjimmy/remove-cr
Remove GCC_CR and refurbish LPCXpresso exporter
2017-02-22 13:33:14 -06:00
Sam Grove 988a1891b2 Merge pull request #3797 from theotherjimmy/remove-export-readme
Remove export subdir readme
2017-02-21 10:57:35 -06:00
Anna Bridge 251ef81719 Fix indentation level to be consistent. 2017-02-21 15:41:17 +00:00
Anna Bridge 42f98616e2 New script for automating the compilation of mbed-os 2 targets.
Usage: python tools/check_release.py
Run from the mbed-os directory.

For details on how the script works and how to set up the configuration
json file, please see the python file header.
2017-02-21 15:33:52 +00:00
Jimmy Brisson 1f64e2bc43 Remove export subdir readme
It was really out of date, and is the same as `mbed export -S`. This
makes me think that it's useless
2017-02-17 11:07:22 -06:00