CANBUS Extended ID Data reading

I am relatively new to .NET and Canbus. I have a CANBUS standard implemeted that scans various baudrates and gives feedback on if it is receiving data on that specific baudrate, I am able to run this test on a 11-bit std id canbus system, however it is failing on 29 bit one. I have a library that uses the TinyCLR_Interop.h include file. My problem is that when reading on a 29-bit system, i am not getting any messages. the result of the IsMessagePending is coming as 0. I have attached the implementation of the IsMessagePending function and its usage. please assist with understanding the usage of the TinyCLR_Interop.h since i cannot find its implementation and usage for the 29bit CAN system.

I think you are using tinyclr 1.0 which is very old and no longer supported. We were now using tinyclr v2.2 on SITCore devices.

Welcome to the community

Thanks a lot for the promt response. i understand that the version is quite old, however the project i am, working on was implemented using Visual Studio 2012 and .NETMicroframework v4.3. It will be upgraded, i just wanted to find out if there are any available material which i can use for the old framework to understand the implementation and what i might be missing on working with 29-bit CANBUS system.
Thanks for the welcome.

At least you should let us know what device you are working on ? :))

Your hardware will likely dictate that you must stay on NETMF. TinyCLR 1.0 was transitional and is no longer supported and is certainly not recommended as a transition step even for older hardware - just stay on netmf, and plan new hardware that supports tinyclr 2.x

1 Like

I am using an STM32F405 as the microcontroller. The can driver is TCAN334DCNT.
I am using Visual studio 2012 and the .NET MicroFramework 4.3. The can library is implemented using C++ and the TinyCLR library.

TinyCLR_Interop.h doesn’t know or care about 11 or 29 bits. Wrong place if you focus on this file.

Native driver (STM32F4_CAN.cpp) receive any message, doesn’t matter 11, 29 bit or remote frame…

Depend on 11 or 29 bits it will set the extend flag is true or false.

I see only reason no message is, look at STM32F4_CAN.cpp,

void STM32F4_Can_RxInterruptHandler(int32_t controllerIndex)

image

if there is an error then return.

It means could be something wrong before parsing the message.

You can add event to check if any error. Or remove that error to see, since you use TinyCLR 1 which can be recompiled.

And, it could be the sender did not send 29 bit.

Some softwares installed on PC, you have to select 29 bit to send ID 29 bit, or they don’t send or just send only low 11 bit id.

Also, check baudrate, filter, errors from PC.

If sender is not PC then you have to check your sender…

A lot of check…