From 2bd7b4dee1a3d649b5d86d491bb1d505a0bc2959 Mon Sep 17 00:00:00 2001 From: JojoS Date: Sat, 12 Aug 2017 11:00:18 +0200 Subject: [PATCH] added templates for LPC4088 and LPC11H37 target specific templates use a common template .cproject.tmpl and extend it by adding target information. This is necessary for the flash and debugging tools --- targets/targets.json | 2 +- tools/export/mcuxpresso/.cproject.tmpl | 71 +-------- .../mcuxpresso/LPC11U37H_401_cproject.tmpl | 46 ++++++ tools/export/mcuxpresso/__init__.py | 3 +- .../mcuxpresso/cproject_cm0_common.tmpl | 3 - .../mcuxpresso/cproject_cm3_common.tmpl | 3 - .../mcuxpresso/cproject_cm4_common.tmpl | 3 - tools/export/mcuxpresso/cproject_common.tmpl | 148 ------------------ tools/export/mcuxpresso/empty_cproject.tmpl | 3 + tools/export/mcuxpresso/lpc4088_cproject.tmpl | 2 +- tools/export/mcuxpresso/lpc4088_project.tmpl | 1 - tools/export/mcuxpresso/project_common.tmpl | 27 ---- 12 files changed, 54 insertions(+), 258 deletions(-) create mode 100644 tools/export/mcuxpresso/LPC11U37H_401_cproject.tmpl delete mode 100644 tools/export/mcuxpresso/cproject_cm0_common.tmpl delete mode 100644 tools/export/mcuxpresso/cproject_cm3_common.tmpl delete mode 100644 tools/export/mcuxpresso/cproject_cm4_common.tmpl delete mode 100644 tools/export/mcuxpresso/cproject_common.tmpl create mode 100644 tools/export/mcuxpresso/empty_cproject.tmpl delete mode 100644 tools/export/mcuxpresso/lpc4088_project.tmpl delete mode 100644 tools/export/mcuxpresso/project_common.tmpl diff --git a/targets/targets.json b/targets/targets.json index fd9550f01c..5240298691 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -400,7 +400,7 @@ "inherits": ["LPCTarget"], "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"], "default_lib": "small", - "release_versions": ["2"], + "release_versions": ["2", "5"], "device_name": "LPC11U37HFBD64/401" }, "ELEKTOR_COCORICO": { diff --git a/tools/export/mcuxpresso/.cproject.tmpl b/tools/export/mcuxpresso/.cproject.tmpl index f9a5a9c9a7..4676157d79 100644 --- a/tools/export/mcuxpresso/.cproject.tmpl +++ b/tools/export/mcuxpresso/.cproject.tmpl @@ -175,76 +175,7 @@ - <?xml version="1.0" encoding="UTF-8"?> -<TargetConfig> -<Properties property_2="LPC177x_8x_407x_8x_512.cfx" property_3="NXP" property_4="LPC4088" property_count="5" version="70200"/> -<infoList vendor="NXP"><info chip="LPC4088" flash_driver="LPC177x_8x_407x_8x_512.cfx" match_id="0x481D3F47" name="LPC4088" stub="crt_emu_cm3_nxp"><chip><name>LPC4088</name> -<family>LPC407x_8x</family> -<vendor>NXP (formerly Philips)</vendor> -<reset board="None" core="Real" sys="Real"/> -<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/> -<memory can_program="true" id="Flash" is_ro="true" type="Flash"/> -<memory id="RAM" type="RAM"/> -<memory id="Periph" is_volatile="true" type="Peripheral"/> -<memoryInstance derived_from="Flash" id="MFlash512" location="0x0" size="0x80000"/> -<memoryInstance derived_from="RAM" id="RamLoc64" location="0x10000000" size="0x10000"/> -<memoryInstance derived_from="RAM" id="RamPeriph32" location="0x20000000" size="0x8000"/> -<prog_flash blocksz="0x1000" location="0x0" maxprgbuff="0x1000" progwithcode="TRUE" size="0x10000"/> -<prog_flash blocksz="0x8000" location="0x10000" maxprgbuff="0x1000" progwithcode="TRUE" size="0x70000"/> -<peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/> -<peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/> -<peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/> -<peripheralInstance derived_from="V7M_ITM" id="ITM" location="0xe0000000"/> -<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x200000"/> -<peripheralInstance derived_from="GPDMA" id="GPDMA" location="0x20080000"/> -<peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x20084000"/> -<peripheralInstance derived_from="LCD" id="LCD" location="0x20088000"/> -<peripheralInstance derived_from="USB" id="USB" location="0x2008c000"/> -<peripheralInstance derived_from="CRC" id="CRC" location="0x20090000"/> -<peripheralInstance derived_from="GPIO" id="GPIO" location="0x20098000"/> -<peripheralInstance derived_from="EMC" id="EMC" location="0x2009c000"/> -<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40000000"/> -<peripheralInstance derived_from="TIMER0" id="TIMER0" location="0x40004000"/> -<peripheralInstance derived_from="TIMER1" id="TIMER1" location="0x40008000"/> -<peripheralInstance derived_from="UART0" id="UART0" location="0x4000c000"/> -<peripheralInstance derived_from="UART1" id="UART1" location="0x40010000"/> -<peripheralInstance derived_from="PWM0" id="PWM0" location="0x40014000"/> -<peripheralInstance derived_from="PWM1" id="PWM1" location="0x40018000"/> -<peripheralInstance derived_from="I2C0" id="I2C0" location="0x4001c000"/> -<peripheralInstance derived_from="COMPARATOR" id="COMPARATOR" location="0x40020000"/> -<peripheralInstance derived_from="RTC" id="RTC" location="0x40024000"/> -<peripheralInstance derived_from="GPIOINT" id="GPIOINT" location="0x40028080"/> -<peripheralInstance derived_from="IOCON" id="IOCON" location="0x4002c000"/> -<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40030000"/> -<peripheralInstance derived_from="ADC" id="ADC" location="0x40034000"/> -<peripheralInstance derived_from="CANAFRAM" id="CANAFRAM" location="0x40038000"/> -<peripheralInstance derived_from="CANAF" id="CANAF" location="0x4003c000"/> -<peripheralInstance derived_from="CCAN" id="CCAN" location="0x40040000"/> -<peripheralInstance derived_from="CAN1" id="CAN1" location="0x40044000"/> -<peripheralInstance derived_from="CAN2" id="CAN2" location="0x40048000"/> -<peripheralInstance derived_from="I2C1" id="I2C1" location="0x4005c000"/> -<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40088000"/> -<peripheralInstance derived_from="DAC" id="DAC" location="0x4008c000"/> -<peripheralInstance derived_from="TIMER2" id="TIMER2" location="0x40090000"/> -<peripheralInstance derived_from="TIMER3" id="TIMER3" location="0x40094000"/> -<peripheralInstance derived_from="UART2" id="UART2" location="0x40098000"/> -<peripheralInstance derived_from="UART3" id="UART3" location="0x4009c000"/> -<peripheralInstance derived_from="I2C2" id="I2C2" location="0x400a0000"/> -<peripheralInstance derived_from="UART4" id="UART4" location="0x400a4000"/> -<peripheralInstance derived_from="I2S" id="I2S" location="0x400a8000"/> -<peripheralInstance derived_from="SSP2" id="SSP2" location="0x400ac000"/> -<peripheralInstance derived_from="MCPWM" id="MCPWM" location="0x400b8000"/> -<peripheralInstance derived_from="QEI" id="QEI" location="0x400bc000"/> -<peripheralInstance derived_from="SDMMC" id="SDMMC" location="0x400c0000"/> -<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x400fc000"/> -</chip> -<processor><name gcc_name="cortex-m4">Cortex-M4</name> -<family>Cortex-M</family> -</processor> -<link href="nxp_lpc407x_8x_peripheral.xme" show="embed" type="simple"/> -</info> -</infoList> -</TargetConfig> + {% block cpu_config %}{% endblock %} diff --git a/tools/export/mcuxpresso/LPC11U37H_401_cproject.tmpl b/tools/export/mcuxpresso/LPC11U37H_401_cproject.tmpl new file mode 100644 index 0000000000..8de33274ed --- /dev/null +++ b/tools/export/mcuxpresso/LPC11U37H_401_cproject.tmpl @@ -0,0 +1,46 @@ +{% extends "mcuxpresso/.cproject.tmpl" %} + +{% block cpu_config %}<?xml version="1.0" encoding="UTF-8"?> +<TargetConfig> +<Properties property_2="LPC11_12_13_128K_8K.cfx" property_3="NXP" property_4="LPC11U37H/401" property_count="5" version="70200"/> +<infoList vendor="NXP"><info chip="LPC11U37H/401" flash_driver="LPC11_12_13_128K_8K.cfx" match_id="0x0" name="LPC11U37H/401" stub="crt_emu_lpc11_13_nxp"><chip><name>LPC11U37H/401</name> +<family>LPC11Uxx</family> +<vendor>NXP (formerly Philips)</vendor> +<reset board="None" core="Real" sys="Real"/> +<clock changeable="TRUE" freq="12MHz" is_accurate="TRUE"/> +<memory can_program="true" id="Flash" is_ro="true" type="Flash"/> +<memory id="RAM" type="RAM"/> +<memory id="Periph" is_volatile="true" type="Peripheral"/> +<memoryInstance derived_from="Flash" id="MFlash128" location="0x0" size="0x20000"/> +<memoryInstance derived_from="RAM" id="RamLoc8" location="0x10000000" size="0x2000"/> +<memoryInstance derived_from="RAM" id="RamUsb2" location="0x20004000" size="0x800"/> +<memoryInstance derived_from="RAM" id="RamIoh2" location="0x20000000" size="0x800"/> +<peripheralInstance derived_from="V6M_NVIC" id="NVIC" location="0xe000e000"/> +<peripheralInstance derived_from="V6M_DCR" id="DCR" location="0xe000edf0"/> +<peripheralInstance derived_from="I2C" id="I2C" location="0x40000000"/> +<peripheralInstance derived_from="WWDT" id="WWDT" location="0x40004000"/> +<peripheralInstance derived_from="USART" id="USART" location="0x40008000"/> +<peripheralInstance derived_from="CT16B0" id="CT16B0" location="0x4000c000"/> +<peripheralInstance derived_from="CT16B1" id="CT16B1" location="0x40010000"/> +<peripheralInstance derived_from="CT32B0" id="CT32B0" location="0x40014000"/> +<peripheralInstance derived_from="CT32B1" id="CT32B1" location="0x40018000"/> +<peripheralInstance derived_from="ADC" id="ADC" location="0x4001c000"/> +<peripheralInstance derived_from="PMU" id="PMU" location="0x40038000"/> +<peripheralInstance derived_from="FLASHCTRL" id="FLASHCTRL" location="0x4003c000"/> +<peripheralInstance derived_from="SSP0" id="SSP0" location="0x40040000"/> +<peripheralInstance derived_from="IOCON" id="IOCON" location="0x40044000"/> +<peripheralInstance derived_from="SYSCON" id="SYSCON" location="0x40048000"/> +<peripheralInstance derived_from="GPIO-PIN-INT" id="GPIO-PIN-INT" location="0x4004c000"/> +<peripheralInstance derived_from="SSP1" id="SSP1" location="0x40058000"/> +<peripheralInstance derived_from="GPIO-GROUP-INT0" id="GPIO-GROUP-INT0" location="0x4005c000"/> +<peripheralInstance derived_from="GPIO-GROUP-INT1" id="GPIO-GROUP-INT1" location="0x40060000"/> +<peripheralInstance derived_from="USB" id="USB" location="0x40080000"/> +<peripheralInstance derived_from="GPIO-PORT" id="GPIO-PORT" location="0x50000000"/> +</chip> +<processor><name gcc_name="cortex-m0">Cortex-M0</name> +<family>Cortex-M</family> +</processor> +<link href="LPC11Uxx_peripheral.xme" show="embed" type="simple"/> +</info> +</infoList> +</TargetConfig>{% endblock %} diff --git a/tools/export/mcuxpresso/__init__.py b/tools/export/mcuxpresso/__init__.py index 408f5db0ae..c532b12f85 100644 --- a/tools/export/mcuxpresso/__init__.py +++ b/tools/export/mcuxpresso/__init__.py @@ -282,7 +282,7 @@ class MCUXpresso(Exporter): self.gen_file('mcuxpresso/.project.tmpl', jinja_ctx, '.project', trim_blocks=True, lstrip_blocks=True) - self.gen_file('mcuxpresso/.cproject.tmpl', jinja_ctx, + self.gen_file('mcuxpresso/{0}_cproject.tmpl'.format(target_name), jinja_ctx, '.cproject', trim_blocks=True, lstrip_blocks=True) # self.gen_file('mcuxpresso/makefile.targets.tmpl', jinja_ctx, # 'makefile.targets', trim_blocks=True, lstrip_blocks=True) @@ -587,6 +587,7 @@ class MCUXpresso(Exporter): self.remove_option(flags['common_flags'], '-mbig-endian') opts['common']['arm.target.fpu.unit'] = None + opts['common']['arm.target.fpu.unit_nxp'] = None # default, fpv4spd16, fpv5d16, fpv5spd16 str = self.find_options(flags['common_flags'], '-mfpu=') if str != None: diff --git a/tools/export/mcuxpresso/cproject_cm0_common.tmpl b/tools/export/mcuxpresso/cproject_cm0_common.tmpl deleted file mode 100644 index 53e00e1beb..0000000000 --- a/tools/export/mcuxpresso/cproject_cm0_common.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "mcuxpresso/cproject_common.tmpl" %} - -{% block core %}cm0{% endblock %} diff --git a/tools/export/mcuxpresso/cproject_cm3_common.tmpl b/tools/export/mcuxpresso/cproject_cm3_common.tmpl deleted file mode 100644 index 02ff03c700..0000000000 --- a/tools/export/mcuxpresso/cproject_cm3_common.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "mcuxpresso/cproject_common.tmpl" %} - -{% block core %}cm3{% endblock %} diff --git a/tools/export/mcuxpresso/cproject_cm4_common.tmpl b/tools/export/mcuxpresso/cproject_cm4_common.tmpl deleted file mode 100644 index 90b0d229bc..0000000000 --- a/tools/export/mcuxpresso/cproject_cm4_common.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "mcuxpresso/cproject_common.tmpl" %} - -{% block core %}cm4{% endblock %} diff --git a/tools/export/mcuxpresso/cproject_common.tmpl b/tools/export/mcuxpresso/cproject_common.tmpl deleted file mode 100644 index f6c557bca6..0000000000 --- a/tools/export/mcuxpresso/cproject_common.tmpl +++ /dev/null @@ -1,148 +0,0 @@ - - - - {% for cfg_key in options %} - {% set opts = options[cfg_key] %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% endfor %} - - - - - - - - - - - {% block cpu_config %}{% endblock %} - - diff --git a/tools/export/mcuxpresso/empty_cproject.tmpl b/tools/export/mcuxpresso/empty_cproject.tmpl new file mode 100644 index 0000000000..19889a0a74 --- /dev/null +++ b/tools/export/mcuxpresso/empty_cproject.tmpl @@ -0,0 +1,3 @@ +{% extends "mcuxpresso/.cproject.tmpl" %} + +{% block cpu_config %}{% endblock %} diff --git a/tools/export/mcuxpresso/lpc4088_cproject.tmpl b/tools/export/mcuxpresso/lpc4088_cproject.tmpl index 481df2bbd6..13c6366913 100644 --- a/tools/export/mcuxpresso/lpc4088_cproject.tmpl +++ b/tools/export/mcuxpresso/lpc4088_cproject.tmpl @@ -1,4 +1,4 @@ -{% extends "mcuxpresso/cproject_cm4_common.tmpl" %} +{% extends "mcuxpresso/.cproject.tmpl" %} {% block cpu_config %}<?xml version="1.0" encoding="UTF-8"?> <TargetConfig> diff --git a/tools/export/mcuxpresso/lpc4088_project.tmpl b/tools/export/mcuxpresso/lpc4088_project.tmpl deleted file mode 100644 index 09a2c3887e..0000000000 --- a/tools/export/mcuxpresso/lpc4088_project.tmpl +++ /dev/null @@ -1 +0,0 @@ -{% extends "mcuxpresso/project_common.tmpl" %} diff --git a/tools/export/mcuxpresso/project_common.tmpl b/tools/export/mcuxpresso/project_common.tmpl deleted file mode 100644 index ce4e268083..0000000000 --- a/tools/export/mcuxpresso/project_common.tmpl +++ /dev/null @@ -1,27 +0,0 @@ - - - {{name}} - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - -