I have a FEZ Cerberus that I have been tinkering with for a while. I have a project that I wanted to implement CAN BUS communications on. My background is all C#. I have just started to dibble into c/c++. The whole reason I’ve decided to do a native driver, is because the managed CAN driver in the showcase, is way to slow for my application. I need to receive data at around 500kbs at 40% bus load.
I have written an example CAN driver using the DSP_Lib from STMicroelectronics. Deployed it to the FEZ Cerberus and it works great, but its all in native code
I have searched and searched this forum, and the internet. However I havent had much luck in examples. I do know that GHI offers premium hardware, but I really wanna stay OSHW for future changes and nerding
I have successfully downloaded the 4.3 community port, and have built the FEZ Cerberus firmware and deployed back to the device. I also have wrote a small test interop that can be successfully called from Managed code.
So here is the problems i’m hitting.
- How can I accomplish Connecting the CAN pins to AF9? For example, I would use GPIO_PinAFConfig(params here) to accomplish this using the StdPeriphDriver. I have searched around the PK to see if I could find any custom driver examples, but have not had any luck However, I thought i found a small lead I thought in the STM32F4_i2c_function, but I cant get the reference to work in my native driver
- How to configure the pins. Again, I cannot find any references living already in the PK for something like GPIO_InitStructure.
- Can I reuse existing code from the DSP library? If so, how do I reference it in the native code for the PK?
I have tried several steps to get everything working. However, every time I add a reference or try to add code referencing the Stm32 framework, It fails to compile.
Here is some details about my setup
Windows 8.1 x64
GHI 4.3 community port
Here is some native code I’m trying to gain access to somehow.
What I think should already be in the PK for STM32F4
GPIO_PinAFConfig() RCC_AHB1PeriphClockCmd() RCC_APB1PeriphClockCmd() GPIO_InitStructure NVIC_InitTypeDef NVIC_Init
Things I want to add from the DSP Lib
CAN_Init() CAN_Receive() CAN_ITConfig() CAN_FilterInit() CAN_FilterInitStructure CAN_InitStructure
I hope all this makes sense, i seriously suck at explaining things
Any hints, or examples is greatly appreciated!