When I use the Dio module in MBDT, the Dio module can normally read the Channel and Port when I use the project of EB tresos template.
Then, I added two ports and dios to the project in the EB tresos template, at which point the Dio module could not read the Channel and Port. And report an error: Error evaluating 'MaskParameterCallback' callback of s32k3_dio block (mask) 'untitled/Dio'. Callback string is 'import mbd_s32k3.*; import mbd_s32k3.common.*; '
Please, how can I resolve this issue? Is there anything I need to pay attention to that I haven't set up correctly?
Solved! Go to Solution.
Hi, @azure,
Thank you for your interest into Model-Based Design Toolbox for S32K3.
First of all, I would recommend you to install the latest version of toolbox (MBDT for S32K3 Toolbox version 1.5.0) to benefit from the latest features and thus ensure that you have everything set correctly.
Regarding the problem you are facing, it is worth mentioning that the setting of new pins is done both in the Port component and in the Dio component, as follows:
1. Port tab: it deals with the lower-level hardware configuration of the microcontroller's pins. Here, you set up the pins at a more fundamental level, specifying how the pin will behave electrically and functionally.
The MSCR (Multiplexed Signal Configuration Register) can be set. This register is used to configure the pin multiplexing option, which determine the function of the pin (e.g. GPIO, UART, SPI, etc.) It also sets other parameters such as pull-up/pull-down resistors, drive strength, and input filtering.
The Direction defines whether the pin will be an input or an output. For example, setting the direction to output if you are driving an LED, or to input if you are reading a button state.
The Mode setting allows you to specify the mode in which the pin will operate. This involves selecting the function or role of the pin among various options provided by the microcontroller.
2. Dio tab: it is specific to the Digital Input/Output module of the microcontroller and deals with higher-level software abstraction of the pins configured as general-purpose I/O, helping to control and monitor the digital state of the pins.
Based on the pin port ID, a DioChannel is created. In this tab, you associate a logical DIO channel with the physical pin that was configured in the Port tab. This involves setting up the channel number and ensuring the software can refer to this pin by its channel identifier.
Note that the name given in the Dio tab will be shown in the block's dropdown menu.
Let us know if you manage to set it up or if you have other problems.
Best regards,
Dragos
Hi, @azure,
Thank you for your interest into Model-Based Design Toolbox for S32K3.
First of all, I would recommend you to install the latest version of toolbox (MBDT for S32K3 Toolbox version 1.5.0) to benefit from the latest features and thus ensure that you have everything set correctly.
Regarding the problem you are facing, it is worth mentioning that the setting of new pins is done both in the Port component and in the Dio component, as follows:
1. Port tab: it deals with the lower-level hardware configuration of the microcontroller's pins. Here, you set up the pins at a more fundamental level, specifying how the pin will behave electrically and functionally.
The MSCR (Multiplexed Signal Configuration Register) can be set. This register is used to configure the pin multiplexing option, which determine the function of the pin (e.g. GPIO, UART, SPI, etc.) It also sets other parameters such as pull-up/pull-down resistors, drive strength, and input filtering.
The Direction defines whether the pin will be an input or an output. For example, setting the direction to output if you are driving an LED, or to input if you are reading a button state.
The Mode setting allows you to specify the mode in which the pin will operate. This involves selecting the function or role of the pin among various options provided by the microcontroller.
2. Dio tab: it is specific to the Digital Input/Output module of the microcontroller and deals with higher-level software abstraction of the pins configured as general-purpose I/O, helping to control and monitor the digital state of the pins.
Based on the pin port ID, a DioChannel is created. In this tab, you associate a logical DIO channel with the physical pin that was configured in the Port tab. This involves setting up the channel number and ensuring the software can refer to this pin by its channel identifier.
Note that the name given in the Dio tab will be shown in the block's dropdown menu.
Let us know if you manage to set it up or if you have other problems.
Best regards,
Dragos
Hi, Dragos
Thanks for your detailed reply! I have already solved this problem.
Your detailed operation is consistent with mine. The real issue lies in the fact that I didn't set the hardware configuration before dragging the DIO module. If I drag the DIO module first and then proceed with the hardware configuration, this issue arises. Conversely, the issue does not arise when I configure the hardware prior to dragging the DIO module.
Thank you again for your help!
Best regards,
Azure