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.

CCS/TMS320F28377D: Custom bootloader for f28377d

Part Number: TMS320F28377D

Tool/software: Code Composer Studio

Hello folks,

I wrote a custom bootloader for the f28377d. I placed the bootloader project into flash section A. And my app code lies into Flash sections D-N. I wait for 5secs in the bootloader and jump to the app code. I used the LB 0x86000 command to jump. In my appcode's cmd file, I set the BEGIN address to 0x86000 and modified the Flash Sector D as beginning from 0x86002. 

So everything seems fine until that point. When I jump to appcode on both cpus the appcode of the cpu02 doesnt work as I wanted. Some functions work but some doesnt. I tested the appcode sandalone without bootloader and it works fine. I think I have been forgeting something on my cpu02's bootloader code. 

In my bootloader code I use " IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH)" function to boot the cpu02 from flash. Should I use that function to boot cpu02 or it will automatically boot? (is it mandatory? if it is should I also use it in my appcode?)

Is it true to jump to BEGIN adress or should I jump to the entrypoint of the app code? (or any other adress in the flash sector D?)

After reset the mcu goes to RESET vector at 0x3FFFC0 and then jumps to the bootloader. The bootloader checks the boot pins(etc.) and then goes to the BEGIN(0x80000) adress. Then it starts the codestart routine and goes to main. If the above flow is true, is it okay to change the value of the BEGIN vector to 0x86000? (Because on my standalone project without the custom bootloader, code doesnt boot from flash correctly if I change the BEGIN vector any value from 0x80000).

Thanks in advance

 

  • Hi,

    CPU2 waits for a command to finish booting. You will need to tell it how to boot via IPC like you have it. However, keep in mind the boot to flash option will not boot CPU2 to 0x86000.

    Yes, your code needs to boot CPU2 via IPC.

    The boot to flash boot mode always goes to 0x80000. This cannot be changed. So if you boot to flash it will always goes there even if you moved the BEGIN section to another location. This may be why your code is not working as expected. You may not have anything or the proper LB instruction at 0x80000.

    Hope this helps.

    If you have more questions, please describe in greater detail what you have in flash and where and also what boot modes you are using.

    The Boot ROM chapter of the TRM will be of great help to you.

    sal
  • Dear Sal,

    Thank you for your response. Actually I boot from 0x80000 at the beginning in the bootloader. Then, the code moves to 0x86000 with LB opcode. Here the details of my work.

    Custom bootloader is in Flash A and app code is in Flash D to N. I start the code from custom bootloader with both cpus. I use the ipc function as you suggested in the bootloader. After waiting couple of time if there is no command to update flash, I move to the app code with both cpus. (it doesnt matter to use ipc boot function in app code)

    I use boot to flash option with gpio72-84 both high. I am updating the code using sci.

    Actually,  my problem is resolved adding 100ms delay before the LB instruction in the cpu02. I think if the cpu02 moves to appcode before cpu01, it causes problem.

    If you have further comments I would appreciate it. I want to be sure that there will be no problem in the future.

    Best Regards

  • Thank you for the details.

    I am glad you got it working. When using parallel processing like using two CPUs, timing is very important, because you are using shared resources.

    I am not sure what your issue was previously, but it may have been that CPU2 was trying to us a shared resource that it was not yet given permission to use by CPU1.

    Glad you got it working.

    sal
  • Thank you for your responses. Have a nice day.