Project template for S32K144

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

Project template for S32K144

Jump to solution
1,130 Views
berg0vic1
Contributor II

Hello,

I want to create a project from scratch in S32DS 3.6.0. However the main.c file seems too blank to me. There is no clock settings or Mcal_Init() function in it. Should I set this field manually or are there any template projects for it ? 

 

I know there is a examples in RTD but I need empty project with mandatory functions calls like mcu_init or clock_init.

 

/*==================================================================================================

* Project : RTD AUTOSAR 4.7

* Platform : CORTEXM

* Peripheral : S32K14X

* Dependencies : none

*

* Autosar Version : 4.7.0

* Autosar Revision : ASR_REL_4_7_REV_0000

* Autosar Conf.Variant :

* SW Version : 2.0.0

* Build Version : S32K1_RTD_2_0_0_P01_D2308_ASR_REL_4_7_REV_0000_20230804

*

* Copyright 2020-2023 NXP Semiconductors

*

* NXP Confidential. This software is owned or controlled by NXP and may only be

* used strictly in accordance with the applicable license terms. By expressly

* accepting such terms or by downloading, installing, activating and/or otherwise

* using the software, you are agreeing that you have read, and that you agree to

* comply with and are bound by, such license terms. If you do not agree to be

* bound by the applicable license terms, then you may not retain, install,

* activate or otherwise use the software.

==================================================================================================*/

 

/**

* @file main.c

*

* @addtogroup main_module main module documentation

* @{

*/

 

/* Including necessary configuration files. */

#include "Mcal.h"

 

volatile int exit_code = 0;

/* User includes */

 

/*!

\brief The main function for the project.

\details The startup initialization sequence is the following:

* - startup asm routine

* - main()

*/

int main(void)

{

/* Write your code here */

 

for(;;)

{

if(exit_code != 0)

{

break;

}

}

return exit_code;

}

 

/** @} */

 

 

0 Kudos
Reply
1 Solution
1,110 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I want to create a project from scratch in S32DS 3.6.0. However the main.c file seems too blank to me. There is no clock settings or Mcal_Init() function in it. Should I set this field manually or are there any template projects for it ?

You wont probably find specific template with such functions included.

Closest to what you are looking for would be MCU example in MCU plugin:

petervlna_0-1742282137280.png

I always prefer blank project where I will start one by one putting code so I can evaluate each step if it is working.

Simply copy init function from example and put it into the blank project.

Or you can use API documentation and write the code / call functions by yourself.

Best regards,

Peter

View solution in original post

2 Replies
1,111 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I want to create a project from scratch in S32DS 3.6.0. However the main.c file seems too blank to me. There is no clock settings or Mcal_Init() function in it. Should I set this field manually or are there any template projects for it ?

You wont probably find specific template with such functions included.

Closest to what you are looking for would be MCU example in MCU plugin:

petervlna_0-1742282137280.png

I always prefer blank project where I will start one by one putting code so I can evaluate each step if it is working.

Simply copy init function from example and put it into the blank project.

Or you can use API documentation and write the code / call functions by yourself.

Best regards,

Peter

1,091 Views
berg0vic1
Contributor II
Thank you for your help Peter
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2063038%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EProject%20template%20for%20S32K144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063038%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20want%20to%20create%20a%20project%20from%20scratch%20in%20S32DS%203.6.0.%20However%20the%20main.c%20file%20seems%20too%20blank%20to%20me.%20There%20is%20no%20clock%20settings%20or%20Mcal_Init()%20function%20in%20it.%20Should%20I%20set%20this%20field%20manually%20or%20are%20there%20any%20template%20projects%20for%20it%20%3F%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EI%20know%20there%20is%20a%20examples%20in%20RTD%20but%20I%20need%20empty%20project%20with%20mandatory%20functions%20calls%20like%20mcu_init%20or%20clock_init.%3C%2FP%3E%3CBR%20%2F%3E%3CDIV%3E%3CDIV%3E%3CP%3E%3CSPAN%3E%2F*%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Project%20%3A%20RTD%20AUTOSAR%204.7%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Platform%20%3A%20CORTEXM%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Peripheral%20%3A%20S32K14X%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Dependencies%20%3A%20none%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%3C%2FSPAN%3E%3CSPAN%3EAutosar%3C%2FSPAN%3E%3CSPAN%3E%20Version%20%3A%204.7.0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%3C%2FSPAN%3E%3CSPAN%3EAutosar%3C%2FSPAN%3E%3CSPAN%3E%20Revision%20%3A%20ASR_REL_4_7_REV_0000%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%3C%2FSPAN%3E%3CSPAN%3EAutosar%3C%2FSPAN%3E%3CSPAN%3E%20Conf.Variant%20%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20SW%20Version%20%3A%202.0.0%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Build%20Version%20%3A%20S32K1_RTD_2_0_0_P01_D2308_ASR_REL_4_7_REV_0000_20230804%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20Copyright%202020-2023%20NXP%20Semiconductors%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20NXP%20Confidential.%20This%20software%20is%20owned%20or%20controlled%20by%20NXP%20and%20may%20only%20be%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20used%20strictly%20in%20accordance%20with%20the%20applicable%20license%20terms.%20By%20expressly%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20accepting%20such%20terms%20or%20by%20downloading%2C%20installing%2C%20activating%20and%2For%20otherwise%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20using%20the%20software%2C%20you%20are%20agreeing%20that%20you%20have%20read%2C%20and%20that%20you%20agree%20to%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20comply%20with%20and%20are%20bound%20by%2C%20such%20license%20terms.%20%3C%2FSPAN%3E%3CSPAN%3EIf%3C%2FSPAN%3E%3CSPAN%3E%20you%20do%20not%20agree%20to%20be%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20bound%20by%20the%20applicable%20license%20terms%2C%20then%20you%20may%20not%20retain%2C%20install%2C%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20activate%20or%20otherwise%20use%20the%20software.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%2F**%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%40file%20main.c%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%40%3C%2FSPAN%3E%3CSPAN%3Eaddtogroup%3C%2FSPAN%3E%3CSPAN%3E%20main_module%20main%20module%20documentation%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%20%40%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%2F*%20%3C%2FSPAN%3E%3CSPAN%3EIncluding%3C%2FSPAN%3E%3CSPAN%3E%20necessary%20configuration%20files.%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%23include%3C%2FSPAN%3E%20%3CSPAN%3E%22Mcal.h%22%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3Evolatile%3C%2FSPAN%3E%20%3CSPAN%3Eint%3C%2FSPAN%3E%3CSPAN%3E%20exit_code%20%3C%2FSPAN%3E%3CSPAN%3E%3D%3C%2FSPAN%3E%20%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%2F*%20User%20includes%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%2F*!%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%5Cbrief%20The%20main%20function%20for%20the%20project.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%5Cdetails%20The%20startup%20initialization%20sequence%20is%20the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3E%3CSPAN%3Ereturn%3C%2FSPAN%3E%3CSPAN%3E%20exit_code%3C%2FSPAN%3E%3CSPAN%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%3E%2F**%20%40%7D%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2064731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Project%20template%20for%20S32K144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2064731%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThank%20you%20for%20your%20help%20Peter%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2063525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Project%20template%20for%20S32K144%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2063525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3EI%20want%20to%20create%20a%20project%20from%20scratch%20in%20S32DS%203.6.0.%20However%20the%20main.c%20file%20seems%20too%20blank%20to%20me.%20There%20is%20no%20clock%20settings%20or%20Mcal_Init()%20function%20in%20it.%20Should%20I%20set%20this%20field%20manually%20or%20are%20there%20any%20template%20projects%20for%20it%20%3F%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3EYou%20wont%20probably%20find%20specific%20template%20with%20such%20functions%20included.%3C%2FP%3E%0A%3CP%3EClosest%20to%20what%20you%20are%20looking%20for%20would%20be%20MCU%20example%20in%20MCU%20plugin%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22petervlna_0-1742282137280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22petervlna_0-1742282137280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F328560iA0A60307B44FA304%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22petervlna_0-1742282137280.png%22%20alt%3D%22petervlna_0-1742282137280.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20always%20prefer%20blank%20project%20where%20I%20will%20start%20one%20by%20one%20putting%20code%20so%20I%20can%20evaluate%20each%20step%20if%20it%20is%20working.%3C%2FP%3E%0A%3CP%3ESimply%20copy%20init%20function%20from%20example%20and%20put%20it%20into%20the%20blank%20project.%3C%2FP%3E%0A%3CP%3EOr%20you%20can%20use%20API%20documentation%20and%20write%20the%20code%20%2F%20call%20functions%20by%20yourself.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPeter%3C%2FP%3E%3C%2FLINGO-BODY%3E