TOC2_FLAGS to disable SWD/JTAG

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
user_4814686
Level 1
Level 1
5 sign-ins First reply posted First question asked

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

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello Xavier,

From your recent post, I assume you were able to get this working. I will be locking this thread, we will continue all further discussions in the other thread: PSoC Programmer: CPU stopped at wrong address (0x10002958).

Regards,

Dheeraj

View solution in original post

0 Likes
1 Reply
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello Xavier,

From your recent post, I assume you were able to get this working. I will be locking this thread, we will continue all further discussions in the other thread: PSoC Programmer: CPU stopped at wrong address (0x10002958).

Regards,

Dheeraj

0 Likes