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.

TMS320C5517: software reset does not work in my code on flash

Part Number: TMS320C5517

Tool/software:

Hi,

Could you let me know the reason why SW reset, asm(“RESET”) does not work in my code placed on flash?
The code can work well in debug mode.

I expect that you have already had the experience to see this phenomenon and you give me any solution to solve it.

 

Best Regards

  • Hi There,

    There are a few issues that could cause the flash boot failure:

    1. The application program uses of last 8KB of on-chip memory may cause issue, because SARAM31 (byte address 0x4E000 – 0x4FFFF) is reserved for the bootloader.

    2. The ROM bootloader disable the MPORT before switch to application program. It is up to the application program to enable the MPORT before use it.

    Add the following section at the beginning of the main():

    // enable the MPORT and disable HWA
    *(volatile ioport Uint16 *)0x0001 = 0x020E;
    asm(" idle");

    Best regards,

    Ming

  • Hi Ming,

    Thanks for your reply.

    Things have changed a little. But the problem is still occurring.

    1.  Nothing is placed in SARAM31. 
    (SARAM31:  o = 0x04E000  l = 0x001F00  /* 8kB Single Access RAM 31 */)

    2.  Adding ”*(volatile ioport Uint16 *)0x0001 = 0x020E” to the beginning of main changed the behavior.
    before:used  "asm(“RESET”) "  "No reset & no UART communication( DSP operation stopped? 
    )"

    after   :used     "asm(“RESET”) "  "No reset & UART communication is possible( DSP operation )"

    As far as I can see, it is not reset with "asm(“RESET”)".
    As expected, when debugging, resetting is done with asm("RESET"), but when the same code is written to flash, it behaves differently.

    Do you have any ideas for a solution?

    Best regards,

     

  • Hi There,

    Can you use the reset button on the C5517 EVM, not use the "software reset" (asm("RESET")?

    Best regards,

    Ming

  • Hi Ming,

    Thank you for your continued cooperation.


    I wrote the program code created in debug mode to the C5517 EVM.

    When I pressed the reset button (SW1), 
    1. The XF LED lit up 
    2. It did not reset (the program continued to run even when the reset button was pressed)
    However, I have confirmed that the hardware reset does work on the prototype board.
    I thought that if I use asm("RESET"), the program counter and other things will be initialized and it will run from the beginning without me having to add any special program code, but am I mistaken?
    Interrupts (IFR) and the like are performed during the program initialization operation.
     
    Best regards,
  • Hi There,

    If the HW reset works for you, it means the boot image is working right? I do not understand why you want to use the asm("RESET").

    Best regards,

    Ming

  • Hi Ming,

    Thank you for your continued cooperation.
    I am sorry for my insufficient explanation.
    What I want to do is to start the initialization operation after receiving a specific command (reset) via UART communication.

    What is the current situation

    1. Write program code to flash.

    2. Read program code from flash with HW reset without any problems.

    3. Send reset command via UART and execute asm(“RESET”)

    4. When program code is read from flash and is running, reset is not performed correctly I am posting this for this reason.

         But  Reset is performed in debug mode

    One option would be to not use asm("RESET") and simply re-initialize the I/O etc.

    when a reset command is received, but if you have any other ideas, Could you let me know?


    Best regards,

  • Hi There,

    The software reset will not trigger a ROM re-run, because the following reason:

    The standard device includes a bootloader program resident in the ROM and the bootloader code is
    executed immediately after hardware reset. When the MPNMC bit field of the ST3 status register is set
    through software, the on-chip ROM is disabled and not present in the memory map, and byte address
    range FE 0000h - FF FFFFh is unmapped. A hardware reset always clears the MPNMC bit, so it is not
    possible to disable the ROM at hardware reset. However, the software reset instruction does not affect the
    MPNMC bit. The ROM can be accessed by the program and data buses. Each SAROM block can perform
    one word read access per cycle.

    To force a ROM code re-run in software, you can either branch to address 0xFFFFFC or assign the 0xFFFFFC to PC.

    Best regards,

    Ming

  • Hi There,

    Sorry for the typo. The last paragraph in the previous post should have been:

    To force a ROM code re-run in software, you can either branch to address 0xFFFF00 or assign the 0xFFFF00 to PC.

    Best regards,

    Ming

  • Hi Ming,

    I really appreciate your support.

    void software_reset(void) // go to 0xFFFF00  or FFFFF0
    {
    ((void (*)())0xFFFF00)();
    }

    The program code.would be reset in debug mode. but it still wouldn't work if written to Flash.
    So, in the same way, we were able to perform a software reset by reading the address where _c_int00 is located on the memory map.(Software reset is OK even if written to flash)
    Is there any problem with reading _c_int00?

    Best regards,

  • Hi There,

    It is because of the following statement:

    When the MPNMC bit field of the ST3 status register is set through software, the on-chip ROM is disabled and not present in the memory map, and byte address range FE 0000h - FF FFFFh is unmapped.

    Can you clear the MPNMC bit field of the ST3 status register, before the branch?

    Best regards,

    Ming