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.

CC2340R2: Document for SWD interface

Part Number: CC2340R2

Tool/software:

Hi Team, 

My customer is using CC2340R2, and they want to know if TI has any document for SWD interface.

They are trying to make their own flash programmer program for CC2340R2.

Can Sec. 8.2/8.3 of user guide be used for this purpose?

Please help to provide comments.

Thanks.

  • Hello Mike Wu,

    Section 6.3 and 8.10 (DIO16 and DIO17 are SWD) in the datasheet and in the various sections in the TRM about SWD will help when looking into the SWD.

    Thanks,
    Alex F

  • I read the CSW is 0x43800042. This 8 show the chip is CSW.SDeviceEn are 0b1. Chip is security. I can't read the FLASH register now.

  • Hello Xiaoliang Zou

    Can you check the following setting of your device, CCFG.permissions.allowDebugPort==FORBID? If this is set as forbidden then you should not be able to interact with the flash, reference section 8.2 of the TRM CC23xx SimpleLink Wireless MCU (Rev. A)

    Thanks,
    Alex F

  • I would like to use SWD to operate SACI COMMANDS. How can I implement it specifically? Do you have any relevant sample code?

  • Hello Xiaoliang Zou,

    Section 8.3.2 of the TRM documents the aviaible SACI Commands, the following E2E post also covers similar content:

    https://e2e.ti.com/f/1/t/1441014/

    - OpenOCD may be able to help with SWD as well. 

    Thanks,
    Alex F

  • Dear Alex,

                   1: I want to operate the SACI commands. But can't change the SACI register.

    10:42:10.188 DBGSS_O_DESC:0xB24D1010
    10:42:10.218 DBGSS_O_TXD:0x00000000,
    10:42:10.247 DBGSS_O_TXCTL:0x00000000
    10:42:10.277 DBGSS_O_RXD:0x00000000
    10:42:10.307 DBGSS_O_RXCTL:0x00000000
    10:42:10.337 DBGSS_O_RIS:0x00000004,
    10:42:10.367 DBGSS_O_DBGCTL:0x0000003A,
    10:42:10.396 DBGSS_O_SPECIAL_AUTH:0x00000033
    10:42:10.426 DBGSS_O_SPECIAL_AUTH_SET:0x00000000
    10:42:10.456 ACI_CMD_MISC_NO_OPERATION
    10:42:10.486 DBGSS_O_TXCTL:0x00000000,
    10:42:10.516 DBGSS_O_TXCTL:0x00000003
    10:42:10.546 DBGSS_O_TXD:0x00000101,
    10:42:10.576 DBGSS_O_TXCTL:0x00000000
    10:42:10.606 DBGSS_O_RXCTL:0x00000000,
    10:42:10.636 DBGSS_O_RXD:0x00000000,

     When I set the TXD to 0x00000101, but when I read ,it alwaly 0. Not change.

                     2: So I change to the FLASH mode. Used these register to sector_erase and program the chip.

    But after I finish the operation,I can't read the AHP-AP ID.

    14:29:31.438 FLASH_O_CMDWEPROTA:0xFFFFFFF0
    14:29:31.468 FLASH_O_CMDWEPROTB:0x00000FFF,
    14:29:31.497 UnProtect ok!
    14:29:31.527 W FLASH_O_CMDTYPE:0x00000002
    14:29:31.557 W FLASH_O_CMDCTL:0x0000000C
    14:29:31.587 W FLASH_O_CMDADDR:0x00000000
    14:29:31.617 FLASH_O_CMDDATA0:0xFFFFFFFF,
    14:29:31.647 W FLASH_O_CMDEXEC:0x00000001
    14:29:31.678 FLASH_O_STATCMD:0x00000003,
    14:29:31.708 write_word
    14:29:31.738 FLASH_O_STATCMD:0x00000003
    14:29:31.768 W FLASH_O_CMDTYPE:0x00000001
    14:29:31.798 W FLASH_O_CMDCTL:0x0000000A
    14:29:31.828 W FLASH_O_CMDADDR:0x00000000
    14:29:31.858 FLASH_O_CMDDATA0:0x12345678,
    14:29:31.887 W FLASH_O_CMDEXEC:0x00000001
    14:29:31.918 FLASH_O_STATCMD:0x00000011,

    Now show this informatio.

    14:29:42.549 DP_IDCODE:0x6BA02477
    14:29:42.599 DP_CONTROL_STATUS:0xFC000000,
    14:29:42.628 APB-AP IDR:0x00000000,
    14:29:42.658 CFG-AP IDR:0x002E0001
    14:29:42.688 SEC-Ap IDR:0x002E0000,

    Can you help provide some suggestions?

  • Hello Xiaoliang Zou,

    Sorry for the delay, we are working with the wider team to see if we can look into your issue further.

    For developing a "flash programmer", we unfortunately "don't provide support for developing flash programming applications via the SWD interface" from https://e2e.ti.com/f/1/t/1342180/

    Thanks,
    Alex F

  • Hi, 

    The TRM of CC23xx SimpleLink Wireless MCU (Rev. A) presents in section §8.2.4.5 some flow diagrams showing the programming, please get these reviewed. 

    For the SACI mode boot up make sure to also review §5.7 - make sure device is entry SACI mode on boot up and read the CFG AP to confirm the boot status (§8.1.3)

    I hope this will hellp,

    Regards,