Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE
Tool/software:
Hello,
I am using the TMS320F280049C MCU and want the device to implement LDFU through SCI. I have been reading related documentation: sprabv4, tiduey4d, spruiu8a, and also testing the provided design examples, in particular
..\C2000Ware_5_00_00_00\driverlib\f28004x\examples\flash\flashapi_ex2_XXXX
The method works, but it breaks down when one accidentally uploads a firmware intended for Bank0 when code is already running from Bank0 (same is true for Bank1). TIDUEY4D Section 4 comments on this also: “With this approach, the user needs to be aware of which Flash bank their firmware executable is targeted for. Thus, they need to maintain 2 linker command files for their project (if they are using 2 Flash banks). This can be cumbersome, so an alternate solution is proposed and implemented here.”
My preference is to avoid having to maintain 2 linker command files and the need for the host computer to keep track of what firmware is currently running (intended for Bank0 or Bank1). TIDUEY4D Section 4 describes an example using the F28003x, where “the firmware executable is always built to be Loaded to Flash Bank1 and Run from Flash Bank0. This can be done with just one linker command file. Similar to how functions in an application are Loaded to Flash and Run from RAM for performance improvement, a memory copy is needed here as well. This is implemented in the LFU bootloader i.e. Flash kernel.”
Question 1: Why bother with transferring the firmware to flash bank1 just to be transferred over to flash bank0? Would it not be simpler to write it flash bank0 to begin with?
This post makes a comment “Bank0 cannot update Bank0 - that would be a violation of Flash operation - you cannot erase/program from the same flash bank that you are executing (reading) from.”
Question 2: Is the above underlined statement actually true? If the LDFU firmware is running from Sector 1 (the liveDFU function is assigned to 0x81000 using the linker command file and the CODE_SECTION pragma), then why could it not erase and update sectors 2-15?
There are examples of LDFU using the F28002x, which only has one flash bank. In these examples it appears that LDFU is possible by making sure that the LDFU functions (ldfuLoad, ldfuCopyData, revInit, etc…) are running from RAM, and not flash using TI.ramfunc.
Question 3: Why is this not always done so? (Even in the case when there are multiple independent flash banks available…) Is there a disadvantage to setting up the DFU so that it runs from RAM?
Queston 4: What is the best source of information on using the TI.ramfunc for further reading?
Thank you,
Laszlo