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.

F28M35H52C: Clarity on Start address of C28 core of concerto

Part Number: F28M35H52C
Other Parts Discussed in Thread: CONTROLSUITE

Hi Guys.

I am working on developing a Custom Bootloader for C28 core on concerto and i have few things on which i need clarity.

1. What address does the C28 core jump to from its BOOT ROM stage ? 

2. For testing my Bootloader application i am using a simple Blinky C28 application. Now should i change the address where the reset_vector resides ? or should i just worry about where my "BEGIN" section resides which will call "codestart" function ? 

3. I have enabled HEX utility file for C28 which did generate the .hex file for me. But if i try to decode the first two rows of the file i get a initial start address as 0x00098000 which i dont understand ? As i had edited my blinky application linker script to start its BEGIN address from 0x0013A000 ? 

The first two rows:

:020000040009F1
:20800000761F76221A2400101A200001761F0003180000161800FFFD761FFFFECC00001062

PAGE 0 Memory description of blinky application

MEMORY
{
PAGE 0: /* Program Memory */
/* Memory (RAM/FLASH/OTP) blocks can be moved to PAGE1 for data allocation */
RAML0 : origin = 0x008000, length = 0x001000 /* on-chip RAM block L0 */
RAML1 : origin = 0x009000, length = 0x001000 /* on-chip RAM block L1 */

FLASHN : origin = 0x100000, length = 0x002000 /* on-chip FLASH */
FLASHM : origin = 0x102000, length = 0x002000 /* on-chip FLASH */
FLASHL : origin = 0x104000, length = 0x002000 /* on-chip FLASH */
FLASHK : origin = 0x106000, length = 0x002000 /* on-chip FLASH */
FLASHJ : origin = 0x108000, length = 0x008000 /* on-chip FLASH */
FLASHI : origin = 0x110000, length = 0x008000 /* on-chip FLASH */
FLASHH : origin = 0x118000, length = 0x008000 /* on-chip FLASH */
FLASHG : origin = 0x120000, length = 0x008000 /* on-chip FLASH */
FLASHF : origin = 0x128000, length = 0x008000 /* on-chip FLASH */
FLASHE : origin = 0x130000, length = 0x008000 /* on-chip FLASH */
FLASHD : origin = 0x138000, length = 0x002000 /* on-chip FLASH */
//CSM_PWL_P0 : origin = 0x139FF8, length = 0x000008
//ECSL_PWL_P0 : origin = 0x139FFC, length = 0x000004
//FLASH_EXE_ONLY_P0 : origin = 0x139FFE, length = 0x000002
BEGIN : origin = 0x13A000, length = 0x002000
/*FLASHC : origin = 0x13A000, length = 0x002000 /* on-chip FLASH */
/*FLASHA : origin = 0x13E000, length = 0x001F80 /* on-chip FLASH */

/*CSM_RSVD : origin = 0x13FF80, length = 0x000070*/ /* Part of FLASHA. Program with all 0x0000 when CSM is in use. */
/*BEGIN : origin = 0x13FFF0, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
/*FLASH_EXE_ONLY_P0 : origin = 0x13FFF2, length = 0x000002 /* Part of FLASHA. Flash execute only locations in FLASHA */
/*ECSL_PWL_P0 : origin = 0x13FFF4, length = 0x000004 /* Part of FLASHA. ECSL password locations in FLASHA */
/*CSM_PWL_P0 : origin = 0x13FFF8, length = 0x000008 /* Part of FLASHA. CSM password locations in FLASHA */

FPUTABLES : origin = 0x3FD258, length = 0x0006A0 /* FPU Tables in Boot ROM */
IQTABLES : origin = 0x3FD8F8, length = 0x000B50 /* IQ Math Tables in Boot ROM */
IQTABLES2 : origin = 0x3FE448, length = 0x00008C /* IQ Math Tables in Boot ROM */
IQTABLES3 : origin = 0x3FE4D4, length = 0x0000AA /* IQ Math Tables in Boot ROM */

BOOTROM : origin = 0x3FEDA8, length = 0x001200 /* Boot ROM */
PIEMISHNDLR : origin = 0x3FFFBE, length = 0x000002 /* part of boot ROM */
RESET : origin = 0x3FFFC0, length = 0x000002 /* part of boot ROM */
VECTORS : origin = 0x3FFFC2, length = 0x00003E /* part of boot ROM */

https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/Hex-and-cmd-files.7z

4. Lastly i read that C28 memory is not Byte addressable like ARM architecture, whats the best suggested solution if i have requirement to store and concatenate char variables ? An ex below 

Ex:    

union
{
      Uint32 Val;
       struct{
                    Uint8 FIRSTB;

                    Uint8 SECONDB;

                    Uint8 THIRDB;

                    Uint8 FOURTHB;

           
                }byte;
}Address;

If i try to write some value to THIRDB and FOURTHB this does not get any effect on Val variable ? 

Thanks

  • Preetham,

    Thanks for reaching out to the E2E, answers below:

    1. What address does the C28 core jump to from its BOOT ROM stage ? 

    A1)The C28x will first auto-execute some system init functions and then boot based on the contents of the MTOCIPCBOOTMODE register; Flash, RAM, SCI, SPI, I2C, Parallel  Please see http://www.ti.com/lit/ug/spruh22h/spruh22h.pdf starting at page 576 for the complete process/details

    2. For testing my Bootloader application i am using a simple Blinky C28 application. Now should i change the address where the reset_vector resides ? or should i just worry about where my "BEGIN" section resides which will call "codestart" function ? 

    A2)This will become more clear after reading the above sections, but in a nutshell you'll end up placing this code at either the Flash entry point(0x13FFF0) or Ram entry point(0x000000) depending on the option you choose

    3. I have enabled HEX utility file for C28 which did generate the .hex file for me. But if i try to decode the first two rows of the file i get a initial start address as 0x00098000 which i dont understand ? As i had edited my blinky application linker script to start its BEGIN address from 0x0013A000 ? 

    A3)I assume you are starting with the example located here: C:\ti\controlSUITE\device_support\f28m35x\v220\F28M35x_examples_Dual\blinky\c28, I noted that this project is generating a .map file as part of its linking options.  You can review this file(just a txt file) to show where the different portions of code are going to.  Also, while the load address may be 0x13xxxx note that the run address can be different, i.e. loaded to flash but the copied and executed from RAM in the case of this example.

    Best,

    Matthew

  • Hi Matthew,

    Thanks for your timely response. I will go through the reference manual which i feel could give me some more details for the first three questions. 

    But could you suggest something or point me to some ref documents which could answer my fourth question ? 

    Thanks

  • Matt,

    Following your answer for question 3, i did some quick glance inside the .map file and compared it with the linker script file i use (script file attached in my first post) and noticed that "code_start" is the first symbol on C28 user gets to define where it should start from. In my case it resides at address 0x0013A000 which i same as what i have set in my linker script.

    However there are some symbols which start at some RAM address like "_InitFlash" runs from 0x00008000. Now how do i know if a part of start up code is copied to RAM and executed from there ? Because looking inside the source code i do not see any file which copies the code section to a RAM memory ? Could you through some insight for me on how i could debug if there is really some code that resides at address 0x00098000 ?
    Because i also debugged this blinky application tried to look inside the memory view for address 0x00098000 and nothing resides here so how is that my generated .hex file captured this address ?
  • Matt,

    Some update:

    To generate a .hex file i had enabled Hex utility tool and used some flags "--memwidth=32 --romwidth=32 --intel" but now i changed it to
    --memwidth=16 --romwidth=16 --intel , now looking at my .hex file makes more sense.