Electronics > Microcontrollers

J1939 firmware update - Parallel programming

(1/3) > >>

matb:
Bonjour everyone,
I have a project where I will have multiple devices wired on the same J1939 CanBus.
The microcontroller is not yet chosen but will be a Microchip one (either dsPIC33EP256MU806 or PIC18FxxK80 i guess).

I'm seeking advice from a bootloader point of view, what would be really cool (but I don't know if feasable and accepted in J1939 standard) is to be able to reprogram 1 or multiple devices at the same time with the on-board CanBus.
Have you guys did something like this before ? Is it a big no-no standard wise, do I have to unwire the device and do the updates out of bus ?
J1939 is using extended frames only so I guess I could use standard frames as to not make something run on other ECUs while I'm programming a device ?

Also seeking documents to better understand bootloaders as it will be the first one I ever build (and with no direct supervisor that can help except internet strangers ;)

darkspr1te:

--- Quote from: matb on June 21, 2022, 06:25:50 am ---Bonjour everyone,
I have a project where I will have multiple devices wired on the same J1939 CanBus.
The microcontroller is not yet chosen but will be a Microchip one (either dsPIC33EP256MU806 or PIC18FxxK80 i guess).

I'm seeking advice from a bootloader point of view, what would be really cool (but I don't know if feasable and accepted in J1939 standard) is to be able to reprogram 1 or multiple devices at the same time with the on-board CanBus.
Have you guys did something like this before ? Is it a big no-no standard wise, do I have to unwire the device and do the updates out of bus ?
J1939 is using extended frames only so I guess I could use standard frames as to not make something run on other ECUs while I'm programming a device ?

Also seeking documents to better understand bootloaders as it will be the first one I ever build (and with no direct supervisor that can help except internet strangers ;)

--- End quote ---
i've written many bootloaders from amiga to stm32fxxx and beyond. I've learnt that you dont always have to reinvent the wheel there are already bootloaders for both supporting CANBUS that can guide you, also writing a bootloader is a good tech-ercise as you learn how to setup the hardware to be in a position to function. this si where you learn all the bit-fields and subtle parts of the device.
I've not looked at the j1939 standard fully myself but i would assume there is a accepted mechanism for triggering a device firmware update for emissions updates , i know the j2435 standard does have it.



darkspr1te

matb:
Thanks for the reply.

--- Quote ---[...]I've learnt that you dont always have to reinvent the wheel there are already bootloaders for both supporting CANBUS that can guide you[...]
--- End quote ---

I looked but Google doesn't seem to yield any results, do you have links of exemples or alike. I guess this is very industry oriented so the hobbyist doesn't have "open source" exemples.
I found 2 application notes from Microchip AN247 http://www.t-es-t.hu/download/microchip/an247a.pdf and AN851 https://ww1.microchip.com/downloads/en/appnotes/00851b.pdf and some people mention EZBL https://www.microchip.com/SWLibraryWeb/product.aspx?product=Microchip%20Easy%20Bootloader but it seems to be discontinued for the Harmony code generator ?

I looked more deeply in the J1939 and there are Manufacturer identifiers so I guess I could use a couple of IDs there for each device on the network ? https://copperhilltech.com/blog/design-of-proprietary-parameter-group-numbers-pgns/

Jeroen3:
I made one. CAN bus is really slow to transfer lots of data. So I thought it was a good idea.
It was Meh, you transfer sector by sector and require an ack from each node. With enough devices >4 there was always one that missed a frame because you want high speed an non-ideal temporary bus wiring, and required a re-do of the sector.

Also, many CAN-USB devices can't do full bus speed. Had to buy and test a few, settled on kvaser eventually.

In the end it was Meh, wouldn't do it again. Just make it so you don't need to update the software that often.

Also if I recall correctly j1939 doesn't have an bootloader transfer protocol big enough for large images iirc. But you could use proprietary pgn's for that.

J1939 also has a limit on the repetition speed of messages, severely limiting how fast you can go.

NorthGuy:

--- Quote from: matb on June 21, 2022, 06:25:50 am ---I have a project where I will have multiple devices wired on the same J1939 CanBus.
The microcontroller is not yet chosen but will be a Microchip one (either dsPIC33EP256MU806 or PIC18FxxK80 i guess).

--- End quote ---

CAN bootloader is a very common thing.

You can use one of the newer dsPIC33CKxxxxx devices. They have CAN FD. They also can be partitioned - one partition runs, the other can be updated by the bootloader at the same time. Once updated, partitions can be swapped by hardware.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod