1 Reply Latest reply on Nov 19, 2020 11:18 PM by DheerajK_81

    TOC2_FLAGS to disable SWD/JTAG

    user_4814686

      Hi,

       

      I am trying to lock the SWJ using the following code:

       

      CY_SECTION(".cy_toc_part2") __USED const uint32_t cyToc[128] =

      {

          0x200-4,                /* Offset=0x0000: Object Size, bytes (512 bytes - 4 bytes of CRC)                                       */

          0x01211220,             /* Offset=0x0004: Magic Number (TOC Part 2, ID)                                                             */

          0,                      /* Offset=0x0008: Key Storage Address                                                                                      */

          [4]   =  0x10000000u,   /* Offset=0x0010: App image start address                                                                     */

          [126] =  0x00000002,    /* Offset=0x01F8: Bits[ 1: 0] CLOCK_CONFIG (0=8MHz, 1=25MHz, 2=50MHz, 3=100MHz) (default = 2)

                                                    Bits[ 4: 2] LISTEN_WINDOW (0=20ms, 1=10ms, 2=1ms, 3=0ms, 4=100ms) (default = 0)

                                                    Bits[ 6: 5] SWJ_PINS_CTL (0/1/3=Disable SWJ, 2=Enable SWJ) (default = 2)

                                                    Bits[ 8: 7] APP_AUTHENTICATION (0/2/3=Enable, 1=Disable)(default = 0)

                                                    Bits[10: 9] FB_BOOTLOADER_CTL: UNUSED (default = 0)(reserved)                     */

      };

       

      The CRC is automatically generated using cymcuelftool.

       

      I have attached the .hex file generated by reading the SFlash using PSoC Programmer after loading the program.

       

      Please advise on what needs to be modified in the CY_SECTION to properly lock the SWJ.

       

      Thank you,

      Xavier