AnsweredAssumed Answered

CAN communication on STM32F429ZI- Nucleo

Question asked by Nada Ali on Apr 24, 2018
Latest reply on Apr 26, 2018 by T J

Hi

I've already downloaded the en.stm32cubef4 package, but the CAN examples are on another board. If I want to use the examples on my STM32F429ZI- Nucleo and MCP2561 transceiver, what should I change in the example?

I tried to use the MBED online compiler and I used this example:

 

#include "mbed.h"

DigitalOut led1(LED1);
DigitalOut led2(LED2);
CAN can1(PB_8,PB_9);
char counter = 0;

main()
{
printf("start\n");

can1.frequency(2500000);
//can1.reset();
//can1.mode(CAN::Normal);

while(true){
if(can1.write(CANMessage(1337, &counter, 1)))
{
// counter++;
printf("Message sent: %d\n", counter);
}

else
{
printf("error");
}
counter++;
led1=!led1;

wait_ms(100);
}
}

 

with no luck. I was receiving error. I tried the CAN communication on LPC1768 mbed board with MCP2561 transceiver and the results were perfect.

 

Please, it's really urgent and am still new to this board. 

 

Thank you

 

Nada

Outcomes