Other Parts Discussed in Thread: TMS320F28335, C2000WARE
Dear sir of madam,
I have tried to make a custom adaptation to the serial_flash_programmer example of TI. This customization was transforming it into a flashprogrammer that works within our system by transmitting CAN messages in a special format that exists in our system. The result we are trying to achieve is making our driveline firmware remote updatable. Our driveline firmware runs on 2 TMS320F28069M processors on a custom board both connected to a single CAN connector for communication.
To give a better explanation of the system:
Our main motherboard is using a Intel atom processor. This motherboard is responsible for all the tasks in our robots. Between our motherboard and driveline PCB stands a STM controller which transforms the UART messages send by the Intel motherboard to a CAN message that can be used by our TMS320f28069M controllers on the driveline.
So for starting this project I have done some research and decided to make an adaptation of the serial_flash_programmer by making it into a can_flash_programmer. The goal is to make this software run on the Intel motherboard so that it can download the new firmware onto the driveline by sending the correct messages to our STM controller, which will then send it to our driveline. For this flash_programmer I have removed the first step in which the programmer downloads the flash kernel to the board. We have done this because we want the flash kernel to exist in our driveline firmware so that we dont have to put the board in CAN Boot Mode.
I have tested this concept by downloading the SCI flash kernel to the board using the debug probe. And after that running the serial_flash programmer from my laptop with a USB to UART bridge. This serial_flash_programmer was without the step that downloads the sci_flash_kernel and I have confirmed this works, on both our own PCB and the TMSDOCK28069 Dev Board.
After that I started changing the serial_flash_programmer to a can_flash_programmer. I did this by constructing a UART message in the way our STM controller understands that it is a CAN message which needs to be sent to the driveline board. Our message consists of a 4 byte header a 2 byte ID followed by 8 bytes of data finished with a checksum. The header and ID are constant variables and the checksum is calculated in the code itself. Since the CAN module on the F28069M reads 2 bytes at a time I have changed it as followed:|
TI's example serial_flash_programmer:
my own can_flash_programmer:![]()
This makes it read 2 bytes each time that will be used to construct the message by doing the following:![]()
This refers to the following function that constructs our message:
Then we want to write the message to the STM controller I do this by first constructing a bytearray in the following way:
And after that I run this writeFIle command:
since CAN does not use a checksum and reads 2 bytes at a time instead of 1 I have also changed the rest of the flash_programmer to the following, the code shown is the code starting form calling the writeFile from above:
I have also checked with realterm and cmd that everything constructs and sends like I expected it to be and using a PCAN viewer connected to my STM controller I can confirm it indeed sends the CAN messages.
This is an example of what I get:
CMD:
Note that the fd at the end here is the overflow which will never be sent to the STM controller
Realterm
PCAN Viewer:
This resembles the output of the STM controller, so this is the input from the TMS controller through the CAN connection.
But when I try to do this on de Dev Board or our own board (with the can_flash_kernel downloaded to it) it does not seem to work and I get no output. (I am simply trying to flash the Example_f2806xLEDBlink).
I hope I have provided you with enough information and hope you can help me with this, If anything is unclear please ask and I will provide the missing information.
Kind regards,
Guilliam

This is the signal we get on the Dev board.
This is the signal we get on the driveline board.
