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

ESP32-S3 + MCP2518FD #43

Open
jblazeg opened this issue Nov 23, 2023 · 11 comments
Open

ESP32-S3 + MCP2518FD #43

jblazeg opened this issue Nov 23, 2023 · 11 comments

Comments

@jblazeg
Copy link

jblazeg commented Nov 23, 2023

Hi,

I use a custom board and I get "Configuration error 0x10000" - which means timeout initialising the SPI device.
Screenshot 2023-11-23 at 10 34 29

But when I disconnect the other can bus device (works - verified) it initializes correctly, but still doesnt send any data (CAN TX line is permanently high, also no CAN receive):
Screenshot 2023-11-23 at 10 52 08

Anything else I should capture or add files? CAN Select has a 10K pullup resistor. I use a 40MHz resonator with 22pF capacitors. Tansceiver is a TCAN332.

extract from the code:

SPIClass SPI2(HSPI);

const uint8_t SOFT_SCK_PIN  = 19;
const uint8_t SOFT_MISO_PIN = 20;
const uint8_t SOFT_MOSI_PIN = 21;
#define SELECT 17 
ACAN2517FD can2(SELECT, SPI2, 255)

setup() {

SPI2.begin(SOFT_SCK_PIN,SOFT_MISO_PIN,SOFT_MOSI_PIN);
SPI2.setFrequency(5000000);

ACAN2517FDSettings settings (ACAN2517FDSettings::OSC_40MHz_DIVIDED_BY_2, 125 * 1000, DataBitRateFactor::x4) ;
settings.mRequestedMode = ACAN2517FDSettings::NormalFD; 

const uint32_t errorCode = can2.begin (settings, NULL) ;
}

Cheers

@pierremolinaro
Copy link
Owner

pierremolinaro commented Nov 27, 2023 via email

@jblazeg
Copy link
Author

jblazeg commented Nov 27, 2023

Yes, the behaviour is different. With can bus traffic, the chip does not initialise. But it does not receive/send anything even if it initialises correctly.

Common ground is generally not needed for can bus (differential pair) but I tried with common ground and without - the problem is the same.

@VergilGao
Copy link

VergilGao commented Dec 26, 2023

hello, i got the same problem and sovled it just now.
292826674-9983767b-1e52-4fdd-bbd6-1708bc15df45
i use this board to learn canfd. and i notice the default setting of this board is:
if you use 3.3v voltage, you should provide another 5v voltage.
like this:
then it shou
292827157-59de0f5e-d702-44fe-ad2c-aac8634a0f45

ld work well.

@kukumagi
Copy link

kukumagi commented Feb 27, 2024

Could you provide working code example?
Thanks!

@pierremolinaro
Copy link
Owner

pierremolinaro commented Feb 28, 2024 via email

@kukumagi
Copy link

kukumagi commented Feb 28, 2024

I was stuck at frame structure. But already found it.

@VergilGao
Copy link

Your images are empty. There are several example codes in the library, don't they suit you? Pierre

Le 27 févr. 2024 à 20:19, kukumagi @.***> a écrit : https://private-user-images.githubusercontent.com/8655163/292826674-9983767b-1e52-4fdd-bbd6-1708bc15df45.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkwNjE3NzYsIm5iZiI6MTcwOTA2MTQ3NiwicGF0aCI6Ii84NjU1MTYzLzI5MjgyNjY3NC05OTgzNzY3Yi0xZTUyLTRmZGQtYmJkNi0xNzA4YmMxNWRmNDUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDIyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAyMjdUMTkxNzU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2M0N2QwOTVlMmY2NTA5M2FlYmQzOWY5NmE5OTFkYjA2ZTBkZWE0MGM0ZWZhYzc5MDFiNmZmZTlkNDZhNDcxOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.WVDUGY26JjZTb2-pTsz0u0ajsvrRTy6IkcmPSHZ_6SM hello, i got the same problem and sovled it just now. i use this board to learn canfd. and i notice the default setting of this board is: if you use 3.3v voltage, you should provide another 5v voltage. like this: https://private-user-images.githubusercontent.com/8655163/292827157-59de0f5e-d702-44fe-ad2c-aac8634a0f45.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDkwNjE3NzYsIm5iZiI6MTcwOTA2MTQ3NiwicGF0aCI6Ii84NjU1MTYzLzI5MjgyNzE1Ny01OWRlMGY1ZS1kNzAyLTQ0ZmUtYWQyYy1hYWM4NjM0YTBmNDUuanBnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDIyNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAyMjdUMTkxNzU2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YmQzMThiN2YxZjM1NzM5YjdlNWQwNmEyNDBkZjJjMjc2NjJjNWRiYjg0Y2M1YzQ0ZGU4ZmNhNTUwOWZjMWZhMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.QMPc5_xFygwuek1SEtfpPybBiFsmxD5J1m0_jbpyFII then it should work well. Could you provide working code example? Thanks! — Reply to this email directly, view it on GitHub <#43 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWKZVHNJ46OYRZOVQOP4UTYVYWSTAVCNFSM6AAAAAA7XP2LZOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRXGQZTINJRGU. You are receiving this because you commented.

could you see the images now?

@kukumagi
Copy link

kukumagi commented Mar 9, 2024

I am still having trouble with the MCP2518FD Pro board.
Sometimes I get configuration error 0x1
and other times I get Configuration error 0x80000

@kukumagi
Copy link

I have a problem with reading and transmitting. It wont start receiving. And the weirdest part is that if I disconnect 5v and then reconnect it somehow starts working. Do I have something wrong in my setup?

@kukumagi
Copy link

kukumagi commented May 4, 2024

I tried espressif 3.0.0-rc1 version and it works perfectly, but with version 2.x it simply does not start transmitting/receiving. Configuration works but no data comes in and unable to send frames.

@kukumagi
Copy link

I dont know why but calling canfd.poll() after begin() it starts working correctly
Eg:
const uint32_t errorCode = canfd.begin(settings, [] { canfd.isr(); });
canfd.poll();

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

4 participants