Open ReinhardKeil opened 1 month ago
This is intended behaviour. The rule was purposely agreed and implemented to address item 3 in https://github.com/Open-CMSIS-Pack/devtools/issues/1092.
Item 3 in https://github.com/Open-CMSIS-Pack/devtools/issues/1092 is correct. But here the provided connection is in the *.cproject.yml
not in the *.clayer.yml
.
I recommend that you take a closer look to the example.
Whether connections
come in *.cproject.yml
or *.clayer.yml
has never played any role on their validation rules.
Item 3 in #1092 was not captured completely accurately. Basically, it should say: A layer with provided connections where none of them are consumed, should not be used.
Example which was mentioned when #1092 Item 3 was created:
Scenario 1:
IoT_Socket
, STDIN
, STDOUT
, Heap
IoT_Socket
and consumes CMSIS_ETH
CMSIS_WiFi
CMSIS_ETH
, STDIN
, STDOUT
, Heap
In this case the Shield layer is not needed since it only provides CMSIS_WiFi
which is not consumed.
Scenario 2:
IoT_Socket
, STDIN
, STDOUT
, Heap
IoT_Socket
and consumes CMSIS_WiFi
CMSIS_WiFi
CMSIS_ETH
, STDIN
, STDOUT
, Heap
In this case the Shield layer is required since it provides CMSIS_WiFi
. Board layer is also required since it provides other consumed connections.
I agree with the description in this ticket: It is not required that all provided connections in a layer are consumed in order to be compatible. However, the layer should be skipped when no connections from the layer is consumed.
Follow-up after the discussion with @RobertRostohar :
A project needs to be treated differently than a layer in the following scenario:
- Project is valid even when no connections from the project are being consumed
- Layer is not considered when no connections from the layer are consumed
So we need to change the implementation.
The issue in #1529 has an example with a single provided connection in the project which is not consumed. Since the same rule is applied to project as to layers, the project is skipped (due to no connection used), but the project is still valid and should be used.
Use case example:
- Project provides RTOS2 connection (which might or might not be used by other layers)
- Board layer 1: does not consume RTOS2
- Board Layer 2: consumes RTOS2 (ex: due to WiFi driver)
Both combinations are valid (assuming other connections fit):
- Project + Board Layer 1
- Project + Board Layer 2
csolution list layer should detect a layer as compatible what all consumed connections are provided. However it is not required that all provided connections are consumed.
To Reproduce Use the following local packs (register the PDSC files).
Use the following project (branch bug1) https://github.com/ReinhardKeil/USBD/tree/bug1
Steps to reproduce the behavior:
In the configuration it correctly detects layers.
connections:
Layers are rejected with:
Expected behavior Layers should be detected also when a connection is provided, but nowhere consumed.
Environment (please complete the following information):