Skip to content

Adding ProGen as default exporter for uvision4 and IAR #1484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Dec 29, 2015

Replace all iar/uvision4 templates by the project generator (https://github.com/project-generator/project_generator). This should fix #1464 - tracking issue for this feature.

I'll update progen version we depend on soon, as I release new version (need to add stlink support there for instance). For anyone testing, please use latest master for progen + progen definitions. Once I get the versions out, I'll update this PR.

I wrote a test script (warning - dirty, to quickly test if all targets are in progen definitions) to test if all our current uvision4 and IAR targets exports:

import logging

from project_generator.project import Project
from project_generator.settings import ProjectSettings

PROGEN_TARGETS = {
    'LPC1768': 'mbed-lpc1768',
    'LPC11U24': 'lpc11u24_201',
    'LPC1347':'lpc1347',
    'LPC1114':'lpc1114_102',
    'LPC11C24':'lpc11c24_301',
    'LPC4088':'lpc4088',
    'LPC4088_DM':'lpc4088',
    'LPC4330_M4':'lpc4330',
    'LPC4337':'lpc4337',
    'LPC812':'lpc812m101',
    'LPC824': 'lpc824m201',
    'LPC1549':'lpc1549',
    'LPC11U68':'lpc11u68',
    'LPC11U35_501':'lpc11u35_501',
    'LPC11U35_401': 'lpc11u35_401',
    'LPC11U37H_401':'lpc11u37_401',

    'KL05Z':'frdm-kl05z',
    'KL25Z':'frdm-kl25z',
    'KL43Z':'frdm-kl43z',
    'KL46Z':'frdm-kl46z',
    'K64F': 'frdm-k64f',
    'K22F': 'frdm-k22f',
    'K20D50M': 'frdm-k20d50m',
    'TEENSY3_1':'teensy-31',

    'NUCLEO_F030R8':'nucleo-f030r8',
    'NUCLEO_F031K6':'nucleo-f031k6',
    'NUCLEO_F042K6':'nucleo-f042k6',
    'NUCLEO_F070RB':'nucleo-f070rb',
    'NUCLEO_F072RB':'nucleo-f072rb',
    'NUCLEO_F091RC':'nucleo-f091rc',
    'NUCLEO_F103RB':'nucleo-f103rb',
    'NUCLEO_F302R8':'nucleo-f302r8',
    'NUCLEO_F303K8':'nucleo-f303k8',
    'NUCLEO_F303RE':'nucleo-f303re',
    'NUCLEO_F334R8':'nucleo-f334r8',
    'NUCLEO_F401RE':'nucleo-f401re',
    'NUCLEO_F410RB':'nucleo-f410rb',
    'NUCLEO_F411RE':'nucleo-f411re',
    'NUCLEO_F446RE':'nucleo-f446re',
    'NUCLEO_L053R8':'nucleo-l053r8',
    'NUCLEO_L073RZ':'nucleo-l073rz',
    'NUCLEO_L152RE':'nucleo-l152re',
    'NUCLEO_L476RG':'nucleo-l476rg',

    'DISCO_F407VG':'disco-f407vg',
    'DISCO_F429ZI':'disco-f429zi',
    'DISCO_L053C8':'disco-l053c8',
    'DISCO_F334C8':'disco-f334c8',
    'DISCO_F469NI':'disco-f469ni',
    'DISCO_F746NG':'disco-f746ng',
    'DISCO_L476VG':'disco-l476vg',

    'UBLOX_C027':'ublox-c027',
    'NRF51822':'mkit',
    'HRM1017':'hrm1017',
    'RBLAB_NRF51822':'rblab-nrf51822',
    'ARCH_PRO':'arch-pro',
    'ARCH_BLE':'arch-ble',
    'MTS_GAMBIT':'mts-gambit',
    'ARCH_MAX':'lpc1768',
    'MTS_MDOT_F405RG':'mts-mdot-f405rg',
    'MTS_MDOT_F411RE': 'mts-mdot-f411re',
    'MTS_DRAGONFLY_F411RE': 'mts-dragonfly-f411re',
    'NRF51_DK':'nrf51-dk',
    'NRF51_DONGLE':'nrf51-dongle',
    'SEEED_TINY_BLE':'seed-tinyble',

    'DELTA_DFCM_NNN40':'dfcm-nnn40',
    'MAXWSNENV':'maxwsnenv',
    'MAX32600MBED':'max32600mbed',
    'MOTE_L152RC':'stm32l151rc',
    'NZ32SC151':'stm32l151rc',

    'SAMR21G18A':'samr21g18a',
    'SAMD21J18A':'samd21j18a',
    'SAMD21G18A':'samd21g18a',
    'SAML21J18A':'samr21j18a',
}

IAR_TARGETS = [
    'LPC1768',
    'LPC1347',
    'LPC11U24',
    'LPC11U35_401',
    'LPC11U35_501',
    #Removed LPCCAPPUCCINO linker file and startup file missing
    #'LPCCAPPUCCINO',
    'LPC1114',
    'LPC1549',
    'LPC812',
    'LPC4088',
    'LPC4088_DM',
    'LPC824',
    'UBLOX_C027',
    'ARCH_PRO',
    'K20D50M',
    'KL05Z',
    'KL25Z',
    'KL46Z',
    'K22F',
    'K64F',
    'NUCLEO_F030R8',
    'NUCLEO_F031K6',
    'NUCLEO_F042K6',
    'NUCLEO_F070RB',
    'NUCLEO_F072RB',
    'NUCLEO_F091RC',
    'NUCLEO_F103RB',
    'NUCLEO_F302R8',
    'NUCLEO_F303K8',
    'NUCLEO_F303RE',
    'NUCLEO_F334R8',
    'NUCLEO_F401RE',
    'NUCLEO_F410RB',
    'NUCLEO_F411RE',
    'NUCLEO_F446RE',
    'NUCLEO_L053R8',
    'NUCLEO_L073RZ',
    'NUCLEO_L152RE',
    'NUCLEO_L476RG',
    'DISCO_F429ZI',
    'DISCO_L053C8',
    'DISCO_F334C8',
    'DISCO_F469NI',
    'DISCO_F746NG',
    'DISCO_L476VG',
    #'STM32F407', Fails to build same for GCC
    'MAXWSNENV',
    'MAX32600MBED',
    'MTS_MDOT_F405RG',
    'MTS_MDOT_F411RE',
    'MTS_DRAGONFLY_F411RE',
    'NRF51822',
    'NRF51_DK',
    'NRF51_DONGLE',
    'DELTA_DFCM_NNN40',
    'SEEED_TINY_BLE',
    'HRM1017',
    'ARCH_BLE',
    'MOTE_L152RC',
]


UVISION_TARGETS = [
    'LPC1768',
    'LPC11U24',
    'KL05Z',
    'KL25Z',
    'KL43Z',
    'KL46Z',
    'K64F',
    'K22F',
    'K20D50M',
    'TEENSY3_1',
    'LPC1347',
    'LPC1114',
    'LPC11C24',
    'LPC4088',
    'LPC4088_DM',
    'LPC4330_M4',
    'LPC4337',
    'LPC812',
    'NUCLEO_F030R8',
    'NUCLEO_F070RB',
    'NUCLEO_F072RB',
    'NUCLEO_F091RC',
    'NUCLEO_F103RB',
    'NUCLEO_F302R8',
    'NUCLEO_F303RE',
    'NUCLEO_F334R8',
    'NUCLEO_F401RE',
    'NUCLEO_F411RE',
    'NUCLEO_L053R8',
    'NUCLEO_L073RZ',
    'NUCLEO_L152RE',
    'UBLOX_C027',
    'LPC1549',
    'LPC11U68',
    # Removed as uvision4_lpc11u35_501.uvproj.tmpl is missing.
    #'LPC11U35_501',
    'NRF51822',
    'HRM1017',
    'RBLAB_NRF51822',
    'ARCH_PRO',
    'ARCH_BLE',
    'DISCO_F407VG',
    'DISCO_L053C8',
    'DISCO_F334C8',
    'DISCO_F746NG',
    'MTS_GAMBIT',
    'ARCH_MAX',
    'MTS_MDOT_F405RG',
    'NRF51_DK',
    'NRF51_DONGLE',
    'SEEED_TINY_BLE',
    'LPC11U37H_401',
    'DELTA_DFCM_NNN40',
    'MAXWSNENV',
    'MAX32600MBED',
    'MOTE_L152RC',
    'NZ32SC151',
]

proj_dict = {
    'common': {
    'sources': [''],
        'includes': [''],
        'target': [''],
        'tools_supported': ['iar_arm', 'uvision'],
        'output_type': ['exe'],
        'export_dir': 'generated_projects/{target}_{tool}'
    }
}

def main():
    logging.basicConfig(level=logging.INFO)
    settings = ProjectSettings()
    for uvision_target in UVISION_TARGETS:
        proj_dict['common']['target'] = PROGEN_TARGETS[uvision_target]
        project = Project('project_1', [proj_dict], settings)
        if project.generate('uvision') != 0:
            loggin.error("Error exporting for uvision")
            return -1

    for iar_target in IAR_TARGETS:
        proj_dict['common']['target'] = PROGEN_TARGETS[iar_target]
        project = Project('project_1', [proj_dict], settings)
        if project.generate('iar_arm') != 0:
            loggin.error("Error exporting for iar")
            return -1

    logging.info("Exporting without error.")
    return 0

if __name__ == '__main__':
    main()

Please test anyone who is using uvision4 or IAR. Thanks!

@0xc0170
Copy link
Contributor Author

0xc0170 commented Dec 29, 2015

progen v0.8.4 and progen definitions v0.2.4 are out, should support all required features for this PR

@0xc0170
Copy link
Contributor Author

0xc0170 commented Jan 4, 2016

I might just split this PR to 2 parts. The first part would be to add progen to mbed exporters (not active, just important pieces to the exporters generic layer). This will be easier to integrate, and might help others who are considering progen for their tools. The next step will be to replace each tool we have by progen (starting iar, uvision, .... ).

Closing, will open a new one

@0xc0170 0xc0170 closed this Jan 4, 2016
@0xc0170 0xc0170 deleted the dev_progen branch July 8, 2016 10:36
artokin pushed a commit to artokin/mbed-os that referenced this pull request Nov 22, 2017
…changes from 8f75e39..0a5ef1c

0a5ef1c Merge branch 'release_internal' into release_external
75a669a Merge remote-tracking branch 'origin/add_spdx_identifier_to_license' into release_internal
d643ab3 Merge branch 'release_internal' into release_external
0c7b56c Add SPDX identifiers to license files (ARMmbed#1484)
dfe1010 Add SPDX identifiers to license files
9142283 Merge pull request ARMmbed#1473 from ARMmbed/public_release_candidate

git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack
git-subtree-split: 0a5ef1c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exporters - use progen to generate projects
1 participant