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.
I have this processor working as expected and added the read-only protection for internal flash from 0x31800 to 0x33FFF by wrote 0xFFFFFF07 to FLASH_FMPPE3. The read-only protection works and saved correctly (wrote 7 to FLASH_FMA and FLASH_FMC_WRKEY | FLASH_FMC_COMT to FLASH_FMC). For some reasons, I was not able to recover by doing the mass erase sequence. Please comment.
My sequence is:
1. Assert and hold the RST signal. Apply power to the device.
2. Using Segger JLink commander to switch to SWD ("si 1") and back to JTAG ("si 0") 5 times.
3. Deaasert RST.
4. Wait for several seconds.
5. Power cycle the microcontroller.
Do you think the Segger JLink commander "si 0/1" to switch between JTAG and SWD? On paper, it should but I am not sure why the recovering is not working for me.
Thanks,
Dennis N
Hi Dennis,
If you have a spare TM4C123 LaunchPad board then you can use it as a debug probe for your custom board and use the LM Flash Programmer to unlock the part. If you have other emulators such as XDS100 or XDS200 then you can use them in conjunction with Uniflash to unlock your part. Please take a look starting from section 5.3 of the app note here.
Search for 'unlock' in this diagnostic post will also provide some hints. Diagnosing Common Development Problems and Tips & Info for TM4C Devices - Arm-based microcontrollers...
From looking at the J-Link documentation think the issue might be that the "si" command just selects the target interface to be used, without actually sending the switching sequence.Dennis Nguyen - Flex said:Do you think the Segger JLink commander "si 0/1" to switch between JTAG and SWD?
There is the SWDSelect command for which the J-Link Command help text explicitly states that it outputs the JTAG -> SWD switching sequence:
SWDSelect Selects SWD as interface and outputs the JTAG -> SWD switching sequence.
However, I can't find an equivalent command to output the SWD -> JTAG switching sequence.
There are commands to control the individual JTAG lines, so may could bit-bang the JTAG -> SWD sequence but a bit tedious:
---- JTAG-Hardware --- c00 Create clock with TDI = TMS = 0 c Clock tck0 Clear TCK tck1 Set TCK 0 Clear TDI 1 Set TDI t0 Clear TMS t1 Set TMS trst0 Clear TRST trst1 Set TRST r0 Clear RESET r1 Set RESET
The J-Link script JTAG_Write function may allow a simpler generation of the required sequence to switch from SWD -> JTAG and JTAG -> SWD since JTAG_Write can write up to 64 bits per pin.
Thank you all for your quick inputs. With my development environment, I think my shortest route is to use J-Link script. You have a great day,
Dennis