To be honest, it's quite cumbersome to write manuals, tutorials, articles, etc., especially when they involve describing how to use a graphical interface because there's a lot of work involved in capturing and editing images. For that and other reasons, I love the command line. However, this time we have no choice but to use a GUI since that's how AUTOSAR configuration tools are designed. First of all, I'll show you with an example how complicated it would be to copy and paste images.

Lets use the Template project as a reference. besides configuring other basic modules, we set a pin as an output in the Port. In the image, we have the PortPin options, and we also marked those that we had to change. But wait a moment, I haven't included the images corresponding to the previous container specifying the number of PortPins, the Port group they belong to, or the names being given to them, which would require adding at least three more images! Plus, the image with the configuration options of the Port driver. #$@#$!%!

I refuse to do such a thing. Instead, we will use a notation called YAML to represent the containers. Remember that configuration options in AUTOSAR are grouped into containers. Let's take the General configuration of the Port driver as an example. Here we can see the following containers: PortConfigset, NotUsedPortPin ( which is within the former ), and PortGeneral. In addition, each of the tabs is other containers that may or may not have sub-containers.

Its representation in YAML notation will be written as follows, considering the following options:

  • Options with a customizable name are denoted with a "string" (for example, PortConfigSet or NotusedPortPin).
  • Multiple options are represented by constants like GPIO or PORT_PIN_IN or some numerical value.
  • Checkboxes are represented as boolean values, with true indicating when they are active.
Port:
  General:
    Post Build Variant Used: false
    Config Variant: VariantPostBuild
    PortConfigset: "PortConfigSet"
      NotUsedPortPin: "NotusedPortPin"
        PortPin Mode: GPIO
        PortPin Direction: PORT_PIN_IN
        PortPin Level Value: PORT_PIN_LEVEL_LOW
        PortPin DSE: Low_Drive_Strength
        PortPin PE: PulDisable
        PortPin PS: PullDown
    PortGeneral: "PortGeneral"
      Port Development Error Detect: false
      Port SetPinDirection Api: false
      Port SetPinMode Api: false
      Port SetPinMode Does Not Touch GPIO Levels: false
      Port Reset Pin Mode API: false
      Port Multicore Support: false
      PORT CI IP Port Development Error Detect: false
      Port Set2PinsDirection Api: false
      Port VersionInfo Api: false
      Port Set As Unused Pin API: false
      Enable Port User Mode Support: false

Let's return to the configuration of our PortPin, assuming it's not configured in the template. So, using YAML, we'll write the required configuration. BUT!!! We're not going to write all the options of the driver, we'll only consider those that we modify, and for the ones that we don't, we'll either write '...' or nothing at all.

Port:
  Post Build Variant Used: false
  Config Variant: VariantPostBuild
  PortContainer: "PortContainer_0"    # declaramos un solo Port con nombre PortContainer_0
    General:
      PortNumberOfPortPins: 1
    PortPin: "PortPin_0"              # configuramos un solo Pin y lo llamamos PortPin_0
      PortPin Pcr: 96
      PortPin Direction: PORT_PIN_OUT
      ... 

In the previous example, only port 96 (D0) is being configured as an output, leaving the remaining options with their default values. There are also no modifications made to the PortConfigset and PortGeneral containers. Finally, here's the configuration of the Dio Driver for the pin that we inverted in the template. Please review these options and identify them in Tresos.

Dio:
  General:
    Config Variant: VariantPreCompile
    DioGeneral:
      Dio Flip Channel Api: true    # enable the fucntion Flip channel
      ...
  DioPort: "DioPort_0"              # set pin on port 3 (PORTD)
    General: 3
    DioChannel: "DioChannel_0"      # set pin 16 a given a name of DioChannel_0
      General:
        Dio Channel Id: 0
    ...

Now, you know, instead of finding a lot images in our different examples we decided to write all the configuration in YAML format, you only need to to follow and then apply the different option in Tresos