FAQ 803: Working with User Code when Generating Bus Simulation Containers (BSCs)
Question
Should I include my user code in the bus simulation container (BSC) or in the final consuming ConfigurationDesk application?
Solution
You can add user code implementations to a ConfigurationDesk application via properties of build configuration sets. When you select a build configuration set in the Build Configuration table, you can access the relevant properties in Bus Custom Code category of the Properties Browser, as shown in figure 1.
Only user code that is added to properties of Bus Custom Code category is included in bus simulation containers (BSCs) when you generate the containers. However, the user code is not checked for correctness.
If the user code is included in a BSC, the BSC is self-contained and you do not have to add the user code to the final consuming real-time application anymore.
However, depending on your use scenario, it is recommended to not add the user code to the Bus Custom Code category when you generate BSCs, which means that the sources are not included in the BSCs. The advantage of not including the sources in the BSCs is that the BSCs do not have to be regenerated each time the user code is modified, but only the consuming final real-time application has to be updated.
Furthermore, the architecture of the SecOC (TimeBaseManager/KeyStore) often requires that the relevant files of the Bus Custom Code interface are compiled and linked only once in the application (unique instance), which would not be the case if the user code is included in each BSC.
In past Releases, however, required files of the Bus Custom Code interface could sometimes not be identified if the user code was not included in BSCs. As a consequence, the final real-time application was not aware of these consumers of the Bus Custom Code interface (e.g., SecOC), so that the required files of the Bus Custom Code interface could not be compiled and linked.
The following tables show some constellations on how the user code is included using BSC files and how this affects the final build result from ConfigurationDesk.
The bold markings show the recommended constellation if you want to use the BSCs in ConfigurationDesk.
As of Release 2023-B:
|
Application Process |
BSC1 |
BSC2 |
Final Application |
Result |
|---|---|---|---|---|
|
BSCs in same application process |
Code |
Code |
Code |
OK |
|
Code |
Code |
No Code |
OK |
|
|
No Code |
No Code |
Code |
OK |
|
|
BSCs in different application processes |
Code |
Code |
Code |
OK |
|
Code |
Code |
No Code |
OK |
|
|
No Code |
No Code |
Code |
OK |
Before Release 2023-B:
|
Application Process |
BSC1 |
BSC2 |
Final Application |
Result |
|---|---|---|---|---|
|
BSCs in same application process |
Code |
Code |
Code |
OK, with BusCustomCode folder* |
|
Code |
Code |
No Code |
OK |
|
|
No Code |
No Code |
Code |
OK, with BusCustomCode folder* |
|
|
BSCs in different application processes |
Code |
Code |
Code |
OK, with BusCustomCode folder* |
|
Code |
Code |
No Code |
OK |
|
|
No Code |
No Code |
Code |
OK, with BusCustomCode folder* |
* In previous Releases (before ConfigurationDesk 23.2), when working with multiple BSCs, it might be necessary to also add the BusCustomCode folder from the dSPACE installation directory and the necessary files (DsBusCustomCode.c + DsBusCustomCode_PduUserCode.c / DsBusCustomCode_SecOC.c) to the ConfigurationDesk Custom Code category, please also refer to figure 2. Otherwise, the ConfigurationDesk build process might be canceled.
Figure 2: Only before ConfigurationDesk 23.2:
When BSC files are processed in ConfigurationDesk, it might be necessary to include the required files of the Bus Custom Code interface in the consuming ConfigurationDesk application via the Custom Code category.
Tags
| Date | 2025-01-20 |
| Type d’information | Foire Aux Questions (FAQ) |