S32DS can not generate processor code correctly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32DS can not generate processor code correctly

2,189 Views
larry_he
Contributor I

When I use S32DS create project from example,I find the processor code can not be generated correctly, which only happen in lin_master_s32k1xx & lin_slave_s32k1xx.

I do nothing but click the "Generate Processor Expert Code" button. Then build these projects.The errors are listed as below:

Errors

Resource

Path

'HARDWARE_INSTANCE_COUNT' undeclared here (not in a function)

lin.h

/lin_master_s32k144/SDK/middleware/lin/include line 609 C/C++ Problem

'LI0_GOTO_SLEEP_SCHEDULE' undeclared (first use in this function) 

main.c

/lin_master_s32k144/Sources line 173 C/C++ Problem

'LI0_NormalTable' undeclared (first use in this function) 

main.c

/lin_master_s32k144/Sources line 184 C/C++ Problem

'LI0' undeclared (first use in this function) 

main.c

/lin_master_s32k144/Sources line 130 C/C++ Problem

'LIN_FLAG_BUF_SIZE' undeclared here (not in a function) 

lin.h

/lin_master_s32k144/SDK/middleware/lin/include line 606 C/C++ Problem

'LIN_NUM_OF_FRMS' undeclared here (not in a function) 

lin.h

/lin_master_s32k144/SDK/middleware/lin/include line 607 C/C++ Problem

'LIN_NUM_OF_IFCS' undeclared here (not in a function) 

lin.h

/lin_master_s32k144/SDK/middleware/lin/include line 602 C/C++ Problem

unknown type name 'l_frame_handle' 

lin.h

/lin_master_s32k144/SDK/middleware/lin/include line 244 C/C++ Problem

.......

......

......

 

Then I look for the Generated_code, and I find the lin_cfg.c & lin_cfg.h are not intact.

lin_cfg.c:

/** ###################################################################
**     This component module is generated by Processor Expert. Do not modify it.
**
**     @file      lin_cfg.c
**
**     @date      10:59:03, 2020-11-23
**
**     @brief     Hardware configuration file
**
**     Copyright : 1997 - 2015 Freescale Semiconductor, Inc.
**     Copyright 2016 - 2017 NXP
**     All Rights Reserved.
**
**     THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
**     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
**     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
**     IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
**     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
**     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
**     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
**     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
**     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
**     IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
**     THE POSSIBILITY OF SUCH DAMAGE.
** ###################################################################*/

/*!
 * @file lin_cfg.c
 *
 * @page misra_violations MISRA-C:2012 violations
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 8.7, Could be made static.
 * Function ld_read_by_id_callout is API and shall not be made static.
 * This API is declared in lin_cfg.c so that users can configure the response
 * for  Read by ID request.
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 8.9, An object should be defined at block
 * scope if its identifier only appears in a single function.
 * An object with static storage duration declared at block scope cannot be
 * accessed directly from outside the block. g_lin_hardware_ifc, g_lin_tl_descriptor_array,
 * timerGetTimeIntervalCallback are dependent on user configurations,
 * so they shall be declared in lin_cfg.c.
 */

#include "lin.h"

 

lin_cfg.h:

/** ###################################################################
**     This component module is generated by Processor Expert. Do not modify it.
**
**     @file      lin_cfg.h
**
**     @date      10:59:03, 2020-11-23
**
**     @brief     Hardware configuration file
**
**     Copyright : 1997 - 2015 Freescale Semiconductor, Inc.
**     Copyright 2016 - 2017 NXP
**     All Rights Reserved.
**
**     THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED OR
**     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
**     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
**     IN NO EVENT SHALL NXP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
**     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
**     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
**     SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
**     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
**     STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
**     IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
**     THE POSSIBILITY OF SUCH DAMAGE.
** ###################################################################*/

/*!
 * @file lin_cfg.h
 *
 * @page misra_violations MISRA-C:2012 violations
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 2.3, A project should not contain unused type declarations.
 * The type can be used by user application.
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 2.5, A project should not contain unused macro declarations.
 * The macro can be used by user application.
 *
 * @section [global]
 * Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
 * The identifiers are generated from signal names. The signal name is defined by users and we can not control this.
 *
 * @section [global]
 * Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name
 * space shall be distinct.
 * The name of signal is defined by user and we can not control this.
 *
 * @section [global]
 * Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
 * The name of signal is defined by user and we can not control this.
 *
 * @section [global]
 * Violates MISRA 2012 Required Rule 5.5, Identifier shall be distinct from macro names.
 * The name of signal is defined by user and we can not control this.
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Directive 4.9, A function should be used in preference
 * to a function-like macro where they are interchangeable.
 * The macro is used to define static or dynamic implementation of API functions.
 * This way is more efficient.
 *
 * @section [global]
 * Violates MISRA 2012 Advisory Rule 20.10, The #/ ## preprocessor operator should not be used.
 * The operator is used to define dynamic implementation of API functions of signal interaction.
 * This way is more efficient.
 */
#ifndef    LIN_CFG_H
#define    LIN_CFG_H

#include <stdint.h>
#include "lin_driver.h"
#include "lin1.h"

/* Implements    : SUPPORT_MASTER_MODE_Class */
#define SUPPORT_MASTER_MODE     1U /* Equal to 1 when have at least one master interface */
/* Implements    : SUPPORT_SLAVE_MODE_Class */
#define SUPPORT_SLAVE_MODE      0U  /* Equal to 1 when have at least one slave interface */

/* Implements    : SUPPORT_PROTOCOL_21_Class */
#define SUPPORT_PROTOCOL_21     1U /* Equal to 1 when have at least one LIN2.1 or LIN2.2 interface */
/* Implements    : SUPPORT_PROTOCOL_20_Class */
#define SUPPORT_PROTOCOL_20     0U /* Equal to 1 when have at least one LIN2.0 interface */
/* Implements    : SUPPORT_PROTOCOL_J2602_Class */
#define SUPPORT_PROTOCOL_J2602  0U /* Equal to 1 when have at least one J2602 interface */
/* Implements    : SUPPORT_PROTOCOL_13_Class */
#define SUPPORT_PROTOCOL_13     0U /* Equal to 1 when have at least one LIN1.3 interface */

/* Implements    : SUPPORT_DIAG_CLASS_III_Class */
#define SUPPORT_DIAG_CLASS_III  0U /* Equal to 1 when have at least one ifc with diagnostic class III */
/* Implements    : SUPPORT_DIAG_CLASS_II_Class */
#define SUPPORT_DIAG_CLASS_II   0U /* Equal to 1 when have at least one ifc with diagnostic class II or III */

/* Implements    : SUPPORT_TRANSPORT_LAYER_Class */
#define SUPPORT_TRANSPORT_LAYER 0U /* Equal to 1 to use transport layer */
/* Implements    : SUPPORT_DIAG_SERVICE_Class */
#define SUPPORT_DIAG_SERVICE    0U /* Equal to 1 to use diagnostic service layer */
#define TIME_OUT_UNIT_US 500U





#define LI0_DIAG_NUMBER_OF_SERVICES     5U

#define LI0_DIAGSRV_ASSIGN_NAD_ORDER       0U
#define LI0_DIAGSRV_READ_BY_IDENTIFIER_ORDER       1U
#define LI0_DIAGSRV_CONDITIONAL_CHANGE_NAD_ORDER       2U
#define LI0_DIAGSRV_SAVE_CONFIGURATION_ORDER       3U
#define LI0_DIAGSRV_ASSIGN_FRAME_ID_RANGE_ORDER       4U

#define MAX_LENGTH_SERVICE 6




#endif    /* _LIN_CFG_H_ */

 

What's going on with this situation?

 

0 Kudos
9 Replies

2,180 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

Unfortunately, I cannot reproduce your issue.

I have imported the lin_master_s32k144 and lin_slave_s32k144 example from S32DS 2.2 and S32DS 2018.R1. I'm able to "Generate Processor Expert Code" and compile the projects without any errors.

From S32SDK S32K1xx RTM v3.0.0 Example Projects.

Which S32DS and SDK version do you use?

 

Thank you.

Best regards,

Diana

0 Kudos

2,162 Views
larry_he
Contributor I

I tried them both. Unfortunately, neither S32DS 2.2 nor S32DS 2018.R1 can work.

捕获.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

捕获1.JPG

0 Kudos

2,147 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

Do you use examples from this folder? (here can be found the latest patch for both versions of S32DS https://www.nxp.com/design/software/development-software/s32-design-studio-ide/s32-design-studio-for...)

dianabatrlova_0-1606204110717.png

 

Can you try to import the attached project into S32DS v2.2 (this project has generated lin_cfg.c)? Have you seen any errors?

Do you use the default installation folder for the S32DS?

Do you have an option to test it on another computer?

 

Thank you.

Best regards,

Diana

 

 

 

0 Kudos

2,130 Views
larry_he
Contributor I

Yes,I download and install the latest SDK.

2.JPG

 

3.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

I don't use the default location of installation. I set it to "D:\NXP_20201122\S32DS_ARM_v2.2",so there is a error when compiling the project which you provided.

make: *** No rule to make target 'C:/NXP/S32DS_ARM_v2.2/S32DS/software/S32SDK_S32K1xx_RTM_3.0.0/rtos/osif/osif_baremetal.c', needed by 'SDK/rtos/osif/osif_baremetal.o'. Stop. 

 

However, I copy lin_cfg.c in your project and put into my project. Compiling maybe successful(no errors).

4.JPG

 

 

My friends can utilize those project well via their own install package. Let me have a try to install the package on another computer.

0 Kudos

2,124 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

Thank you for your details.

If you will try it on another computer, please, try to use the default location for installation if it is possible (just to be sure).

I will wait for your feedback.

Thank you.

Best regards,

Diana

0 Kudos

2,116 Views
larry_he
Contributor I

Hello,

On another computer, I can compile the "lin_master_s32k144" & "lin_slave_s32k144" projects with the package and the activation code.5.png

 

 

 

 

 

 

 

 

 

 

 

 I can debug and get frames that meet the requirements of protocol. However, I wonder why my computer can not generate correct code in "lin_master_s32k144" & "lin_slave_s32k144".

0 Kudos

2,107 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

Thank you for the details.

Have you tried to reinstall S32DS on your computer with the default installation path?

Which Windows version do you have on your computer?

 

Best regards,

Diana

0 Kudos

2,098 Views
larry_he
Contributor I

Hello,

This time, I did not change anything.They are all default.

6.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8.JPG

 

 

 

 

 

 

 

 

However, the code was still not intact.

9.JPG

 

 

 

 

 

 

 

 

 

 

 

 

My Windows version is listed as below:

Windows 10
1909
2019/8/22
18363.1198
0 Kudos

2,060 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

Please accept my apologies for the delay.

I can see warnings in your last image related to the LIN path.

This can be fixed by the right click on the project -> Properties -> Build -> Settings -> Includes and select the correct SDK path:

dianabatrlova_0-1606743169211.png

 

Best regards,

Diana

0 Kudos