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?