Skip to main content
Visitor II
September 17, 2024
Solved

STM32F1 canbus problem zephyr

  • September 17, 2024
  • 1 reply
  • 1834 views

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

    This topic has been closed for replies.
    Best answer by mƎALLEm

    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

    1 reply

    Technical Moderator
    September 17, 2024

    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

    eitenAuthor
    Visitor II
    September 17, 2024

    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

    mƎALLEmAnswer
    Technical Moderator
    September 17, 2024

    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