This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TMS320F28333
A user wants to make a single project that will run on both F28335 and F28333. They want the software to determine needed settings at runtime using the PARTID register. An issue is the flash API library. They would like to incorporate both libraries into the project and decide which to use at runtime.
I think this is possible, but need confirmation.
First thing they need to do is call the specific top-level device functions instead of the #define common name functions. For example, call Flash28333_Erase() instead of Flash_Erase(). The top-level functions are all listed in the Flash2833x_API_Library.h file. For example:
#if FLASH_F28333#define Flash_Erase(a,b) Flash28333_Erase(a,b)#define Flash_Program(a,b,c,d) Flash28333_Program(a,b,c,d)#define Flash_Verify(a,b,c,d) Flash28333_Verify(a,b,c,d)#define Flash_ToggleTest(a,b) Flash28333_ToggleTest(a,b)#define Flash_DepRecover() Flash28333_DepRecover()#define Flash_APIVersionHex() Flash28333_APIVersionHex()#define Flash_APIVersion() Flash28333_APIVersion()#endif
Second, the top level functions however call sub-functions that have the same name in both the F28333 and F28335 library. These show up in the .map file when you build the project. For example:_Fl28x_ClearLoop_Fl28x_ClosePulse_Fl28x_CompactPulse_Fl28x_CompactVerify_Fl28x_Delay_Fl28x_DisableInt_Fl28x_DisableNMI_Fl28x_EnterCmdMode_Fl28x_ErasePulse_Fl28x_EraseVerify_Fl28x_FlashRegSleep_Fl28x_LeaveCmdMode_Fl28x_MaskAll_Fl28x_OpenPulse_Fl28x_ProgPulse_Fl28x_ProgVerify_Fl28x_RestoreInt_Fl28x_WatchDogDisable
These will get pulled in from whichever library (F28335 or F28333) is linked in first in the project.
QUESTION: Are these functions the same in both libraries? I think so.
Lastly, CPU_RATE is #defined Flash2833x_API_Config.h. I assume this must get passed under the hood as a parameter to one or more of the sub-functions above (e.g. _FL28x_Delay), as the API libraries are already compiled and the user doesn't ever touch CPU_RATE other than the #define. The user will not be able to change CPU_RATE at runtime. To get around this, they would need to have both devices running at the same speed during flash programming. For example, assuming a 30 MHz CLKIN for F28335 and a 20 MHz CLKIN for F28333, they could operate at 60 MHz for both during flash operations. Hence, CPU_RATE would be set for 60 MHz.
Added 4/18/17 1031AM: Correction! It looks like CPU_RATE is used to calculate SCALE_FACTOR, and then scale factor is assigned to a variable by the user:
Flash_CPUScaleFactor = SCALE_FACTOR; // Initialize Flash API clock rate scaling
So, the user could modify so that he has SCALE_FACTOR_28335 and SCALE_FACTOR_28333 and assign the correct one at runtime. No need to run both devices at the same speed.
Can someone confirm my thinking?
-----------------------------David M. AlterSenior Member Technical StaffTexas Instruments Inc.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Cody Watkins:
I ran some tests and am confident what I described will work provided the low-level API functions are the same in both libraries (and I would think they are). Specifically:
I'm not certain the list above is exhaustive. I just pulled this from the .map file of my test case. I was able to program a F28335 using the low-level functions in the F28333 API library by including both libraries in the build and specifying a link order to force the functions to be pulled from the F28333 library. The functions above the low-level functions have device specific names that can be called, so they get pulled from the correct library. It worked with no issues.
So, just need confirmation on the low-level functions being device non-specific within the F2833x family.
In reply to David M. Alter:
Yes, these low level functions aren't device specific.
If a post answers your question, please mark it with the "verify answer" button.
Other useful links:
C2000 Getting Started C2000 Flash Common Issues/FAQs Emulation FAQ
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.