cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1 canbus problem zephyr

eiten
Associate II

Hello everybody,

I try to get canbus communication on the blue pill+ under zephyr to work. I use the canopennode sample. I got the following overlay:

 

/ {
        model = "STM32 Minimum Development Board (Blue)";
        compatible = "stm32_min_dev_blue", "st,stm32f103c8";

        leds {
                led: led {
                        gpios = <&gpiob 2 GPIO_ACTIVE_LOW>;
                };
        };
        chosen {
                zephyr,canbus = &can1;
        };
        buttons {
                compatible = "gpio-keys";
                button0: button_0 {
                        gpios = <&gpioa 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
                        label = "User Key";
/*                        zephyr,code = <INPUT_KEY_0>;*/
                };
        };
        aliases {
                sw0 = &button0;
        };

};

&can1 {
        pinctrl-0 = <&can_rx_remap1_pb8 &can_tx_remap1_pb9>;
        pinctrl-names = "default";
        status = "okay";
};

 

My compile command looks like this:

 

west build -b stm32_min_dev@blue -p -- -DBOARD_FLASH_RUNNER=jlink -DCONF_FILE="prj_no_storage.conf"

 

 But I get network unready errors:

 

*** Booting Zephyr OS build v3.7.0-2072-gcba339a6f4e2 ***
[00:00:00.000,000] <dbg> canopen_driver: CO_CANmodule_init: rxSize = 13, txSize = 9
[00:00:00.000,000] <dbg> canopen_driver: CO_CANmodule_init: excessive number of concurrent CAN RX filters enabled (needs 13, 14 available)
[00:00:00.000,000] <inf> app: CANopen stack initialized
[00:00:00.000,000] <inf> app: Green LED not available
[00:00:00.000,000] <inf> app: Red LED not available
[00:00:00.010,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.020,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.040,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.050,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.070,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.081,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.092,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.102,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.113,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:00.124,000] <err> canopen_driver: failed to send CAN frame (err -114)
[00:00:01.500,000] <err> canopen_driver: failed to send CAN frame (err -114)

 

Any ideas?

Thanks, Edi

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,


@eiten wrote:

Hi Peter,

oh, I didn't know that! Is there a way to check if the STM32F103 is fake or real?


Not so easy to catch the fake from real but you can see this link: https://hackaday.com/2020/10/22/stm32-clones-the-good-the-bad-and-the-ugly/

We recommend using ST boards with genuine MCUs.


@eiten wrote:

And could you recomend a cheap dev board which is capable of can/canopen?


As you are not needing a FDCAN interface and just Classic CAN, I can recommend NUCLEO-f103rb:

https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

You need to add a CAN transceiver.

Hope it helps

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

Welcome @eiten, to the community!

Well, problems with the so-called Blue Pill have been discussed very often in the community: it is a third-party product from Asia, where not only development instructions were ignored, but also counterfeits of the STM32F103 have been used almost exclusively for years. You should therefore contact the manufacturer of that fake MCU or the manufacturer of the Blue Pills for support.

Good luck!
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Peter,

oh, I didn't know that! Is there a way to check if the STM32F103 is fake or real? And could you recomend a cheap dev board which is capable of can/canopen? canfd is not needed, and only 1 adc and 1 i2c would be enough.

Thanks, Edi

Hello,


@eiten wrote:

Hi Peter,

oh, I didn't know that! Is there a way to check if the STM32F103 is fake or real?


Not so easy to catch the fake from real but you can see this link: https://hackaday.com/2020/10/22/stm32-clones-the-good-the-bad-and-the-ugly/

We recommend using ST boards with genuine MCUs.


@eiten wrote:

And could you recomend a cheap dev board which is capable of can/canopen?


As you are not needing a FDCAN interface and just Classic CAN, I can recommend NUCLEO-f103rb:

https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

You need to add a CAN transceiver.

Hope it helps

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi @SofLit 

thanks a lot. I just ordered a NUCLEO-F103RB at Distrelec. I know that I need a transceiver, I use the SN65HVD230 which should be fine, I think...

I'll report back!

Regards


@eiten wrote:

I use the SN65HVD230 which should be fine...


Indeed. It's already used in some ST boards.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.