moonglow / pcan_cantact Goto Github PK
View Code? Open in Web Editor NEW:robot: XCAN firmware for CANtact ( CANable ) or any other similar boards.
License: Do What The F*ck You Want To Public License
:robot: XCAN firmware for CANtact ( CANable ) or any other similar boards.
License: Do What The F*ck You Want To Public License
hello, Moonglow
Do you have some documents about PCAN protocol introduction? it's difficult for me to understand the "pcan protocol.c".
Thanks you very much!
Best Regards!
Hello. I have been using your device for a long time. I just want to clarify if you have implemented the j2534 mode? For some reason I was unable to use j2534.
Hi i'm trying use an Ollie USB-can device. https://github.com/slimelec/ollie-hw
They provide a forked version of your PCAN firmware. i have tried both your version and their provided version.
the device is recognized as the pcan adapter in device manager.
but no traffic can be sent or received.
If i unplug the usb cable and plug it back in data is received for between 100-200ms then stops. no errors are present in the PCAN software.
have you run into any similar issues?
Cool project !
I took about 15 minutes to port it to my F042 board, seems to be working so far.
Looking through the code :
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB|RCC_PERIPHCLK_I2C1;
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);
We can probably remove everything related to I2C ? Unless there's a non-obvious usage that I missed...
make BOARD=canable DEBUG=0 OPT=-Os elf hex bin make[1]: Entering directory '/home/kadir/Downloads/pcan_cantact-master' mkdir build-canable arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/main.d" -Wa,-a,-ad,-alms=build-canable/main.lst Src/main.c -o build-canable/main.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/usbd_conf.d" -Wa,-a,-ad,-alms=build-canable/usbd_conf.lst Src/usbd_conf.c -o build-canable/usbd_conf.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/usbd_desc.d" -Wa,-a,-ad,-alms=build-canable/usbd_desc.lst Src/usbd_desc.c -o build-canable/usbd_desc.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/pcan_usb.d" -Wa,-a,-ad,-alms=build-canable/pcan_usb.lst Src/pcan_usb.c -o build-canable/pcan_usb.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/pcan_can.d" -Wa,-a,-ad,-alms=build-canable/pcan_can.lst Src/pcan_can.c -o build-canable/pcan_can.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/pcan_led.d" -Wa,-a,-ad,-alms=build-canable/pcan_led.lst Src/pcan_led.c -o build-canable/pcan_led.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/pcan_protocol.d" -Wa,-a,-ad,-alms=build-canable/pcan_protocol.lst Src/pcan_protocol.c -o build-canable/pcan_protocol.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/pcan_timestamp.d" -Wa,-a,-ad,-alms=build-canable/pcan_timestamp.lst Src/pcan_timestamp.c -o build-canable/pcan_timestamp.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/system_stm32f0xx.d" -Wa,-a,-ad,-alms=build-canable/system_stm32f0xx.lst Src/system_stm32f0xx.c -o build-canable/system_stm32f0xx.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_ll_usb.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_ll_usb.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_ll_usb.c -o build-canable/stm32f0xx_ll_usb.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_pcd.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_pcd.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd.c -o build-canable/stm32f0xx_hal_pcd.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_pcd_ex.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_pcd_ex.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_pcd_ex.c -o build-canable/stm32f0xx_hal_pcd_ex.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_rcc.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_rcc.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c -o build-canable/stm32f0xx_hal_rcc.o Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c: In function 'HAL_RCC_MCOConfig': Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc.c:1018:33: warning: unused parameter 'RCC_MCOx' [-Wunused-parameter] 1018 | void HAL_RCC_MCOConfig(uint32_t RCC_MCOx, uint32_t RCC_MCOSource, uint32_t RCC_MCODiv) | ~~~~~~~~~^~~~~~~~ arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_rcc_ex.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_rcc_ex.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_rcc_ex.c -o build-canable/stm32f0xx_hal_rcc_ex.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal.c -o build-canable/stm32f0xx_hal.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_gpio.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_gpio.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_gpio.c -o build-canable/stm32f0xx_hal_gpio.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_cortex.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_cortex.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c -o build-canable/stm32f0xx_hal_cortex.o Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c: In function 'HAL_NVIC_SetPriority': Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_cortex.c:136:78: warning: unused parameter 'SubPriority' [-Wunused-parameter] 136 | void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority) | ~~~~~~~~~^~~~~~~~~~~ arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/stm32f0xx_hal_can.d" -Wa,-a,-ad,-alms=build-canable/stm32f0xx_hal_can.lst Drivers/STM32F0xx_HAL_Driver/Src/stm32f0xx_hal_can.c -o build-canable/stm32f0xx_hal_can.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/usbd_core.d" -Wa,-a,-ad,-alms=build-canable/usbd_core.lst Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c -o build-canable/usbd_core.o arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/usbd_ctlreq.d" -Wa,-a,-ad,-alms=build-canable/usbd_ctlreq.lst Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c -o build-canable/usbd_ctlreq.o Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c: In function 'USBD_CtlError': Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ctlreq.c:853:42: warning: unused parameter 'req' [-Wunused-parameter] 853 | USBD_SetupReqTypedef *req) | ~~~~~~~~~~~~~~~~~~~~~~^~~ arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/usbd_ioreq.d" -Wa,-a,-ad,-alms=build-canable/usbd_ioreq.lst Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_ioreq.c -o build-canable/usbd_ioreq.o arm-none-eabi-gcc -x assembler-with-cpp -c -mcpu=cortex-m0 -mthumb -DUSE_HAL_DRIVER -DSTM32F042x6 -DNDEBUG -ISrc -IDrivers/STM32F0xx_HAL_Driver/Inc -IMiddlewares/ST/STM32_USB_Device_Library/Core/Inc -IDrivers/CMSIS/Device/ST/STM32F0xx/Include -IDrivers/CMSIS/Include -Os -Wall -Wpedantic -Wextra -fno-common -fdata-sections -ffunction-sections -std=c99 -MMD -MP -MF"build-canable/startup_stm32f042x6.d" startup_stm32f042x6.s -o build-canable/startup_stm32f042x6.o arm-none-eabi-gcc build-canable/main.o build-canable/usbd_conf.o build-canable/usbd_desc.o build-canable/pcan_usb.o build-canable/pcan_can.o build-canable/pcan_led.o build-canable/pcan_protocol.o build-canable/pcan_timestamp.o build-canable/system_stm32f0xx.o build-canable/stm32f0xx_ll_usb.o build-canable/stm32f0xx_hal_pcd.o build-canable/stm32f0xx_hal_pcd_ex.o build-canable/stm32f0xx_hal_rcc.o build-canable/stm32f0xx_hal_rcc_ex.o build-canable/stm32f0xx_hal.o build-canable/stm32f0xx_hal_gpio.o build-canable/stm32f0xx_hal_cortex.o build-canable/stm32f0xx_hal_can.o build-canable/usbd_core.o build-canable/usbd_ctlreq.o build-canable/usbd_ioreq.o build-canable/startup_stm32f042x6.o -mcpu=cortex-m0 -mthumb -specs=nano.specs -TSTM32F042C6Tx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build-canable/pcan_canable_hw.map,--cref -Wl,--gc-sections -o build-canable/pcan_canable_hw.elf /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: build-canable/pcan_canable_hw.elf section
.data' will not fit in region FLASH' /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: region
FLASH' overflowed by 108 bytes
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:175: build-canable/pcan_canable_hw.elf] Error 1
make[1]: Leaving directory '/home/kadir/Downloads/pcan_cantact-master'
make: *** [Makefile:152: canable] Error 2
`
When I just type canable or cantact-16 Im getting this error. Im using ubuntu 20.04.3 64 bit intel i7-11370H and uname -r output : 5.11.0-40-generic
Is there any interest to support F103 since it's available while F042 availability is horrible at the moment?
I even have a tiny open source board with CAN and F103 if that would help :)
Due PEAK company request to remove copyrighted data from USB descriptor, i removed such data from my repo. Sorry but we must respect other companies.
Q: Firmware will works ?
A: By default firmware not works anymore with PEAK drivers. USB VID set to another value. Vendor/Product strings was changed too.
The latest version (V1.6) problem still exists, my hardware is canable, similar to the problem of killisch, it has not been repaired after flashing V1.6, and there is a problem with the cycle sending, and the cycle is unstable. Sorry for my bad english.
do we know if Korlan USB2CAN OBD2 would run official binaries?
А нет ли возможности и желания в эту же прошивку или в другую прошивку реализовать ELM327 протокол хоть в какой-то форме?
идея - хочется USB-CDC-Serial (т.е. без RS232 где либо в цепочке от ПК до устройства, ради нативной USB контроля и коррекции ошибок) адаптер в CAN. Есть ли такие решения?
ELM327 это как раз протокол
а stm32 это вариант USB-CDC-Serial без RS232
Hi. I installed canable firmware. It works. PCANView sees my hardware as PCAN. But there is an issue. After 10sec It is not blinking anymore. It can not transmit or receive data. Is this issue about new driver that PEAK systems released ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.