View previous topic :: View next topic |
Author |
Message |
Spinitalia
Joined: 24 Apr 2025 Posts: 4
|
CAN-BUS bootloader |
Posted: Thu Apr 24, 2025 8:16 am |
|
|
Hello to everyone
I would like try to use the bootloader for CAN-BUS following the "ex-bootload_can.c" example.
but i don't see any host application for pc to perform the download as the "ccsbootloader.exe" for serial bootloader.
Did anyone had the same problem and found a solution?
thanks
Andrea |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19803
|
|
Posted: Thu Apr 24, 2025 9:49 am |
|
|
You'd have to look at what drivers are available for the Can host interface
that you intend to use. Many are devices like ethernet to Can, and some of
these do have basic emulator software to offer host operation. There are
some embedded PC boards that have Can built in, and these again normally
come with supplied software to give host operation.
Many of the simpler USB to Can interfaces are designed to support Can
monitoring, rather than host operation. There are performance issues with
these if doing much as a host.
Look at PCan for a USB interface that works better than most.
Look at CANoe, and CANtool, which are PC packages that can operate
as a host, |
|
 |
Spinitalia
Joined: 24 Apr 2025 Posts: 4
|
|
Posted: Sat Apr 26, 2025 1:35 pm |
|
|
Maybe I explained myself badly and I apologize for this.
I have my own board with a PIC18F46k80 with its own firmware now tried and tested, as a hardware interface for my PC I use the PCAN-USB from PEAK-System with Windows S.O..
What I would like to do now is to update the firmware via bootloader on CAN-BUS.
I found the example on how to implement the bootloader in my Firmware "ex-bootload_can.c" but I have not understood how to upload it to the board.
For the serial bootloader CCS provides the software "ccsbootloader.exe" but in the case of the CAN-BUS interface there is nothing? |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19803
|
|
Posted: Sun Apr 27, 2025 10:24 am |
|
|
The problem is that there is no standard for CAN on the PC.
Hence no example or driver program is possible, You have to work
our for yourself how to send the ,hex file. Talk to Peak. tell them what
you want, They may well be able to tell you how to do this.
I know you can do this with the Python language and the CAN driver,
but not if there is any 'non programmer' way of doing this using the Peak
software. |
|
 |
Spinitalia
Joined: 24 Apr 2025 Posts: 4
|
|
Posted: Mon Apr 28, 2025 7:41 am |
|
|
OK thank you,
I thought there was an example of working software to do the tests, even at the cost of using a specific usb-can adapter such as the one from PEAK-SYSTEM or buy a specific CCS tool kit.
it also means that the "ex-bootload_can.c" has not been tested and could be wrong.
in these case if the software needs to be developed, the debugging process becomes too expensive, not knowing where the problem could be, in the firmware or in the software |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19803
|
|
Posted: Mon Apr 28, 2025 10:25 pm |
|
|
No. It is not actually hard to drive this. If you look it is based upon small
packets sent to the node (since CAN does not support a large block transfer).
I have used it OK, but this from a dedicated CAN host, not from a PC.
Why not ask CCS directly?. They will have almost certainly run a basic
test. I'd suspect possibly using something like a Python interpreter,
and might well be prepared to let you see the code for this.
Also I think you will find the CCS code is actually based on the
Microchip stuff. Look at their notes on this:
[url]
https://onlinedocs.microchip.com/oxy/GUID-01550518-F422-4FC7-868D-94A3814200C0-en-US-1/GUID-1CCA02F4-4DEA-487C-80E5-F67DBA68E20F.html
[/url] |
|
 |
Spinitalia
Joined: 24 Apr 2025 Posts: 4
|
|
Posted: Tue Apr 29, 2025 6:19 am |
|
|
I actually thought that by writing on the forum someone from CCS would have answered, I also checked the online shop for the kits they sell just to find something ready to start from |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9462 Location: Greensville,Ontario
|
|
Posted: Tue Apr 29, 2025 7:07 am |
|
|
CCS does NOT monitor this forum as posted in upper right of screen.
They do though answer Emails, usually pretty darn fast considering the number of products they sell and have to update as new PICs seem to come out daily !!
As Mr. T points out it's not the PIC side, rather the PC side you need to create code for. Curious to know if any of the 'terminal' programs have a CANbus option ? |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19803
|
|
Posted: Tue Apr 29, 2025 10:19 am |
|
|
It's in the header at the top of the forum that they do not monitor here.
Historically Darren did, but he no longer does.
The problem is that since Canbus does not support a large block transfer,
you actually have to split the data up into small packets and send these
to the device. Microchip do offer a program to do this. I simply wrote this
into the code for the master I was using. If you look at the CCS stuff
it shows the packet format needed, |
|
 |
|