{# device_type: mimxrt1050_evk #}
{% extends 'base.jinja2' %}
{% set usb_vendor_id = '1366' %}
{% set usb_product_id = '0105' %}
{% block body %}
board_id: '{{ board_id|default('0000000000') }}'
usb_vendor_id: '{{ usb_vendor_id }}'
usb_product_id: '{{ usb_product_id }}'
usb_sleep: {{ usb_sleep|default(0) }}

actions:
  deploy:
    connections:
      lxc:
    methods:
      lxc:
      image:
        parameters:

  boot:
    connections:
      serial:
      lxc:
      ssh:
    methods:
      lxc:
      pyocd:
        parameters:
          command:
            {{ pyocd_command|default("pyocd-flashtool") }}
          options:
          - -d {{ debug|default('debug') }}
          - -t mimxrt1050_hyperflash
          - -f 3000000
      cmsis-dap:
        parameters:
          usb_mass_device: '{{ usb_mass_device|default('/notset') }}'
          resets_after_flash: {{ resets_after_flash|default(True) }}
          {# Allow to set any cmsis-dap parameters in a device dict. #}
          {% filter indent(width=10) -%}
          {% block cmsis_dap_params %}{% endblock cmsis_dap_params %}
          {% endfilter %}
          {# Next empty line is mandatory (jinja matters). #}

      jlink:
        parameters:
          command:
            JLinkExe
          address:
            0x00000000
          command: JLinkExe 
          address: {{ load_address|default("0x00000000") }}
          processor: {{ processor|default("MCIMXRT1052") }}
          supported_core_types: {{ supported_core_types }}
          erase_command: {{ erase_command|default(["erase"]) }}
          reset_command: {{ reset_command|default(["r"]) }}
          options:
          - '-if SWD'
          - '-speed 4000'
{% endblock body -%}

{% set device_info = device_info|default([{'board_id': board_id, 'usb_vendor_id': usb_vendor_id, 'usb_product_id': usb_product_id}]) %}
