@juha.kauppi I haven’t worked with that specific hat, but waveshare used to sell one based on the mcp2517fd. Seeedstudio sells a 2 channel mcp2518fd based can hat and they also have an excellent driver for the nano, which also happens to work with the waveshare mcp2517fd hat. I suggest switching to the seeedstudio canfd hat if you can. The driver builds and installs and just works. I have two of them and they work perfectly with both the nano and raspi. Or use the waveshare canfd hat if you can find one, with the seedstudio driver.
CANFD is the latest version of the CAN spec. It is much faster and supports larger packets. However the mcp251xfd chips from microchip are fully backward compatible, so if you actually need classic can, these will work nicely there too.