2024-09-17 04:37 AM
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
Solved! Go to Solution.
2024-09-17 06:41 AM - edited 2024-09-17 06:44 AM
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
2024-09-17 06:25 AM - edited 2024-09-17 06:26 AM
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
2024-09-17 06:36 AM
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
2024-09-17 06:41 AM - edited 2024-09-17 06:44 AM
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
2024-09-17 07:06 AM
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
2024-09-17 07:19 AM
@eiten wrote:
I use the SN65HVD230 which should be fine...
Indeed. It's already used in some ST boards.