S32K3x4 FlexCAN example

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

S32K3x4 FlexCAN example

192 Views
Voledi
Contributor I

Hi, Sirs

I am trying to run the example you provided, to communicate between CAN board and CAN tool: Example S32K344 FlexCAN_Ip TX/RX/EnhanceRXFIFO test S32DS3.4 RTD200 - NXP Community
But I am getting the error below when configuring with Tool

Voledi_0-1733903556204.png


Error: Mscr was not configured in Pin tool

0 Kudos
Reply
5 Replies

155 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

example was done in S32DS3.4 and RTD200, so you can have issues importing into S32DS3.5 and newer RTD if have any.
Anyway for an error you have, use MSCR number from pins used in PINs tool.
For example for some GPIO pin

PetrS_0-1733910696096.png

BR, Petr

0 Kudos
Reply

139 Views
Voledi
Contributor I

thanks for your reply,

i have solved the above error problem when setting Mscr=27 and Mscr=28 for PTA27 and PTA28


i am new to CAN, let me ask how PTC20 and PTC21 affect our CAN application ( Does it work without PTC20 21 ?) , what are the necessary and sufficient factors for a CAN communication to run
thanks

Voledi_0-1733913180268.png

COMPARE with

Voledi_1-1733913191464.png

 

0 Kudos
Reply

121 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

those pins are connected to CAN transceiver's EN and /STB inputs on the EVB. Those are pulled up on the EVB to put CAN transceiver in active normal mode. 
But if there is a need to change its mode etc, those pins will be needed as well.

BR, Petr

0 Kudos
Reply

94 Views
Voledi
Contributor I

Hi,

I am using S32DS 3.6 AND RTD 5.0.0, to avoid conflict with project Example S32K344 FlexCAN_Ip TX/RX/EnhanceRXFIFO test S32DS3.4 RTD200 - NXP Community made on S32DS3.4 and RTD200

I did the following steps:
- Open FlexCAN_Ip_Example_S32K344 -> Config Tool -> Enabel PinTool->PTA27 PTA28 PTC20 -> SiuI2_Port setup ->Update code
- Replay old main.c with main.c of Example S32K344 FlexCAN_Ip TX/RX/EnhanceRXFIFO test S32DS3.4 RTD200 - NXP Community

The result I got the error below, I attached the project here, can you help

Voledi_0-1733975170422.png

10:35:24 **** Incremental Build of configuration Debug_FLASH for project External_CAN_And_FlexCAN_Ip_Example_S32K344 ****

make -j6 all

Building file: ../src/main.c

Building file: ../RTD/src/Clock_Ip_ExtOsc.c

Invoking: Standard S32DS C Compiler

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"

Building file: ../RTD/src/Clock_Ip_FracDiv.c

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_ExtOsc.d" -MT"RTD/src/Clock_Ip_ExtOsc.o" -o "RTD/src/Clock_Ip_ExtOsc.o" "../RTD/src/Clock_Ip_ExtOsc.c"

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_FracDiv.d" -MT"RTD/src/Clock_Ip_FracDiv.o" -o "RTD/src/Clock_Ip_FracDiv.o" "../RTD/src/Clock_Ip_FracDiv.c"

Building file: ../RTD/src/Clock_Ip_Frequency.c

Building file: ../RTD/src/Clock_Ip_Gate.c

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_Frequency.d" -MT"RTD/src/Clock_Ip_Frequency.o" -o "RTD/src/Clock_Ip_Frequency.o" "../RTD/src/Clock_Ip_Frequency.c"

Building file: ../RTD/src/Clock_Ip_IntOsc.c

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_Gate.d" -MT"RTD/src/Clock_Ip_Gate.o" -o "RTD/src/Clock_Ip_Gate.o" "../RTD/src/Clock_Ip_Gate.c"

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_IntOsc.d" -MT"RTD/src/Clock_Ip_IntOsc.o" -o "RTD/src/Clock_Ip_IntOsc.o" "../RTD/src/Clock_Ip_IntOsc.c"

../src/main.c: In function 'main':

../src/main.c:275:21: error: 'NUM_OF_CONFIGURED_PINS0' undeclared (first use in this function)

275 | Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

| ^~~~~~~~~~~~~~~~~~~~~~~

../src/main.c:275:21: note: each undeclared identifier is reported only once for each function it appears in

Finished building: ../RTD/src/Clock_Ip_ExtOsc.c

Finished building: ../RTD/src/Clock_Ip_IntOsc.c

Finished building: ../RTD/src/Clock_Ip_FracDiv.c

 

../src/main.c:275:46: error: 'g_pin_mux_InitConfigArr0' undeclared (first use in this function)

 

275 | Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

| ^~~~~~~~~~~~~~~~~~~~~~~~

Finished building: ../RTD/src/Clock_Ip_Frequency.c

 

Finished building: ../RTD/src/Clock_Ip_Gate.c

make: *** [src/subdir.mk:20: src/main.o] Error 1

Building file: ../RTD/src/Clock_Ip_Irq.c

make: *** Waiting for unfinished jobs....

 

 

Invoking: Standard S32DS C Compiler

arm-none-eabi-gcc "@RTD/src/Clock_Ip.args" -MMD -MP -MF"RTD/src/Clock_Ip_Irq.d" -MT"RTD/src/Clock_Ip_Irq.o" -o "RTD/src/Clock_Ip_Irq.o" "../RTD/src/Clock_Ip_Irq.c"

Finished building: ../RTD/src/Clock_Ip_Irq.c

 

"make -j6 all" terminated with exit code 2. Build might be incomplete.

 

10:35:27 Build Failed. 4 errors, 0 warnings. (took 2s.696ms)

 

 

0 Kudos
Reply

21 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

check for name of pin config structure in Siul2_Port_Ip_Cfg.c and use parameters of Siul2_Port_Ip_Init accordingly.

It would be something like this...

Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS_PortContainer_0_BOARD_InitPeripherals, g_pin_mux_InitConfigArr_PortContainer_0_BOARD_InitPeripherals);

BR, Petr

0 Kudos
Reply