Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can.tryToSend crashes when using rpi pico, with offical mbed rp2040 core #35

Open
david284 opened this issue Mar 30, 2022 · 2 comments
Open

Comments

@david284
Copy link

I have a raspberry pi pico, using Arduino official mbed rp2040 core
framework-arduino-mbed 2.6.1
tool-rp2040tools 1.0.2
When I test the 'generic' LoopBackDemo sketch, my pico crashes on the can.tryToSend call and the LED blinks 4 short and 4 long and repeat.
(the "LoopBackDemoRaspberryPiPico" doesn't compile with the offical mbed core, it seems to use other 'SPI' commands)

The "Configure ACAN2515" section runs fine and prints out the expected results (attached below)

So, I'm assuming the SPI is talking to the MCP2515 just fine?

If I comment out the can.tryToSend (with a true return) the loop runs fine

I saw a similar previous issue here but that crashed at can.begin(), which isn't my issue (my code runs past this command), so although I tried their work around, not surprisingly it didn't help
`
Any idea what I could try or what to look at to resolve this?

Bit Rate prescaler: 4
Propagation Segment: 5
Phase segment 1: 5
Phase segment 2: 5
SJW: 4
Triple Sampling: yes
Actual bit rate: 125000 bit/s
Exact bit rate ? yes
Sample point: 62%
`

@pierremolinaro
Copy link
Owner

pierremolinaro commented Apr 4, 2022 via email

@david284
Copy link
Author

david284 commented Apr 4, 2022

I forgot to mention that I had to change the SPI pin assignments to match the 'default' SPI0 pins in the arduino header file in version 2.6.1, to get the SPI comms working at all

I've now changed to using the Earle F. Philhower core, and it's working fine, but obviously it takes more work to change to that core - although that does seem a much better core, with support for more of the features of the rp2040, like the ability to re-define pins and potentially the ability to use the 2nd core (not tried that yet though)
It's best to share that this library doesn't currently work with the standard rp2040 core (I suspect because of limitations in the standard core, not the library), and you'll have to use the alternative core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants