Question about how to write code for s32k314.

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

Question about how to write code for s32k314.

180 Views
Oido
Contributor I

Hello. I am going to work with s32k314 this time. Previously, I worked with s32k144.

But I'm not solving the problem. I'm trying to set up a development environment, but if I create an example of s32k344 in the s32ds 3.4 version, only the main statement is created, and none of the related header files are generated.

Also, I would like to write the code in the way I used in the S32K144 instead of the DioConf_DioChannel_Digital_Output_LED_Q172, STD_HIGH).

For example, when I was S32K144,
PCC->PCCn [PCC_PORTA_INDEX] = PCC_PCCn_CGC_MASK; 
PCC->PCCn[PCC_PORTB_INDEX] = PCC_PCCn_CGC_MASK; 
 
PTA->PDDR = (0<<0)|(0<<1)|(1<<10)|(1<<11)|(0<<13); 
PTB->PDDR = (1<<2)|(1<<5)|(0<<6)|(1<<7); 
 
PTA->PSOR = (1<<10)|(1<<11); 
 
PORTA->PCR[0] = PORT_PCR_MUX(1); 
PORTA->PCR[1] = PORT_PCR_MUX(1); 
PORTA->PCR[13] = PORT_PCR_MUX(1); 
PORTB->PCR[2] = PORT_PCR_MUX(1);
I wrote the code this way.
But S32K3XX doesn't even exist in Cookbook, so it's not building the foundation for how to write that code.
I would like to write a code for S32K3XX in the way I used to do. Is there any material I can find? If not, if you tell me the code that declares the input and output of the GPIO, which is a low-level example I just wrote, I will use it as a base.
S32DS 3.5 can't be used in my computer environment after a while to install it, maybe it recognizes it as a virus or the executable file disappeared. I'm currently using S32DS 3.4.
0 Kudos
5 Replies

147 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Oido,

Development for applications in newer packages has been migrated from registers (as the S32K1xx's Cookbook) to application layer as LLD or MCAL. You can still implement projects the way you have been doing in S32K144, but there is no documentation for the S32K3xx's family.

Using S32DS3.4, you can refer to the RTD packages version 2.0.0 for S32K3xx, which include the libraries for all of the modules. You can import the Siul2_Dio_Ip_Example_S32K344 (there is no specific example for the S32K314 derivative):

Julin_AragnM_0-1719271218683.png

This example toggles red LED from the S32K344 EVB, but you can reconfigure the output pin inside the "Pins" and "Peripherals" views. You can go over the HOWTO: Create a Blinking LED example project using S32K1xx RTD without AUTOSAR guide for some context in how to create a project with RTD. It showcases S32K1xx packages, but it is the same principle for the S32K3xx family. There is also the Pins and Clocks training with RTD.

You can download the RTD's from this page: Real-Time Drivers (RTD) | NXP Semiconductors

Best regards,
Julián

0 Kudos

130 Views
Oido
Contributor I

Thank you for your answer.
But I get an error when I use an example because the files don't exist. Is there a workaround?

Also, I want to use the register directly rather than using the SDK function. Is there even one exemplified code?

I found a code that I can use by myself and wrote it, but I don't have a working PCB yet, so I don't know if this is a working code yet, but can you check if this is the code that interrupts pin 31 with FALLING EDGE and uses pin 18 as an output?

I post a picture of my problems when using codes and examples that I don't know if they work in the existing 144 method.

문제.jpgCODE.jpg

Also, if the file you provided is built unmodified, there will be an error. Is this a file that I need to fix?

ERROR.jpg

0 Kudos

112 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Oido,

Please go over the "description.txt" or "ReadMe.txt" file before building the application:

Julin_AragnM_0-1719513954930.png

You need to firstly select the project, and then click on either Pins, Clocks or Peripherals view. This will generate the configuration:

Julin_AragnM_1-1719514082521.png

After opening the S32 Config Tools perspective, you can click "Update Code" which will generate the files on the project:

Julin_AragnM_2-1719514109366.png

Best regards,
Julián

0 Kudos

32 Views
Oido
Contributor I

sdk.jpg

Thank you for your answer, and thanks to you, I managed to operate the code related to the example on the s32k344 EVB Q172 board with PORT and PIT examples.
When I pressed SW5 switch using a combination of examples, I succeeded in turning on the GREEN LED and turning off the GREEN LED and turning on the RED LED after 2 seconds with the PIT.

But I don't like it this way: for example, Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0,g_pin_mux_InitConfigArr0);

when I saw this phrase, I would never know in my life that

Siul2_Port_Ip_Init(uint32 pinCount, const Siul2_Port_Ip_PinSettingsConfig[]) //

PinCount and config[] should have NUM_OF_CONFIGURED_PINS0 and g_pin_mux_InitConfigArr0 variables in their place.

That's why I asked you how you can declare the register yourself.

reg.jpg

I declared the register myself, setting the PTA 18 and PTA 29 pins as output and making the 5V output go out.
Although PIT failed because it failed to find the format of several registers such as LDVAL, I'm sure I'll be able to find a way with help here.
S32K144 has various codes to declare registers in the cookbook, so other commands were guessed and written, but the S32K3XX series does not have a cookbook, so only hard-to-recognize example codes consisting of SDKs exist.

If I use a combination of example sentences, I'm sure I can make it work right away, but I don't think it's going to help me develop my abilities.

Look at the example. Can't you do anything for me other than that?

I beg you.

0 Kudos

19 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Oido,

Unfortunately, there are no bare-metal examples for S32K3. Just those that use High Level Driver (HLD) or Low-Level Driver (IP) which you can find in its respective RTD for S32K3xx devices.

You can refer to the examples in the RTD package or the ones in community (such as Example S32K312 PIT timer Toggle LED DS3.5 RTD300 - NXP Community) for guidance.

There is a list of HOWTOs (S32DS - list of HOWTOs - NXP Community) with some guides for creating applications, as well as an application note for migration (AN13414: S32K1 to S32K3 Migration Guidelines).

Best regards,
Julián

0 Kudos