Hi.
I'm trying to use Timo's great NMEA2000 library on a STM32.
How do I specify which SPI port to use?
A bit more info would help! What hardware are you using? The only STM32 board supported by the library is the Maple from LeafLabs. That doesn't have a CAN hardware onboard so I guess you use some external hardware. Which CAN library are you using?
Also missing is the core you're using. As you have multiple SPI interfaces you probably use the Arduino STM32F4 core but that's wild guessing.
Sorry about that!
Im using a Bluepill, but changed the STM to a STM32F103CBT6 (more memory).
I'm using Visual Studio Code with PlatformIO - a ST-LINK for upload/debug, a MCP2515 as controller and MCP2542 for transceiver.
Libraries (Timo's):
N2kMsg.h
NMEA2000.h
mcp_can.h
NMEA2000_mcp.h
N2kMessages.h
The micro should have 2xSPI, but I can't find info how to use SPI2
Just tell me if you need more information.....
No support for that platform from me, my answers will always be for the Arduino IDE. Your IDE might be compatible enough but that's your problem.
The mcp_can library allows to set the SPI interface by calling setSPI(). The NMEA2000_mcp library also has a method SetSPI() to set the interface class.
As you didn't specify which core you use I cannot help you how to get the correct interface class.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.