Will the FlexCAN driver in KSDK_1.1.0 work with MQX for Kinetis Devices?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Will the FlexCAN driver in KSDK_1.1.0 work with MQX for Kinetis Devices?

ソリューションへジャンプ
2,601件の閲覧回数
jschepler
Contributor III

I am wondering if this driver will work without any editting for MQX for Kinetis devices?  I am using a TWR K64F120M and know that the driver works for baremetal, but would like it to work with MQX, also.

タグ(4)
0 件の賞賛
返信
1 解決策
2,051件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

My understanding is this driver is for RTOS and baremetal.

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
2,052件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

My understanding is this driver is for RTOS and baremetal.

0 件の賞賛
返信
2,051件の閲覧回数
jschepler
Contributor III

Thanks for your reply, Daniel.

I can successfully run the flexcan_uart_twrk64f120m demo, but when I copy that code to my project I get a strange error.  In my project I have several tasks, and I use the same code from the demo for this CAN_TASK. 
In my project, as soon as the can message sends, and I know it sends because I have a CAN analyzer, I then get a mesage that reads "No source available for "0x410"". Or, It it will say, "No source availabe for "0x530"".

However, if I put a breakpoint in the fsl_flexcan_driver.c file, in the function FLEXCAN_DRV_SEND, at the line

if (result == kStatus_FLEXCAN_Success)

then my program will continue to work without errors.

If I take the breakpoint off, the "no source available" message appears and the device resets.

Any ideas on to the cause of this error?

0 件の賞賛
返信
2,051件の閲覧回数
jschepler
Contributor III

Everyone, please be aware about the LWSEM_WAIT strange occurences.  I have been troubleshooting this problem for several days, and I just discovered another user had a problem with LWSEM.

The thread I am refering to is here: _lwsem_post problem on 32Bit SPI slave ISR

It seems that I will have to re-write the flexcan driver and use a lwevent instead of a lwsem to solve the issue completely, I now just have a delay of 100ms before the LWSEM_WAIT.

0 件の賞賛
返信
2,051件の閲覧回数
yarannan
Contributor III

So hey just wondering did you get problem fixed?

0 件の賞賛
返信
2,051件の閲覧回数
DavidS
NXP Employee
NXP Employee

I have co-worker that got this demo working for TWR-K60D100M and another soon to be announced Kinetis device using latest KDS/KSDK.

Regards,

David

0 件の賞賛
返信
2,051件の閲覧回数
yarannan
Contributor III

Thanks. I am only working on baremetal now. I am not sure about a lof of process about FlexCan. I didnt find info from reference manual or i just missed it.

Basically, I try to make an application that can send/receive a CAN message. Currently, I dont have the other CAN for test, so I have to use loop back mode.

I configured Rx buffer, tx buffer. I didnt use interrupt. It doesn really send or receive. Do you know what I did wrong?

0 件の賞賛
返信
2,051件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Yaran,

The KSDK_1.1.0 has both baremetal (HAL and Driver layers) and OS (MQX/FreeRTOS/Others) support.

If you want baremetal please look at the following project:

C:\Freescale\KSDK_1.1.0\demos\flexcan_uart

Currrently it is only setup for the K60 and K64 in KDS but it might give insight into help with your code base.

Documentation for that demo is in following PDF Chapter 7.

C:\Freescale\KSDK_1.1.0\doc\Kinetis SDK v.1.1 Demo Applications User's Guide.pdf

Regards,

David

2,051件の閲覧回数
yarannan
Contributor III

Hi David,

Thanks for replying. I ran the demo which is flexcan_uart. It worked.

Currently, my application is not using UART. Therefore, i removed all code related UART and after that

it cannot transmit message through CAN anymore. Do you think i miss something important as your experience?

Yaran

0 件の賞賛
返信