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.

Compiler/TMS320F28069M: F28069M .bin file generation for Firmware Update

Part Number: TMS320F28069M

Tool/software: TI C/C++ Compiler

I am able to generate bin files for my project. But the size of .bin file is large and doesn't fit in the flash section.

I am attaching the linker cmd file

F28069Mcmd.txt
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
//###########################################################################
//
// FILE: F28069.cmd
//
// TITLE: Linker Command File For F28069 Device
//
//###########################################################################
// $TI Release: F2806x C/C++ Header Files and Peripheral Examples V135 $
// $Release Date: Sep 8, 2012 $
//###########################################################################
*/
/* ======================================================
// For Code Composer Studio V2.2 and later
// ---------------------------------------
// In addition to this memory linker command file,
// add the header linker command file directly to the project.
// The header linker command file is required to link the
// peripheral structures to the proper locations within
// the memory map.
//
// The header linker files are found in <base>\F2806x_headers\cmd
//
// For BIOS applications add: F2806x_Headers_BIOS.cmd
// For nonBIOS applications add: F2806x_Headers_nonBIOS.cmd
========================================================= */
/* ======================================================
// For Code Composer Studio prior to V2.2
// --------------------------------------
// 1) Use one of the following -l statements to include the
// header linker command file in the project. The header linker
// file is required to link the peripheral structures to the proper
// locations within the memory map */
/* Uncomment this line to include file only for non-BIOS applications */
/* -l F2806x_Headers_nonBIOS.cmd */
/* Uncomment this line to include file only for BIOS applications */
/* -l F2806x_Headers_BIOS.cmd */
/* 2) In your project add the path to <base>\F2806x_headers\cmd to the
library search path under project->build options, linker tab,
library search path (-i).
/*========================================================= */
/* Define the memory block start/length for the F2806x
PAGE 0 will be used to organize program sections
PAGE 1 will be used to organize data sections
Notes:
Memory blocks on F28069 are uniform (ie same
physical memory) in both PAGE 0 and PAGE 1.
That is the same memory region should not be
defined for both PAGE 0 and PAGE 1.
Doing so will result in corruption of program
and/or data.
Contiguous SARAM memory blocks can be combined
if required to create a larger memory block.
*/
MEMORY
{
PAGE 0 : /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
and the map file for motor_controller_map.txtreference.

Any help is appreciated.

Thanks

Nandini

  • Nandini,

    Sounds like there is not memory allocated for the Flash memory. You will need to allocate more memory to the flash sectors in the linker command file.

    Here's a document, http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking#Q:_The_linker_says_.22placement_fails_for_object_.27.text.27_.22._How_can_I_make_more_memory_available_for_.text.3F, that you can reference that can explain how to extend memory regions or have the compiler split the data across multiple regions.

    Regards,

    Ozino

  • Hi,

    I have allocated memory for flash. What I meant when I say .bin does not fit in the flash is that the generated bin file size is 138kilo byes. Where as my flash section is 128 kilobytes.  Please refer to the attached files for further information.

    Thanks

    Nandini

  • Hi Nandini,

    How are you generating the bin file? Are you converting from a typical .out file that CCS generates after compilation? If so, does programming / executing the original .out file work properly within CCS?

    Maybe it's OK that the bin file is larger than the device flash? That there is some overhead when programming the bin file to the device, i.e. 138 kb bin file doesn't directly correlate to 138 kb of flash space needed. Are you having issues when attempting to program the bin file to the device?

    I'm not an expert on generating / programming bin files, but this seems like it may make sense.

    Best,

    Kevin

  • Hello Kevin,

    I am generating bin files using the post-build steps.

    "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd2000" "${CG_TOOL_ROOT}/bin/hex2000" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin" 

    I have similar issue reported in this post. https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/807299?Compiler-TMS320F28069-generation-of-bin-file

    Also the bytes in the .bin file seems to be flipped as well (endianness issue). For example 0x20ab is written as 0x ab20 in my binary file.

    Any help is much appreciated 

    Thank you

    Nandini

  • I presume these lines from the linker command file represent all the flash memory in the system ...

       BL_FH       : origin = 0x3D8000, length = 0x004000     /* on-chip FLASH for bootloader*/
       CRC         : origin = 0x3DC000, length = 0x000100
       APP_FLASH   : origin = 0x3DC100, length = 0x01BE80     /* on-chip FLASH for application*/
       CSM_RSVD    : origin = 0x3F7F80, length = 0x000076     /* Part of FLASHA.  Program with all 0x0000 when CSM is in use. */
       BEGIN       : origin = 0x3F7FF6, length = 0x000002     /* Part of FLASHA.  Used for "boot to Flash" bootloader mode. */
       CSM_PWL_P0  : origin = 0x3F7FF8, length = 0x000008     /* Part of FLASHA.  CSM password locations in FLASHA */
    

    That adds up to 0x20000.  Expressed in decimal that's 131, 072.  Keep in mind all these lengths are for 16-bit words.  Expressed as 8-bit bytes, that's 262,144 bytes, or 256 kilobytes.  This does not match with your statement ...

    Nandini Shankaraiah said:
    Where as my flash section is 128 kilobytes.

    Please explain this difference.

    Thanks and regards,

    -George

  • Please reply to my previous post.

    Thanks and regards,

    -George

  • Hello George,

    Sorry for my delayed reply. Thank you for clarifying that words are 16-bit length. I now understand that my application bin file size is within size of my flash section( 256 kb)

    Thanks

    Nandini