Other Parts Discussed in Thread: UNIFLASH, CC2340R5
LP-EM-CC2340R5 with XDS110ET Debugger
Windows 11 Home x64
CCS v12.3.0
Uniflash v8.3.0
simplelink_lowpower_f3_sdk_7_10_00_35 installed
I have looked at these threads and have not been able to replicate/get these solutions to work:
Post by Joe Gilfillan: ://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1224456/lp-em-cc2340r5-unable-to-program-cc2340-device-via-xds110-debugger
Post by Simbasoft: https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1177752/neither-ccs-nor-uniflash-are-able-to-connect-to-lp-em-cc2340r5-eval-board
If I try to simply build and debug the example mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc in CCS, I get the following errors:
In the popup:
Error connecting to the target: (Error -1274 @ 0x0) Error encountered during connect sequence. The specific reason is unknown but may be the result of trying to access a Core or logic that is inaccessible due to a lack of Power, Clocks, or Authentication (i.e. Security is preventing). If blocked by security, and if supported, access may be allowed after following the Authentication process. (Emulation package 9.11.0.00128)
In the console:
Cortex_M0P: Flash loader: CC23xx_FLASH_LIBRARY_VERSION 3.17.09.20 Cortex_M0P: Image must contain (correctly sized) CCFG section, when erase type is "Chip erase" Cortex_M0P: Debugging is not allowed. If this not expected, check your CCFG. Cortex_M0P: Flash loading is currently not supported if debugging is not allowed. Cortex_M0P: If you are experiencing issues with loading your application, do the following (this will erase the chip): Cortex_M0P: - Code Composer Studio: Cortex_M0P: - End the current debug session (if any is active). Cortex_M0P: - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration. Cortex_M0P: - Run -> Load -> LoadProgram -> Select the program file containing a valid CCFG. Cortex_M0P: - You should now be able to load your application to the target. Cortex_M0P: - UniFlash: Cortex_M0P: - Run the following dslite command: Cortex_M0P: dslite --mode cc23xx-prog-default-ccfg -c [path to your ccxml file] Cortex_M0P: - You should now be able to load your application to the target. Cortex_M0P: Halting at entry of application is not allowed. Are you sure debugging is allowed? Cortex_M0P: Running the application, without halting at the entry of the application. Cortex_M0P: GEL: Error while executing OnRestart( 0 ): Could not read 0x40000034: target is not connected at ('REG'::PMCTL_BOOTSTA==0x80) [cc23xx_xds.gel:99] at OnRestart(0) Cortex_M0P: AutoRun: Unable to run the target at this time Cortex_M0P: AutoRun: Target not run as breakpoint could not be set: Cannot enable while the target is disconnected Cortex_M0P: Debugging is not allowed. If this not expected, check your CCFG. Cortex_M0P: Flash loading is currently not supported if debugging is not allowed. Cortex_M0P: If you are experiencing issues with loading your application, do the following (this will erase the chip): Cortex_M0P: - Code Composer Studio: Cortex_M0P: - End the current debug session (if any is active). Cortex_M0P: - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration. Cortex_M0P: - Run -> Load -> LoadProgram -> Select the program file containing a valid CCFG. Cortex_M0P: - You should now be able to load your application to the target. Cortex_M0P: - UniFlash: Cortex_M0P: - Run the following dslite command: Cortex_M0P: dslite --mode cc23xx-prog-default-ccfg -c [path to your ccxml file] Cortex_M0P: - You should now be able to load your application to the target. Cortex_M0P: Halting at entry of application is not allowed. Are you sure debugging is allowed? Cortex_M0P: Running the application, without halting at the entry of the application. Cortex_M0P: Error connecting to the target: (Error -1274 @ 0x0) Error encountered during connect sequence. The specific reason is unknown but may be the result of trying to access a Core or logic that is inaccessible due to a lack of Power, Clocks, or Authentication (i.e. Security is preventing). If blocked by security, and if supported, access may be allowed after following the Authentication process. (Emulation package 9.11.0.00128)
First off, if I follow the steps written in the console:
Cortex_M0P: Debugging is not allowed. If this not expected, check your CCFG.
Cortex_M0P: Flash loading is currently not supported if debugging is not allowed.
Cortex_M0P: If you are experiencing issues with loading your application, do the following (this will erase the chip):
Cortex_M0P: - Code Composer Studio:
Cortex_M0P: - End the current debug session (if any is active).
Cortex_M0P: - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration.
Cortex_M0P: - Run -> Load -> LoadProgram -> Select the program file containing a valid CCFG.
Cortex_M0P: - You should now be able to load your application to the target.
Cortex_M0P: - UniFlash:
Cortex_M0P: - Run the following dslite command:
Cortex_M0P: dslite --mode cc23xx-prog-default-ccfg -c [path to your ccxml file]
Cortex_M0P: - You should now be able to load your application to the target.
The "Code Composer Studio" list of steps gives me the exact same console error
The "Uniflash" list of steps doesn't give me any command line errors, but even after using that command, I get the same console/popup errors when trying to debug the program using CCS:
c:\TI\uniflash_8.3.0>dslite --mode cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml Executing the following command: > "c:\TI\uniflash_8.3.0\deskdb\content\TICloudAgent\win\ccs_base\DebugServer\bin\DSLite" cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml For more details and examples, please refer to the UniFlash Quick Start guide
If I attempt to load the .OUT file via Uniflash, I get the following Uniflash console output:
[6/12/2023, 2:53:43 PM] [INFO] Cortex_M0P: Writing Flash @ Address 0x00000000 of Length 0x00006f7c [6/12/2023, 2:53:43 PM] [INFO] Cortex_M0P: Performing Chip Erase [6/12/2023, 2:53:44 PM] [ERROR] Cortex_M0P: Image must contain (correctly sized) CCFG section, when erase type is "Chip erase" [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: Debugging is not allowed. If this not expected, check your CCFG. [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: Flash loading is currently not supported if debugging is not allowed. [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: If you are experiencing issues with loading your application, do the following (this will erase the chip): [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - Code Composer Studio: [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - End the current debug session (if any is active). [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration. [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - Run -> Load -> LoadProgram -> Select the program file containing a valid CCFG. [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - You should now be able to load your application to the target. [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - UniFlash: [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - Run the following dslite command: [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: dslite --mode cc23xx-prog-default-ccfg -c [path to your ccxml file] [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: - You should now be able to load your application to the target. [6/12/2023, 2:53:45 PM] [ERROR] Cortex_M0P: Halting at entry of application is not allowed. Are you sure debugging is allowed? [6/12/2023, 2:53:45 PM] [INFO] Cortex_M0P: Running the application, without halting at the entry of the application. [6/12/2023, 2:53:45 PM] [ERROR] Cortex_M0P: GEL: Error while executing OnRestart( 0 ): Could not read 0x40000034: target is not connected at ('REG'::PMCTL_BOOTSTA==0x80) [cc23xx_xds.gel:99] at OnRestart(0) [6/12/2023, 2:53:45 PM] [SUCCESS] Program Load completed successfully.
Attempting Ryan Brown1's verified solution for Joe Gilfilian's post:
The Tools Team has confirmed that the issue is most likely because debug access is disabled (inside ccfg) in the flashed program. This would be caused by a hardware/software mismatch as described earlier (i.e. RevA/PG1 SDK example on RevB/PG2 board or RevA/PG1 ccfg in an RevB/PG2 example and flashed on RevB/PG2 board.
There is no way to unlock from CCS or Uniflash. This is by design, as the debug interface is supposed to be closed permanently if selected by the developer. This was not enabled in RevA/PG1. Here is a script for customers to recover from this situation.
- Launch a project-less debug session with a target configuration file in ‘Target Configurations’ window (View -> Target Configurations).
- Right click the Cortex core in debug window (View -> Debug) and select ‘Show all cores’.
- Right click the DAP core and select ‘Open GEL Files View’.
- Right click in ‘GEL Files (CS_DAP)’ window and load the `unblock_loki_low_plus_pg2.gel` script.
- Please ensure the status of the gel script is Success after loading it.
- Select the DAP core and run the gel function ‘UnblockLokiLowPlusPG2’ (Scripts -> CC23XX).
To flash a program on a blank device using Uniflash CLI, below command can be used. This is will work on Uniflash v8.2 or v8.3.
dslite --mode noConnectFlash cc23xx-prog-default-ccfg -c ccxml_file_path
If Uniflash GUI is used for blank device, device can be directly programmed from GUI without any special test. On a device with valid CCFG, same old dslite command still works
dslite flash cc23xx-prog-default-ccfg -c ccxml_file_path
Regards,
Ryan
Once I run the script in Step 5, I get the following in the console:
And then when I move to the next step with the dslite command, I see this:
c:\TI\uniflash_8.3.0>dslite --mode noConnectFlash cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml Executing the following command: > "c:\TI\uniflash_8.3.0\deskdb\content\TICloudAgent\win\ccs_base\DebugServer\bin\DSLite" noConnectFlash cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml For more details and examples, please refer to the UniFlash Quick Start guide. info: Cortex_M0P: Flash loader: CC23xx_FLASH_LIBRARY_VERSION 3.17.09.20 Failed: Unable to open file: cc23xx-prog-default-ccfg
Similar deal if I use the command on the next line of that solution:
dslite flash cc23xx-prog-default-ccfg -c ccxml_file_path
c:\TI\uniflash_8.3.0>dslite flash cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml
Executing the following command:
> "c:\TI\uniflash_8.3.0\deskdb\content\TICloudAgent\win\ccs_base\DebugServer\bin\DSLite" flash flash cc23xx-prog-default-ccfg -c C:\TI\Workspaces\WS2\mcuboot_blinky_LP_EM_CC2340R5_nortos_gcc\targetConfigs\CC2340R5.ccxml
For more details and examples, please refer to the UniFlash Quick Start guide.
info: Cortex_M0P: Flash loader: CC23xx_FLASH_LIBRARY_VERSION 3.17.09.20
Cortex_M0P: GEL Output: Memory Map Initialization Complete.
Failed: Unable to open file: flash
Moving onto Simbasoft's solution:
The procedure detailed below should be followed if flashing a blank device or a device that has been mass-erased. If the procedure is performed on a non-blank device, the procedure will not have any negative effect. The following steps may be used to resolve the “Error -1274 @ 0x0” flashing error. (I did a UniFLASH CHIP ERASE before starting this)
-
In CCS, open the Target Configuration view by clicking on View → Target Configurations.
-
In the Target Configuration window, click and expand the “Projects” folder.
-
Within the “Projects” folder, click and expand your project.
-
Click and expand the targetConfigs folder.
-
At this stage, you should see the
CC2340R5.ccxml
file. Right click and click on “Launch Selected Configuration” -
After a few seconds, the CCS view should switch to Debug view and the target configuration should launch. The target configuration has finished launching if the “Texas Instruments XDS110 USB Debug Probe/CORTEX_M0P” core is visible in the Debug window.
-
Click on Scripts → CC23xx → ProgramDefaultCcfg. This is where I'm stuck - there is no ProgramDefaultCcfg option here.
-
Afterwards, you should see a success message in the Console. The device may now be flashed.
Next set of steps:
-
Open Uniflash
-
Open a CC2340R5 configuration.
-
Click on Standalone Command line
-
Click on Generate Package
-
After package is generated, save the zip file to
C:\ti\uniflash_7.1.0
. -
Extract the contents of the
uniflash_windows.zip
archive intoC:\ti\uniflash_7.1.0\uniflash_windows
-
Open a Windows Command Prompt
-
Navigate to the
C:\ti\uniflash_7.1.0
directory in the command prompt by running the following commandcd C:\ti\uniflash_7.1.0
-
Run the following command:
dslite.bat --mode cc23xx-prog-default-ccfg -c C:\ti\uniflash_7.1.0\uniflash_windows\user_files\configs\cc2340r5.ccxml
-
Afterwards, you should see a success message in the Console. The device may now be flashed.
I get the following CMD response:
c:\TI\uniflash_8.3.0>dslite.bat --mode cc23xx-prog-default-ccfg -c C:\ti\uniflash_8.3.0\uniflash_windows\user_files\configs\cc2340r5.ccxml Executing the following command: > "c:\TI\uniflash_8.3.0\deskdb\content\TICloudAgent\win\ccs_base\DebugServer\bin\DSLite" cc23xx-prog-default-ccfg -c C:\ti\uniflash_8.3.0\uniflash_windows\user_files\configs\cc2340r5.ccxml For more details and examples, please refer to the UniFlash Quick Start guide.
But when I attempt to flash the image that is inside the uniflash_windows folder (using the same target config as is inside the uniflash_windows folder) I'm met with the same errors:
And back in CCS I still can't flash/debug anything.
[6/12/2023, 3:36:01 PM] [INFO] Cortex_M0P: Flash loader: CC23xx_FLASH_LIBRARY_VERSION 3.17.09.20 [6/12/2023, 3:36:02 PM] [ERROR] Cortex_M0P: Image must contain (correctly sized) CCFG section, when erase type is "Chip erase" [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: Debugging is not allowed. If this not expected, check your CCFG. [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: Flash loading is currently not supported if debugging is not allowed. [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: If you are experiencing issues with loading your application, do the following (this will erase the chip): [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - Code Composer Studio: [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - End the current debug session (if any is active). [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - View -> Target Configurations -> Right click on .ccxml file for your project -> Launch Selected Configuration. [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - Run -> Load -> LoadProgram -> Select the program file containing a valid CCFG. [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - You should now be able to load your application to the target. [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - UniFlash: [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - Run the following dslite command: [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: dslite --mode cc23xx-prog-default-ccfg -c [path to your ccxml file] [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: - You should now be able to load your application to the target. [6/12/2023, 3:36:03 PM] [ERROR] Cortex_M0P: Halting at entry of application is not allowed. Are you sure debugging is allowed? [6/12/2023, 3:36:03 PM] [INFO] Cortex_M0P: Running the application, without halting at the entry of the application. [6/12/2023, 3:36:04 PM] [ERROR] Cortex_M0P: GEL: Error while executing OnRestart( 0 ): Could not read 0x40000034: target is not connected at ('REG'::PMCTL_BOOTSTA==0x80) [cc23xx_xds.gel:99] at OnRestart(0) [6/12/2023, 3:36:04 PM] [SUCCESS] Program Load completed successfully.
Any help is appreciated