pcan_pro_x icon indicating copy to clipboard operation
pcan_pro_x copied to clipboard

LIN protocol implemetation

Open moonglow opened this issue 3 years ago • 10 comments

TODO: LIN protocol implementation stubs, internal message table, internal message scheduler logic

moonglow avatar Feb 08 '21 13:02 moonglow

Do you want to enhance the FW with also LIN implementation? If yes, which pins will be used? I ask because I'm thinking to develop a PCB for the CAN adapter

eliocor avatar Feb 08 '21 13:02 eliocor

Do you want to enhance the FW with also LIN implementation?

Yep, I think i will use uart1/uart2 and some pins to do master/slave stuff and so on,it currently in my TODO list only, maybe something be changes in future

moonglow avatar Feb 08 '21 13:02 moonglow

  1. Is there any reference schematics (with LIN interface) compatible with the Peak HW?
  2. for CAN FD support, will you ever port the FW to one of this series (STM32G0/STM32G4/STM32H7/STM32L5) which have FD available?
  3. if needed I can develop a prototype board using a microcontroller compatible to point 2). The project will be available to everyone

eliocor avatar Feb 08 '21 16:02 eliocor

STM32G4 is a good choose for CAN FD support.

Linjieqiang avatar Feb 08 '21 16:02 Linjieqiang

OK for the G4 model. Other than:

  • 2x CAN FD
  • 2x LIN (with Master mode Enable each one)
  • 1x USB FS
  • Tag-connect for debugging purpose
  • some LEDs for diagnostics
  • EEPROM for settings (or FLASH in EEPROM emulation?
  • do not think galvanic insulation should be a needed requirement for the first prototype

are there some other requirements?


Is there any way I can directly contact you?

eliocor avatar Feb 08 '21 17:02 eliocor

@eliocor

Is there any reference schematics (with LIN interface) compatible with the Peak HW?

Nope, firstly i want to implements all protocol specific thing, hardware realisation it is most easiest part i think, i will add information about it after i finish software part.

for CAN FD support, will you ever port the FW to one of this series (STM32G0/STM32G4/STM32H7/STM32L5) which have FD available?

I already answered to @Linjieqiang for this question, my main goal is CAN-adapter what can be easy to reproduce and works well with Linux and Windows including professional software. Software support is most important thing for such device, that's why i made this project. About FDCAN part, all protocol related thing already implemented and well tested on real hardware, so where is no problem to port it on G series or any other what support FDCAN, but it possible only for custom solution.

if needed I can develop a prototype board using a microcontroller compatible to point

It is good idea, but main disadvantage it is more expensive and required more skill to use it ( soldering, components buying, PCB manufacturing and etc )

Is there any way I can directly contact you?

You can live your e-mail here and i will contact to you, also my profile has public available e-mail too ( i think it must be visible for all registered users )

moonglow avatar Feb 08 '21 19:02 moonglow

@eliocor

  • 1x USB FS

Dual-channel CAN FD up to 24 Mbit/s, it needs a USB HiSpeed interface.

dreampet avatar Feb 09 '21 00:02 dreampet

You are right: microcontroller MUST be in the STM32H7xx line...

eliocor avatar Feb 09 '21 00:02 eliocor

@dreampet

Dual-channel CAN FD up to 24 Mbit/s, it needs a USB HiSpeed interface.

Only in theory, actually FDCAN has slow and fast part of frame + some frame overhead bit + bit stuffing and in real life application you never has non stop bit-stream on 12Mbit speed ( so real speed is slower ), another thing what USB FS 12Mbit is not really 12Mbit too, it is speed of single packet ( MAX is 64byte for FS ) what will transfer from one point to another, and to archive maximum speed we need transfer continuous transfer of data what can't be reached in real application too. Also we have some protocol level overhead... I think for real life application if you use 1 channel it be OK in most cases on hi speed FDCAN buses too.

p.s: i also read your amobbs forum thread, thanx it makes this project very popular ^_^

@eliocor

You are right: microcontroller MUST be in the STM32H7xx line...

You can use also external HS phy for USB as example USB3300, but you must also use external CAN controllers ( as example mcp1517/18 ) becouse ST can't be configured to use HS USB and two CAN on STM32F series.... you no need to use powerfull MCU to do this, but fast USB is good point for 2/4/6 FDCAN channels and other features

moonglow avatar Feb 09 '21 08:02 moonglow

Implemented here: branch, with some issue described here: #5

moonglow avatar Feb 17 '21 07:02 moonglow