Other Parts Discussed in Thread: CONTROLSUITE
Tool/software: Code Composer Studio
Hi
I am in a process of developing , or we can call it continues integration of the F2806X boot loader. ( actually it is 28065)
I will described the steps I understood to get the SCI bootloader and then my understanding about the SPI bootloader.
If one can comment and add his thoughts. i did not started yet.
I am planning do use CCS to load the flash_f28069 example from controlSuite: C:\TI\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5
This is the only example that work from flash. all ~20 examples are working from RAM.
if i understand correct, working from RAM means that when i load the firmware using JTAG , next time i will do power cycle it will need to be download again, where
working from flash, it means that the application\firmware will burned in flash and even if i do power cycle i can just power on and the application\firmware will run.
If so , going to SCI boot loader,
I need to:
1. compile the f28069_flash_kernel example (C:\TI\controlSUITE\device_support\f2806x\v151\F2806x_examples_ccsv5\f28069_flash_kernel)
This example is already in SCI ( the SCI_boot.c) is in the project.
perform hex2000 on the output to get the hex file
2. perform hex2000 on the example flash_f28069
When i have those two hex file , I will need to do the make GPIO 34( make it 0) and GPIO 37 ( make it 1) in GPIOB
as it shown in the bootrom sources:
BootMode = GpioDataRegs.GPBDAT.bit.GPIO37 << 1;
BootMode |= GpioDataRegs.GPBDAT.bit.GPIO34;
Power cycle the board and then the bootloader will wait for the two files , which will be supplied using the flash_programmer command line tool:
serial_flash_programmer.exe -d f28065 -k flash_kernels_f28065.txt -a flash_28065.txt -p COM7 -b 9600
where the .txt file are the output from the hex2000 file.
Hitting 'a' will start the loading.
The original flash_28065 was already loaded using JTAG and now it will be replaced by the serial_flash_programmer?
And to conclude, this is the bootloading procedure.
please confirm the above steps.
Now going to SPI bootloader.
This is not well documented , so please confirm my steps here.
I will replace the SCI_boot.c file from the flash_kernel_f28065 project with the SPI_Boot.c that i found in a project called bootrom for f2806x.
if i understand correct , the bootroom project does not need to be loaded and does not have a rule in this bootloading game , we just can use its sources to select which boot mode we want.
So after i replace the SCI_boot.c with SPI_boot.c , I will compile and create again with the help of hex2000 a txt file.
Now, i cannot use any more serial_flash_programmer, because it is working with SCI( Uart)
My goal is to do the firmware upgrade via SPI under Linux.
So next step is to understand the code of the serial flash programmer ( sources were given in visual studio) and to create a Linux C program ( using spi_dev interface) to do the same. ( if there is such a tool in SPI linux please let us know)
Once I will do so , I should have the bootloader work from SPI.
But , not before I will have to program the OTP at address:
#define Get_mode (Uint16 (*)(void))0x3D7CC0
to have value of 4 there ( SPI )
to do so, i read this thread https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/167270
which explain how to do that using the code it self. If there is a different method ( maybe using CCS and JTAG please let me know)
GPIO 34 and GPIO 37 need to be both 1.
and TRST need to be 0 in both SCI and SPI ( TRST is a gpio also ?)
What if i mistake in program the OTP to values of 4? do i need to throw away the chip because it is one time programming?
What if i want to do SCI bootloader and the SPI just to check?
If i understand correct , the logic of determine the bootmode ( GPIO and OTP) is already in the bootrom, and cannot be changed ??
First , thanks if you read it until here.
This long story of getting the bootloader to work in TI is not so easy as it should be.
If you see anything wrong , have something to comment please do, help me and many others out there.
Thanks!