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.

TMS320F28377D: FLASH A HEX FILE(CODE) TO MICROCONTROLLER AND MAP THE PROGRAM COUNTER

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Hello,

I am currently working with TMS320F28377D.

I am using FLASH API to load a application hex data to the flash memory from SECTOR C on wards. (For e.g. : uploading a led blinking program's hex data)

Current design :

FLASH API : Flash Sector A and B would contain code of flash api.

APPLICATION CODE : Flash Sector C on wards would be written with the Intel 16 bit Hex data (which shall be sent serially) using the Flash API.

My questions :

1. After completing the application code flashing, how do I map the execution from the FLASH API to the Address of my application code(preferably Sector C start address : 0x00084000) ?

2. Can I access any global flags/memory/registers for co-ordination among the FLASH API and the APPLICATION Code (I would only need 1 bit storage) ?

Thanks,

Sayali

  • Sayali,

    Thank you for reaching us on this.

    We will look in to this and get back to you in a day or two.

    Thanks and regards,
    Vamsi

  • Sayali,

    1. You can design your bootloader (that uses Flash API to program the image) to jump to the application entry-point. 

    2. You can reserve some Flash or RAM locations for that.  

    Thanks and regards,
    Vamsi

  • Sir,

    Could you please suggest reference  :

    1.  Instructions / process to jump from application code to bootloader and vice-versa.

    2. Regarding the entry point : 

    I have the application code in  hex format, and shall be flashing it from address 0x84000 (Sector-C start). 

    My question : Should the PC jump to address 0x84000  or to the address of __c_int0 of my application code through the boot loader?

    Thanks,

    Sayali

  • Sayali,

    1. Since the entry points of your custom bootloader and application are known, you can branch to them as needed.  At the end of your custom bootloader, you can include a function call to the application entrypoint. 

    From application, when you want to run your bootloader, you can pull a reset (via watchdog) so that the device bootROM can jump to Flash entry point (where your custom loader's codestart exists).  OR if you don't want to pull a reset, your application can branch to Flash entry point (where your custom loader's codestart exists) when it wants to update the Flash image.  

    You can use ((void (*)(void))EntryAddr)(); where EntryAddr = 0x80000 or wherever you want to go.

    2. Regarding where to jump: In your application linker command file, you can assign code_start to the start address of Sector-C.  And the code at code_start will branch to _c_int00 whereever it is located.  You can refer to F2837xD_CodeStartBranch.asm provided in C2000Ware examples.  In the linker command files provided in C2000Ware, you will notice that the codestart is mapped to 0x80000 (Flash entry-point after device boot).  In your case, your custom boot loader (that uses Flash API) takes this place. Hence, in your application's linker cmd file, codestart should be mapped to Sector-C in your case.  

    Thanks and regards,

    Vamsi

  • Vamsi,

    In my Flash API code, after the flashing of hex completes, I am using a branching instruction 'LB' to branch the PC to sector C address(where my application code's entry point resides).

    I have modified the application's cmd to place the codestart at flash C Sector.

    But, after the execution of the 'LB' command ('LB' command is currently used to branch to application's codestart from the flash api), I get an error : 'No symbols defined'.

    Requesting you to guide in reference to this.

    Thanks,

    Sayali

  • Sayali,

    Glad you progressed further.

    You need to load symbols (of the application executable) to be able to see the source in debugger.

    I am closing this post since the original issue that you posted is closed now.  Please open a new post if you have other questions.

    Thanks and regards,
    Vamsi

  • Sayali,

    I am not available until March 9th.  If you have further questions, please open a new post and our team will help you further.

    Since the original question in this thread is closed, I am closing this post.

    Thanks and regards,

    Vamsi