Commit Graph

529 Commits (00feaa02f21f032f692e765745fa467c34b9de34)

Author SHA1 Message Date
Jimmy Brisson 2fe708d526 added features support to all of the toolchains 2016-06-03 14:03:50 -05:00
Sam Grove d94627e042 move target description from tools into hal where the target code lives 2016-05-28 12:46:08 +08:00
Bogdan Marinescu bc063a3903 Moved target definitions to JSON format
(long commit message ahead. Sorry about that, it can't be helped.)

This commit changs targets definition from Python to JSON format, as
part of the configuration mechanism implementation. There is a new file
under workspace_tools/ called "targets.json" which contains the target
definitions. "targets.py" remains, but becomes a wrapper on top of
"targets.json", with the same interface as before. This has the
advantage of not requiring code changes outside "targets.py".

Most of the JSON definitions of targets were automatically generated by a
script (available upon request since it doesn't make a lot of sense to
include it here), only those targets that had more than one parent in
the Python implementation were converted by hand. The target definitions
should be pretty self-explanatory. A number of things are different in
the JSON implementation (this is just a summary, check docs/mbed_targets.md
(also part of this PR) for a more complete description):

- "program_cycle_s" is now a value (as opposed to a function in the
Python implementation), since it only returned a number in all the
Python target implementations. The main definition that actually contains
some code (in class "Target") remains in target.py
- array values in "macros" and "extra_labels" can be modified
dynamically. Values can be added using "macros_add" and
"extra_labels_add" or removed using "macros_remove" and
"extra_labels_remove". This mechanism is available for all attributes
with a list type, but it's currently enabled only for "macros" and
"extra_labels" to keep things simple.
- "init_hooks"/"binary_hook" are now implemented in terms of a single
JSON key valled "post_binary_hook". The corresponding code is also in
"targets.py", under the various TargetCode classes (see for example
LPC4088Code in targets.py).

Just like in the Python implementation, a target can inherit from zero,
one or more targets. The resolution order for the target's attributes
follows the one used by the Python code (I used
http://makina-corpus.com/blog/metier/2014/python-tutorial-understanding-python-mro-class-search-path
as a reference for the implementation of resolution order).

This is obviously a very dangerous commit, since it affects all targets.
I tested compilation for a number of targets (K64F, LPC1768, NRF51822)
but there's definitely a lot more to be done in terms of testing.

I also tried to test in a different way: I wrote a script that imports the
old (Python) and the new (JSON) implementations and verifies that the
attributes in the old implementations exist and have the same values
in the new implementations (it also verifies that the attribute
resolution order is the same in the two implementations). If you're
interested, the script is here:

https://gist.github.com/bogdanm/c9d8cf34214109a4b9079befed6b3c0c

And the results of running the script are below (note that the script
outputs only the target names that were found to be problematic):

NRF51_MICROBIT_BOOT:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT_BOOT', 'MCU_NRF51_16K_BOOT_S110', 'MCU_NRF51_16K_BOOT_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT_BOOT', 'MCU_NRF51_16K_BOOT_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_BOOT_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_BOOT', 'MCU_NRF51_16K_S110', 'NRF51_MICROBIT']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_BOOT', 'NRF51_MICROBIT']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_BOOT', 'TARGET_OTA_ENABLED', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NRF51_16K_BOOT', 'TARGET_OTA_ENABLED', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
NRF51_MICROBIT:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT', 'MCU_NRF51_16K_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NRF51_16K_S110', 'MCU_NORDIC_16K', 'MCU_NRF51_16K']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_NRF_LFCLK_RC']
NRF51_MICROBIT_OTA:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT_OTA', 'MCU_NRF51_16K_OTA_S110', 'MCU_NRF51_16K_OTA_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT_OTA', 'MCU_NRF51_16K_OTA_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_OTA_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_OTA', 'MCU_NRF51_16K_S110', 'NRF51_MICROBIT']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_OTA', 'NRF51_MICROBIT']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_OTA', 'TARGET_OTA_ENABLED', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NRF51_16K_OTA', 'TARGET_OTA_ENABLED', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
NOT OK: ['NRF51_MICROBIT', 'NRF51_MICROBIT_BOOT', 'NRF51_MICROBIT_OTA']

The reasons for the above output are subtle and related to the
extremely weird way in which we defined target data in the Python
implementation: we used both class attributes and instance attributes.
This can complicate resolution order quite a bit and those two levels
don't exist in JSON: there's only one attribute type (equivalent to
Python's instance attributes). To make that work, I had to change the
inheritance order of the above targets (that use multiple inheritance)
which in turn changed the order of some macros and extra_labels (and of
course the resolution order). No harm done: the values are the same,
only their ordering is different. I don't believe this causes any
problems for 'extra_labels' and 'macros'.

This method of testing has its limitations though; in particular, it
can't test the hooks. I'm opened to ideas about how to test this better,
but I think that we need to remember that this commit might break some
targets and keep an eye out for "weird errors" in the future.
2016-05-17 21:42:55 +03:00
0xc0170 5681da0845 Target - backward compatibility KSDK 1.0 labels
The extra_labels should not be removed, as it could break old sources or
mbed-lib or applications.
2016-05-09 13:44:37 -05:00
Mahadevan Mahesh da0924f95c Networking update for FRDM K64 platform
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:54:01 -05:00
Mahadevan Mahesh fffadba309 Moved SDK 2.0 platforms back to TARGET_Freescale from TARGET_NXP.
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:53:53 -05:00
Mahadevan Mahesh f512738f91 Add support for KL27Z FRDM board
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:45:05 -05:00
Mahadevan Mahesh 06698f4ffa Add support for the K64F Hexiwear board
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:45:02 -05:00
Mahadevan Mahesh-R9AADQ 6ff2badf1f Added support for Kinetis K22
Use Kinetis SDK 2.0
Moved to TARGET_NXP

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:44:58 -05:00
Mahadevan Mahesh-R9AADQ 2c9c632aad Added Kinetis K64 support
Use Kinetis SDK 2.0. Moved this to TARGET_NXP

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:44:54 -05:00
Mahadevan Mahesh-R9AADQ acb896b3cb Removed Freescale Kinetis SDK 1.0 based implementations
This will be replaced by Kinetis SDK 2.0 based implemenation under the TARGET_NXP folder

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-04-29 15:27:42 -05:00
Martin Kojtal 670e7bcb47 Merge pull request #1639 from mbedNoobNinja/master
New mbed platform VK_RZ_A1H
2016-04-28 19:07:17 -05:00
mbedNoobNinja fa0bf58e3c New mbed platform VK_RZ_A1H 2016-04-26 17:27:39 +03:00
svastm 42a1d862e2 [NUCLEO_L031K6] Add to build and export scripts 2016-04-21 16:25:58 +02:00
bcostm b2412af383 [DISCO_F429ZI] Add target name for progen 2016-04-20 11:50:51 +02:00
Parthasarathy dd3c5f7fa8 Added support for SAMG55
* * Base Commit for SAMG55J19. No errors and no implementations.

* * Added gpio files.

* * Added pinmap files.

* * Base commit for usticker implementation.

* * Added gcc_arm export functionality

* * added files for usticker.
* added template file for samd55j19

* * GPIO IRQ base commit.

* * updated with changes in gpio irq driver.

* * Reverted back unexpected commit in SAM0 gpio driver.

* * updated gpio_irq driver.

* * correction in gpio and gpio_irq drivers.
* added support for some test for gpio.

* * base commit for peripheralpins for usart.
* update in serial apis.

* * updated serial apis.

* * updated serial apis and test.

* * update serial apis for asynch apis.

* * updated peripheral pins for i2c and spi.
* added test support for serial flow control

* * Base commit for low power ticker implementation.

* * base commit for port apis.
* update in lp ticker apis.

* * Added test support for port.

* * base commit for sleep apis.

* * Base commit for spi.

* * updated with corrections in gpio irq.
* usticker file updated with latest source.

* * updated with corrections for unexpected board reset.
* updated gpio irq apis and added test for the same.

* * updated sleep api for deepsleep.

* * updated serial apis.

* Added uc_ticker and SPI api implementations

* Removed unused SPI pin map

* Updated review feedback

* * implemented lpticker with TC module.
* updated files for KnR Coding Statndard.
* updated serial and usticker apis.

* * Base commit for AnalogueIn apis.

* * RTC apis base commit without implementation.

* * Updated with corrections in lpticker implementations.

* * Added implementation for rtc apis.

* * updated with implementations for pwm.
* changed usticker from TC0 to TC1.

* Added I2C support

* * removed setvector usage from usticker and lpticker implementations
* added tests for SAMG55J19

* * Removed unwanted .o and .d files.
* Updated I2C files for KnR Coding Standards.
* Update for reducing compiler warnings in peripheralpins,c
* Updated with PWM free implementation.

* * Removed unwanted headers file inclusion.
* Compiler warning corrections in serial_api.c

* * Updated ADC with 16 bit mode initialization and code refinements.
* Updated PWM with code refinements.

* Updated I2C review feedback and fixed style

* Updated target name for SAMG55

* * Added Test Support for I2C with AT30TSE75X and Added Support for SAMG55J19 in atmelstudio project exporter

* * Added Test Support for I2C with AT30TSE75X and Added Support for SAMG55J19 in atmelstudio project exporter

* Used NVIC_SetVector for interrupt callback

* Removed Target macro define in test

* Updated test cases to have SAMG55 support

* * Updated with corrections in Serial and SPI asynchronous implementations.
* Updated deepsleep api implementation
* Merged LP_Ticker with latest code from mbed 3.0 repository.

* * updated with corrections in I2C Asynch implementation.
2016-04-05 18:05:59 +01:00
Martin Kojtal 6bd3caa968 Merge pull request #1607 from 0xc0170/dev_uvision_progen
uvision progen
2016-03-15 17:25:11 +00:00
Martin Kojtal aa0e8a5b4f Targets - remove uvision default template 2016-03-10 20:26:23 +01:00
Martin Kojtal ccdf5b25ed Exporters uvision - add default mbed templates 2016-03-10 19:52:25 +01:00
adustm 52c70867e6 [STM32F7] fix typo in targets.py + remove tabs in iar.py 2016-03-10 18:24:10 +01:00
adustm 1e1ed26327 [STM32F7] Allow IAR compilation
targets.py : add IAR for NUCLEO_F746ZG and DISCO_F746NG

iar.py: in case of Cortex-M7F, change it into Cortex-M7 and add --fpu
VFPv5_sp
I have been confirmed that for Cortex-M4F we don't need to add the --fpu
VFPv4_sp
2016-03-10 17:07:16 +01:00
Martin Kojtal 906961d781 Targets - add progen uvision templates 2016-03-10 15:50:20 +00:00
Martin Kojtal de3b14ec92 Merge pull request #1576 from PeterConheeney/master
latest changes to add arduino support, plus fixes for IOTSS BEID
2016-03-02 15:29:53 +01:00
0xc0170 6915f09663 Targets - fix nucleo f410rb 2016-03-02 11:01:24 +01:00
Peter Conheeney bec257786a commit of latest changes to arduino support, plus fixes for IOTSS BEID 2016-02-29 12:02:47 +00:00
Martin Kojtal 3209e1806f Merge pull request #1569 from bridadan/remove-iar-nrf51822
Remove IAR from all NRF51822-based targets
2016-02-28 17:48:16 +01:00
0xc0170 65355e2610 Target - remove cortex-m7 IAR support for 2 targets
They will be reenabled once we update IAR version for the release/test
2016-02-26 13:00:49 +00:00
0xc0170 121804a99d Target - nucleo f746 - progen data aligned to master branch 2016-02-26 11:37:04 +00:00
adustm a7ed768eef [NUCLEO_F746ZG] new target 2016-02-26 11:36:40 +00:00
Brian Daniels bee5cad5ef Remove IAR from all NRF51822-based targets 2016-02-25 18:29:38 -06:00
0xc0170 5f2541c8aa Target + Exporters - progen data expansion by template for tools
Each target can specify own template. This is however not recommended for general use.
Each target should be supported by progendef, and well definied. However, as tools are
quickly changing, some targets add extra information which might not be supported, this
template expansion allows a target to temporary override default mbed tool template.

In this commit, we add RZ_A1H iar template. I experienced with never tools some breakage in
the templates, this might come handy, but repeat, please consider using the default template, and
contribute to progen or progendef which should contain fixes or support for newer targets/tools.
2016-02-25 14:02:08 +00:00
Martin Kojtal ba6ba1f687 Progen data refactor
The new format progen = dict() should allow to add more data used by progen.
The target can add tool flags to be overwritten by the default mbed template, or
even inject own template. This might be required for some targets. Therefore we
shall allow thiss.
2016-02-24 17:58:58 +00:00
modtronix-com b78542d10e Changed target name from NZ32SC151 to NZ32_SC151 2016-02-18 09:49:14 +00:00
Martin Kojtal b57f7d5684 Merge pull request #1545 from TomoYamanaka/master
Support of export function to the IAR.
2016-02-18 09:42:15 +00:00
Martin Kojtal 20948ad920 Merge pull request #1535 from sg-/remove-gcc-cw
Remove stale gcc tools
2016-02-15 08:54:17 +00:00
tomoyuki yamanaka 27caef30a4 Support of export function to the IAR.
We modified the following to support the export function to the IAR.
- In tools files, add RZ_A1H to the target of IAR.
- In tools files, add the tmpl files.
2016-02-15 14:49:31 +09:00
Martin Kojtal 05e8585f21 Merge pull request #1526 from sg-/mbedos-macros
Mbedos macros
2016-02-12 08:29:15 +01:00
sg- c7f84c86f7 Remove all references and use of code warrior GCC in docs, build and
exporters¦
2016-02-11 01:07:58 -06:00
sg- 018cdb928a Remove all references and use of code sourcery GCC in docs, build and export scripts 2016-02-10 23:27:33 -06:00
dinau 1b8f2c7c3f [DISCO-F407VG]:Changed: Default toolchain from uARM to ARM. 2016-02-11 13:59:26 +09:00
Sam Grove 715fca0178 add extra mbed identifier. correct duplicate target 2016-02-05 01:19:48 -06:00
Sam Grove 2ce7eab989 add mbed os defines to mbed targets 2016-02-05 00:59:00 -06:00
dinau 6e45dafa0e Add uVision4 exporters for DISCO-{F051R8, F100RB, F303VC, F407VG}
(1) Add above exporters.
(2) Modified only comments in "cmsis_nvic.h" files.
2016-01-31 19:34:42 +09:00
Martin Kojtal 45dbe35006 Merge pull request #1490 from ytsuboi/add-TY51822r3
[TY51822r3] add platform
2016-01-15 07:47:49 +00:00
Steven Cooreman b515defdd4 Forgot to update STK number in one place. 2016-01-13 09:17:54 +01:00
Steven Cooreman 764d54f2d5 Fix Pearl chip SKU and core ID in targets. 2016-01-12 17:25:52 +01:00
Mikko Polojarvi 6067de0428 SiLabs Pearl: Rename files and dirs to correct STK code
Pearl STK is offically known as SLSTK3401A, but we well go
with the same naming convention as with Happy so Pearl's
name in Mbed will be STK3401.

Renames all files and directories that previously had the
placeholder STKXXXX. Build, target and export scripts
modified accordingly.
2016-01-12 17:17:10 +01:00
jhokajar 87aee51f52 Silabs Pearl: Added a part number
Added a correct part number for Pearl Gecko Kit Board
2016-01-12 17:01:32 +01:00
Mikko Polojarvi e5e896b68d SiLabs Pearl: Initial commit
Leopard Gecko used as baseline.

TODO

 - Peripheral/GPIO pin mappings etc for Pearl are marked "Pearl ok",
   rest are wrong

 - Missing new (4.1.0+) emlib
2016-01-12 17:00:16 +01:00
Martin Kojtal 42ceddf229 Merge pull request #1467 from mbedmicro/fix_m7core
Fix m7core
2016-01-11 16:55:37 +00:00