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.

RTOS/CC2640R2F: CC2640 Reset Problems

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hi,

We are experiencing some problems with reset after flashing with Flash programmer 2.

We are flashing the firmware, but the device does not reset properly after. It seems like it stops in boot. If we touch one of the IOs the device start up, but at every reset (by HAL_SYSTEM_RESET();)  the device stop in boot.

If we do a hard Reset(pull reset pin low) after programming, and touch the IO. the device work correctly, and every HAL_SYSTEM_RESET(); work just fine.

We have looked in to the hardware believing this was a HW fault due to this is a custom board. But we have come to the conclusion that because everything work fine when we pull the reset pin first, this cannot be HW (or unlikely).

To sum up:

1. Flash program

2. Touch IO (device start up)

Next reset stop in boot again.

1. Flash program

2. Pull reset pin low manually.

3. touch IO.(device start up)

Every reset work fine now.

What can be the source for this problem, does the flash programmer put in a halt in boot?

Are there any DEBUG settings that need to be removed?

I can see there are multiple posts about this in this forum, but none have gotten an answer so I would like to again here :-)

  • Hi Viggo,

    What version of Flash programmer 2 are you using?

    Can you use a logic analyser on the JTAG pins to check whether the last thing that happens is a reset?
  • Hi,

    We are using Version 1.7.5, with the XDS110 on the CC2640R2_LAUNCHXL devboard.

    I will get back to you with the result of the Logic analyser later this week.
  • Hi,

    It took some time, but we have checked the TMS,RST and TCK lines now.

    It looks like the reset is not the last thing happening when flashing from code composer studio in debugging mode.

    note: yellow line is RST, blue is TMS/TCK. TCK is first image, TMS second.

    I guess this is normal when using the debugger interface

    When flashing from Flash programmer 2 the last thing to happen is the reset.

    I added the pictures from pushing the resetbutton on the CC2640R2F_LAUNCHXL devkit also

    Also, I added the screenshots from when I read a page from the flash(and the following reset as the FP" do a reset on the chip)

    Additional:

    I am not sure if this has anything with the problem to do, but if it is:

    When I suspend the debugging, and do a restart of the code with the restart button, the code will not run the first time I do this. I have to do a second suspend, and then a restart again, and the code run as it should. (there are no resets happening here)

    On the first suspend, code stop somwhere in the 0x1XXXXXXX section.

    On second suspend, code stop in the cmp command in the m3_exechandler.

    After second suspend, the code run normally when restarted.

    I have moved into the 1.50 SDK now(1.40 previous), and now the code will not restart at all when flashing from FP2.

    What can be the problem?

  • Extra info:
    I have tested with the uart_echo example. This works just fine, I can program from Flash programmer 2, and a normal reset start the code as it should.

    But testing with the oad_offchip example, the code will not restart.

  • Hi Viggo,

    Which file are you programming with the FP? (.bin file or hex files?)

    Did you make any changes to the CCFG or the bim project?
  • Hi Marie,

    I have been using the three out files. (.out)(bim, stack and app), three .hex files, and tried to read out a .bin file, and program with this.

    Best regards,
    Viggo

  • Hi Viggo,

    Can you try building the bim project with JTAG_DEBUG defined, then programming the three hex files?
  • Hi Marie,

    Thank you for the quick replies.

    I did a full clean of all projects and removed the x from (xJTAG_DEBUG) under predefined symbols in the BIM project setting.
    Tried a new build, but no luck.(used .out files)

    The code will not start after flashing with Flash programmer 2, only when using CCS.

    Best Regards,
    Viggo
  • Hi Viggo,

    Can you try with the hex files?

    For me it works, either with bim + app + stack hex files, or bim + merged hex file.
  • Hi,

    I Tried with the hex files also, no luck.

    Have read a little around similar issues, and there have been mentions of the Halt-in-boot flag. is there any way to find this in the bin file and set this manually? Do you think this HIB flag can be the problem?

    Best Regards,
    Viggo
  • Hi,

    This issue does not happen using CC2640R2F Launchpad as long as you use the original simple peripheral off-chip oad example program. Also, when you flash the hex files of BIM, App, Stack using SmartRF Flash Programmer 2, You need to set the hex files in this order below. If you do not there is some issue after flashing.

    1. BIM hex file
    2. Stack hex file
    3. App hex file

    - kel
  • Hi,

    I have tried again with multiple ways of flashing. It seems the code is flashed correctly with the files because:

    If I disconnect all power to the CC2640R2F, and then reconnect after a couple of seconds, the code start up as it should. But when I do this,  the HAL_SYSTEM_RESET(), or other power down functions only reset the chip, it does not start up the code again. Can this be a Problem with the inductance on the RESET pin, or any of the power domains, TCK pin, or TMS pin?

    What is the requirements for the Reset to happen properly?

  • Hi,

    See, processors.wiki.ti.com/.../CC26xx_HW_Troubleshooting and check your custom CC2640R2F Board. You might want to also compare with the CC2640R2F Launchpad.

    - kel
  • Hi,

    I have now looked over the schematics and layout. The Reset pin setup is the same as the launchpad. I can not see any problems occuring on the reset pin using the oscilloscope either. If you look earlier in the post, I attached some printouts from the oscilloscope during RESET of chip.

    What can be the reason for the Chip only being able to reset and run the code when power have been disconnected for some time? IS it possible that there is something that neet to be done with the jumptable/reset vectors?
  • Hi Viggo,

    I have worked with CC2640R2F Launchpad and custom CC2640R2F board and both reset after I call HAL_SYSTEM_RESET(). I used a CC-DEVPACK-DEBUG to program the custom CC2640R2F board

    Just for learning try calling HAL_SYSTEM_RESET() using CC2640R2F Launchpad with simple peripheral running and led on as indicator to know if the program reset after calling HAL_SYSTEM_RESET().

    When using simple peripheral off-chip oad example program, make sure that you use the BIM from the same SDK version. Also, you need to flash the hex files in the order that I replied earlier using SmartRF Flash Programmer 2.

    Anyway wait for a TI Engineer to help.

    - kel
  • Hi Viggo,

    On your oscilloscope plots, it looks like the device resets fine. However, if you're not able to reset with HAL_SYSTEM_RESET() it means you have not done a proper pin reset. Can you please check your reset pin?
  • Hi,

    The pin setup on the RESET pin is the same as on the CC2640R2F_LAUNCHXL, and I haven't found any noise problems on the Pin.

    I have looked over the setup multiple times already, but can not find any reason to why it act like this.

    Any suggestions on what I can check on the PIN?

    EDIT:

    I do believe this might be a software problem though, as the uartecho example work correctly when resetting with both HAL_SYSTEM_RESET()  and with hard reset on the pin. I believe this proves that the RESET pin and the HW work as it should.

    The problem appear when using the OAD example, which makes me think there is a problem with jumping to correct code start location from BIM. Or something in the BLE code catching the code in a whileloop(exception?) when doing a hard reset. Is that a reasonable supposition?

    Best Regards,

    Viggo

  • Good News!!!

    I got it working now.

    For others with similar problem, try:

    Defined in the app_ble.cfg under the system module:

    /* ================ System configuration ================ */
    var System = xdc.useModule('xdc.runtime.System');
    /*
     * The Abort handler is called when the system exits abnormally.
     *
     * Pick one:
     *  - System.abortStd (default)
     *      Call the ANSI C Standard 'abort()' to terminate the application.
     *  - System.abortSpin
     *      A lightweight abort function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom abort handler
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    //System.abortFxn = System.abortStd;
    System.abortFxn = System.abortSpin;
    //System.abortFxn = "&myExit";
    
    /*
     * The Exit handler is called when the system exits normally.
     *
     * Pick one:
     *  - System.exitStd (default)
     *      Call the ANSI C Standard 'exit()' to terminate the application.
     *  - System.exitSpin
     *      A lightweight exit function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom exit function
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    //System.exitFxn = System.exitStd;
    System.exitFxn = System.exitSpin;
    //System.exitFxn = "&myExit";

    I changed the code to:

    /* ================ System configuration ================ */
    var System = xdc.useModule('xdc.runtime.System');
    /*
     * The Abort handler is called when the system exits abnormally.
     *
     * Pick one:
     *  - System.abortStd (default)
     *      Call the ANSI C Standard 'abort()' to terminate the application.
     *  - System.abortSpin
     *      A lightweight abort function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom abort handler
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    System.abortFxn = System.abortStd;
    //System.abortFxn = System.abortSpin;
    //System.abortFxn = "&myExit";
    
    /*
     * The Exit handler is called when the system exits normally.
     *
     * Pick one:
     *  - System.exitStd (default)
     *      Call the ANSI C Standard 'exit()' to terminate the application.
     *  - System.exitSpin
     *      A lightweight exit function that loops indefinitely in a while(1) trap
     *      function.
     *  - A custom exit function
     *      A user-defined function. See the System module documentation for
     *      details.
     */
    System.exitFxn = System.exitStd;
    //System.exitFxn = System.exitSpin;
    //System.exitFxn = "&myExit";

    enabling the standard exit and abort functions. This made the chip reset properly, and programming with Flash programmer 2 works.

    The code was caught in one of the while loops made for debugging the code when exit/abort happens.

    I am not sure why the exceptions happended, so some debugging is required to find the reason.

  • After some time this problem have appeared again, the above was not the solution. Continue post in:
    e2e.ti.com/.../665068