Using CAN driver with KEAZ128

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

Using CAN driver with KEAZ128

Jump to solution
4,025 Views
thomasolenik
Contributor III

I'm trying to use the MSCAN_KEA_DEVD package in S32DS for a KEAZ128. I've copied the driver files and the code into my project and I get compile errors in MSCAN_Module.c. NVIC_ICER, NVIC_IPR7, and NVIC_ISER can not be resolved. I've copied the section of code causing the problem below. 

 

I believe these are supposed to be enabling interrupts, but I do not see these show up in any documentation. I think maybe these have been depreciated, but wanted to pose the question here of what would be the appropriate replacement for this code?

 

Thanks,

 

Tom Olenik

 

148132_148132.PNGCapture.PNG

Labels (1)
Tags (3)
1 Solution
2,668 Views
stanish
NXP Employee
NXP Employee

Hello Thomas,

S32DS uses CMSIS functions for NVIC control in contrast to CodeWarrior "proprietary" header file NVIC macros.

I'd recommend you to replace NVIC macros with its CMSIS counterparts:

pastedImage_0.png

Attached is the entire S32DS project for your convenience.

[Updated] Fixed MSCAN IRQ Handlers (reported by 张三)

Regards,

Stan

View solution in original post

15 Replies
2,668 Views
Yingming
Contributor II

Hi,Stan:

I am using Eval board(FRDM-KEAZ128) to run this project and can't tranmit data.

I check Schematic and find it uses MC33903 as CAN transceivers.MC33903 need uses SPI command to configure going to normal mode.

Can you share me the project that runs at  Eval board(FRDM-KEAZ128) ?

MC33903.png

0 Kudos
2,668 Views
ionut_chirilus
Contributor II

Hello. I have same trouble with my eval board: FRDM-KEAZ64. The source code doesn't work on this board and I don't have any signal on TX/RX (TP21/TP20). Where can be the problem?

PS: I don't understand where it's config the SBC NCZ33903?

0 Kudos
2,668 Views
Yingming
Contributor II

Hi,I have find answer.please refer to the following link:

https://community.nxp.com/message/872754

0 Kudos
2,668 Views
ionut_chirilus
Contributor II

1. Like andreascarponi, I have a ERR_SYNCH return value from the Transmit_CAN_MB function.

2. Another trouble it's when I change J107 to PIN1 and PIN2. In that moment the MCU stopped work.

3. pastedImage_2.png

How I can debug the board if it's necessary to connect 12V source on J16?

 

0 Kudos
2,668 Views
Yingming
Contributor II

Hello Stan:

I am also using your project as a reference and facing Compile issues.

When click Test_case.c, I get compile errors in Test_case.c.It shows :Assignment to itself 'err_status = err_status'

ScreenClip.png

What puzzles me is that,if I havn't click Test_case.c,it will complie successfully.

What should I do?

0 Kudos
2,668 Views
stanish
NXP Employee
NXP Employee

Hi,

This is an eclipse parser false positive error - please check the build console if the executable elf file has been created or not.

I can reproduce the issue. The eclipse IDE shows an error but build process has been successful. Please ignore that error.

pastedImage_2.png

Stan

0 Kudos
2,668 Views
michaeljwilson
Contributor II

Thank you for sharing the project implementing MSCAN on S32. After importing the project into S32 and skimming through all the included files and the MSCANKEA document, it is not entirely obvious if PTC6 and PTC7 (RX,TX) pins on the KEAZ128 are initialized to interface with the CAN transceiver. I do see the bitrate set to 500kbit/s.

I am confused as to why MSCAN is omitted from the SDK and why Processor Expert is available in S32 yet not supported for KEAZ.

Capture.PNG

0 Kudos
2,668 Views
vigneshbalaji
Senior Contributor I

Hi,

    

1)Can you share me the SDK for KEA-128?

2)Are you using CMSIS compliant library for KEA-128?

0 Kudos
2,668 Views
stanish
NXP Employee
NXP Employee

Hi,

KEA-128 SDK:

http://www.nxp.com/downloads/en/device-drivers/SDK-DRIVER-FRDM-KEA-S32DS.zip 

Complete Quick Start package (SDK + board schematic + examples + documentation):

http://www.nxp.com/downloads/en/board-support-packages/FRDM-KEA-QSP.zip 

Regards,

S.

0 Kudos
2,669 Views
stanish
NXP Employee
NXP Employee

Hello Thomas,

S32DS uses CMSIS functions for NVIC control in contrast to CodeWarrior "proprietary" header file NVIC macros.

I'd recommend you to replace NVIC macros with its CMSIS counterparts:

pastedImage_0.png

Attached is the entire S32DS project for your convenience.

[Updated] Fixed MSCAN IRQ Handlers (reported by 张三)

Regards,

Stan

2,668 Views
manjunathkm
Contributor III

Hello Stan,

I am also using your project as a reference and facing Reception issues.

There is no problem with sending message, But not able to receive any data instead i am getting receive error counter.

I am using Eval board to run this project,

Please help me to solve this issue

thanks and regards,

Manjunath

0 Kudos
2,667 Views
张三san
Contributor II

hi,

in CW,the IRQ is

void MSCAN_Rx_IRQHandler(void)

void MSCAN_Tx_IRQHandler(void)

but in S32DS is

void MSCAN_RX_IRQHandler(void)
void MSCAN_TX_IRQHandler(void)

you can find it in startup_SKEAZ1284.s

so please change it in MSCAN_Module.c and MSCAN_Module.h

Regards

0 Kudos
2,668 Views
stanish
NXP Employee
NXP Employee

Thanks for your comment.

I've fixed the example attached in my original answer.

Stan

0 Kudos
2,668 Views
vigneshbalaji
Senior Contributor I

Hi Manjunath,

                       Have you solved the reception problem in this CAN driver?

0 Kudos
2,668 Views
thomasolenik
Contributor III

Stan,

Thanks. That was a big help.

Tom Olenik

0 Kudos