2025-10-01 2:28 AM
Hi everybody,
I used a STM32F446 to communicate on NMEA2000 (CAN bus).
The two pins (RX/TX) of my µc are connected to an isolator SI8621 (https://www.skyworksinc.com/-/media/Skyworks/SL/documents/public/data-sheets/si861x-2x-datasheet.pdf) and then, a can transceiver is connected MCP2542 (https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP2542FD-MCP2542WFD-4WFD-Data-Sheet-DS20005514C.pdf)
My board doesn't supply the NMEA2000 (the +12V is provided by T-bone of CAN bus - (I have a voltage regulator 12V to 5V on my board).
When I supplied the NMEA2000, it works fine. But, NMEA2000 is an option, and by default nothing will be connected on the connector, so no there is no supply on the CAN bus transceiver, so the initialization of CAN bus doesn't work (timeout error).
It's no use to put a pull-up resistor on RX or a end of line resistor because there is no voltage.
For me the only solution that I see, is that the user (I've a screen) says if NMEA2000 is used or not. If this one is not used, I didn't initialize it, and if it's actived by user, I can initialize it.
Do you think there is another solution to do it ?
Solved! Go to Solution.
2025-10-01 8:02 AM - edited 2025-10-01 8:03 AM
So according to the the graphic you shared, the CAN transceiver is power supplied with an external power supply independent from the F446 supply which is not a good idea.
Moreover, the "nmea2000" CAN node will be off so nothing on the bus will acknowledge the transmitted CAN frames of F446.
So you need:
1- The CAN transceiver (MCP2542) be powered on/off at the same time with the MCU. I cannot tell about the SI8621 circuit isolator.
2- Connect another CAN node configured only in listen mode (receive only). So when NMEA2000 is powered off, at least the frames sent from F446 will be acknowledged.
So in conclusion, you can't keep STM32F446 sending CAN messages while there is no other CAN node (you need at least one alive) on the bus acknowledging its frames.
Hope it's clear now.
2025-10-01 2:43 AM - edited 2025-10-01 2:45 AM
Hello,
Not sure I understood the question and it's hard to help you based on that description.
You may need to schematize your system in a figure.
Do you mean that you have only tow nodes on the CAN bus: node 1: STM32F446, node 2: "NMEA2000"? and sometimes you power off that "NMEA2000" so the bus is no more functional? if it's the case, that's not possible when CAN is in Normal mode. You need either to detect that NMEA2000 is powered off therefore, you will put the CAN transceiver in Standby mode and disable any transmit or switch to a loopback mode till the next power on of NMEA2000.
2025-10-01 3:45 AM
hello,
sorry for my explanation.
Yes, I used two can bus on my STM32F446. The first (it works well - my board supplied it), I used it to communicate with other products, and no problem.
The second one, I used it for NMEA2000. I've put a schematic of this part in attached document.
So, NMEA2000 is isolated and powered by an external power supply. But sometimes, this bus will not be used, and the isolated side will not be supplied).
If I start my STM32F446 and if the nmea2000 bus is supplied, it works well.
If I start my STM32F446 and if the nmea2000 bus is not supplied, it doesn't work, the SW will go in hardfault after the HAL_CAN_Start().
2025-10-01 6:16 AM
Hello,
The attached png shows the schematic of the transceivers and what I requested is a simple graphic of your complete system (not a schematic): the F4 MCU (node 1) + the CAN bus + nmea2000 + the power of each device.
But as I said, you need that nmea2000 device still be powered otherwise you will get transmit Acknowledgement issue. The CAN node in transmission needs an acknowledgement of at least one frame receiver even if it's not the target recipient.
So either you disable the transmit during the nmea2000 power off or attach attach another small CAN node just to let to acknowledge the CAN frames transmitted by the F4 MCU or use loopback mode when nmea2000 is powered off.
I don't see any other solution.
2025-10-01 7:42 AM
2025-10-01 8:02 AM - edited 2025-10-01 8:03 AM
So according to the the graphic you shared, the CAN transceiver is power supplied with an external power supply independent from the F446 supply which is not a good idea.
Moreover, the "nmea2000" CAN node will be off so nothing on the bus will acknowledge the transmitted CAN frames of F446.
So you need:
1- The CAN transceiver (MCP2542) be powered on/off at the same time with the MCU. I cannot tell about the SI8621 circuit isolator.
2- Connect another CAN node configured only in listen mode (receive only). So when NMEA2000 is powered off, at least the frames sent from F446 will be acknowledged.
So in conclusion, you can't keep STM32F446 sending CAN messages while there is no other CAN node (you need at least one alive) on the bus acknowledging its frames.
Hope it's clear now.