question

hardwic avatar image
hardwic asked

VenusOS 2.71 on Raspberry 3 B+ hangs

We have a hat with serial, mcp2515 and mcp3008 on a Pi 3B+ which hands on "Initializing entropy source hwrng"
Initially I thought it was bluetooth but disabling that does not solve the problem. If you disable mcp2515 in config.txt, it boot fine but obviously CAN in dysfunctional.
I really can't find any relation between hwrng and spi0.0, so I am a bit lost as to what is causing this.
If anyone has any suggestion or similar problem, your input would be appreciated.

Raspberry Pi
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

hardwic avatar image hardwic commented ·

So it turns out this is related to the mcp2515 interrupt. On the Pi 3b+ I have this wired to physical port 37 which is BCM pin 26 and GPIO 25 so the correct settings in config.txt in venus os 2.66 are:

"dtoverlay=mcp2515-can0:spi0-0-present=true,oscillator=16000000,interrupt=25"
You can then see the interrupt hits in /proc/interrupts:
IRQ CPU0 CPU1 CPU2 CPU3 Proc IO Edge Module

191: 756908386 0 0 0 pinctrl-bcm2835 25 Level mcp251x

However in os 2.71 using the GPIO pin number is causing the hang. Using the BCM pin seems to work:
166: 1284 0 0 0 pinctrl-bcm2835 26 Level mcp251x

This seems very odd.

0 Likes 0 ·
hardwic avatar image hardwic hardwic commented ·
waveshare documentation using BCM pin no. is simply wrong. The drive uses GPIO no.!!

So by setting interrupt=26, I was disabling interrupt.

The solution was to uninstall rng-tools but I have no idea why this is clashing with interrupt 25.

0 Likes 0 ·
1 Answer
vassilis-bourdakis avatar image
vassilis-bourdakis answered ·

sorry, definitely not an expert and not familiar with the error you metion, but is this HAT of yours one of the supported ones in:

https://github.com/victronenergy/venus/wiki/RaspberryPi-CAN-Interfaces

I'm asking as reading through that, and trying various tricks I managed to get the WAVESHARE I'd bought (the cheapest I could find at the time!) working just fine - wasn't straight forward though!

maybe some more info on the board/link to specs would help the knowledgeable ones to contribute

cheers


V.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

hardwic avatar image hardwic commented ·
The board is our own. It basically incorporates our smart energy controller into a Venus device. The CAN interface is based on MCP2515 CAN controller. If I don't load the drive in config.txt, the Pi boots. As far as I know hwrng (random number generator) has nothing to do this CAN. The system is not really hanging because it still accepts keyboard input but is stuck on hwrng waiting for something to complete not idea what.

The system was working without issue on 2.66 so my guess is it has something to do with Bluetooth. I have disabled that but no luck. MCP2515 also uses GPIO25 interrupt so maybe something to do with that.


0 Likes 0 ·
hardwic avatar image hardwic hardwic commented ·

V, your comment about WAVESHARE is interesting and lead me to the answer. I read on their site that they specifically use the BCM pin no.:

https://www.waveshare.com/wiki/2-CH_CAN_HAT
The kernel driver until 2.66 uses the GPIO pin. I wonder if this was not changed to accommodate waveshare?

0 Likes 0 ·