$ JLinkExe SEGGER J-Link Commander V6.54 (Compiled Oct 28 2019 10:34:47) DLL version V6.54, compiled Oct 28 2019 10:34:34 Connecting to J-Link via USB...O.K. Firmware: J-Trace PRO V2 Cortex compiled Jun 28 2019 16:31:57 Hardware version: V2.00 S/N: 932000268 License(s): RDI, FlashBP, FlashDL, JFlash, GDB IP-Addr: DHCP (no addr. received yet) Emulator has RAWTRACE capability VTref=3.150V Type "connect" to establish a target connection, '?' for help J-Link>connect Please specify device / core. : ATSAM4SD32C Type '?' for selection dialog Device> Please specify target interface: J) JTAG (Default) S) SWD T) cJTAG TIF>S Specify target interface speed [kHz]. : 4000 kHz Speed> Device "ATSAM4SD32C" selected. Connecting to target via SWD Found SW-DP with ID 0x2BA01477 Scanning AP map to find all available APs AP[1]: Stopped AP scan as end of AP map has been reached AP[0]: AHB-AP (IDR: 0x24770011) Iterating through AP map to find AHB-AP to use AP[0]: Core found AP[0]: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. FPUnit: 6 code (BP) slots and 2 literal slots CoreSight components: ROMTbl[0] @ E00FF000 ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB000 SCS ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU Cortex-M4 identified. J-Link>reset Unknown command. '?' for help. J-Link>? Available commands are: ---------------------- f Firmware info h halt IsHalted Returns the current CPU state (halted / running) WaitHalt Waits until the CPU is halted or the given timeout is exceeded. Syntax: WaitHalt Default timeout is 1000 ms g go Sleep Waits the given time (in milliseconds). Syntax: Sleep s Single step the target chip Syntax: s [] st Show hardware status hwinfo Show hardware info mem Read memory. Syntax: mem [:], (hex) mem8 Read 8-bit items. Syntax: mem8 [:], (hex) mem16 Read 16-bit items. Syntax: mem16 [:], (hex) mem32 Read 32-bit items. Syntax: mem32 [:], (hex) w1 Write 8-bit items. Syntax: w1 [:], (hex) w2 Write 16-bit items. Syntax: w2 [:], (hex) w4 Write 32-bit items. Syntax: w4 [:], (hex) erase Erase internal flash of selected device. Syntax: Erase wm Write test words. Syntax: wm is Identify length of scan chain select register ms Measure length of scan chain. Syntax: ms mr Measure RTCK react time. Syntax: mr q Quit qc Close JLink connection and quit r Reset target (RESET) rx Reset target (RESET). Syntax: rx RSetType Set the current reset type. Syntax: RSetType Regs Display contents of registers wreg Write register. Syntax: wreg , moe Shows mode-of-entry, meaning: Reason why CPU is halted SetBP Set breakpoint. Syntax: SetBP [A/T] [S/H] SetWP Set Watchpoint. Syntax: [R/W] [ [] [A-Mask]] ClrBP Clear breakpoint. Syntax: ClrBP ClrWP Clear watchpoint. Syntax: ClrWP VCatch Write vector catch. Syntax: VCatch loadfile Load data file into target memory. Syntax: loadfile , [] Supported extensions: *.bin, *.mot, *.hex, *.srec is needed for bin files only. loadbin Load *.bin file into target memory. Syntax: loadbin , savebin Saves target memory into binary file. Syntax: savebin , , verifybin Verfies if the specified binary is already in the target memory at the specified address. Syntax: verifybin , SetPC Set the PC to specified value. Syntax: SetPC le Change to little endian mode be Change to big endian mode log Enables log to file. Syntax: log unlock Unlocks a device. Syntax: unlock Type unlock without to get a list of supported device names. nRESET has to be connected term Test command to visualize printf output from the target device, using DCC (SEGGER DCC handler running on target) ReadAP Reads a CoreSight AP register. Note: First read returns the data of the previous read. An additional read of DP reg 3 is necessary to get the data. ReadDP Reads a CoreSight DP register. Note: For SWD data is returned immediately. For JTAG the data of the previous read is returned. An additional read of DP reg 3 is necessary to get the data. WriteAP Writes a CoreSight AP register. WriteDP Writes a CoreSight DP register. SWDSelect Selects SWD as interface and outputs the JTAG -> SWD switching sequence. SWDReadAP Reads a CoreSight AP register via SWD. Note: First read returns the data of the previous read. An additional read of DP reg 3 is necessary to get the data. SWDReadDP Reads a CoreSight DP register via SWD. Note: Correct data is returned immediately. SWDWriteAP Writes a CoreSight AP register via SWD. SWDWriteDP Writes a CoreSight DP register via SWD. Device Selects a specific device J-Link shall connect to and performs a reconnect. In most cases explicit selection of the device is not necessary. Selecting a device enables the user to make use of the J-Link flash programming functionality as well as using unlimited breakpoints in flash memory. For some devices explicit device selection is mandatory in order to allow the DLL to perform special handling needed by the device. ExpDevList Exports the device names from the DLL internal device list to a text file Syntax: ExpDevList ExpDevListXML Exports the device names from the DLL internal device list to a text file in XML format Syntax: ExpDevListXML PowerTrace Perform power trace (not supported by all models) Syntax: PowerTrace [ ] : File to store power trace data to : 32-bit mask to specify what channels shall be enabled : Sampling frequency in Hz (0 == max) : 0: No reference count 1: Number of bytes transmitted on SWO ---- CP15 ------------ rce Read CP15. Syntax: rce , , , wce Write CP15. Syntax: wce , , , , ---- ICE ------------- Ice Show state of the embedded ice macrocell (ICE breaker) ri Read Ice reg. Syntax: ri (hex) wi Write Ice reg. Syntax: wi , (hex) ---- TRACE ----------- TClear TRACE - Clear buffer TSetSize TRACE - Set Size of trace buffer TSetFormat TRACE - SetFormat TSR TRACE - Show Regions (and analyze trace buffer) TStart TRACE - Start TStop TRACE - Stop ---- SWO ------------- SWOSpeed SWO - Show supported speeds SWOStart SWO - Start SWOStop SWO - Stop SWOStat SWO - Display SWO status SWORead SWO - Read and display SWO data SWOShow SWO - Read and analyze SWO data SWOFlush SWO - Flush data SWOView SWO - View terminal data ---- PERIODIC -------- PERConf PERIODIC - Configure PERStart PERIODIC - Start PERStop PERIODIC - Stop PERStat PERIODIC - Display status PERRead PERIODIC - Read and display data PERShow PERIODIC - Read and analyze data ---- File I/O -------- fwrite Write file to emulator fread Read file from emulator fshow Read and display file from emulator fdelete Delete file on emulator fsize Display size of file on emulator flist List directory on emulator SecureArea Creates/Removes secure area on probe ---- Test ------------ TestHaltGo Run go/halt 1000 times TestStep Run step 1000 times TestCSpeed Measure CPU speed. Parameters: [] TestWSpeed Measure download speed into target memory. Parameters: [ []] TestRSpeed Measure upload speed from target memory. Parameters: [ [] []] TestNWSpeed Measure network download speed. Parameters: [ []] TestNRSpeed Measure network upload speed. Parameters: [ []] ---- JTAG ------------ JTAGConf Set number of IR/DR bits before ARM device. Syntax: Config , speed Set target interface speed. Syntax: speed |auto|adaptive, e.g. speed 2000, speed a i Read JTAG Id (Host CPU) wjc Write JTAG command (IR). Syntax: wjc (hex) wjd Write JTAG data (DR). Syntax: wjd (hex), (dec) RTAP Reset TAP Controller using state machine (111110) wjraw Write Raw JTAG data. Syntax: wjraw , , rt Reset TAP Controller (nTRST) ---- 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 ---- Connection ------ usb Connect to J-Link via USB. Syntax: usb , where port is 0..3 ip Connect to J-Link ARM Pro or J-Link TCP/IP Server via TCP/IP. Syntax: ip ---- Configuration --- si Select target interface. Syntax: si , where can be any supported target interface (e.g SWD, JTAG, ICSP, FINE, ... power Switch power supply for target. Syntax: power [perm], where State is either On or Off. Example: power on perm wconf Write configuration byte. Syntax: wconf , rconf Read configuration bytes. Syntax: rconf license Shows a list of all available license commands ipaddr Show/Assign IP address and subnetmask of/to the connected J-Link. gwaddr Show/Assign network gateway address of/to the connected J-Link. dnsaddr Show/Assign network DNS server address of/to the connected J-Link. conf Show configuration of the connected J-Link. calibrate Calibrate the target current measurement. selemu Select a emulator to communicate with, from a list of all emulators which are connected to the host The interfaces to search on, can be specified Syntax: selemu [ ...] ShowEmuList Shows a list of all emulators which are connected to the host. The interfaces to search on, can be specified. Syntax: ShowEmuList [ ...] VTREF Sets a fixed value for VTref on J-Link. Syntax: VTREF ---------------------- J-Link>r Reset delay: 0 ms Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit. J-Link>halt PC = 00400744, CycleCnt = 00000000 R0 = 400E1400, R1 = 40004000, R2 = A5000005, R3 = 00000001 R4 = 0F6101F1, R5 = C2004365, R6 = 084E0101, R7 = 20003AB0 R8 = 240E6D26, R9 = B0548870, R10= 05C4A386, R11= 92F44E2C R12= 000344A4 SP(R13)= 20003B28, MSP= 20003B28, PSP= 21120800, R14(LR) = FFFFFFFF XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException) CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00 FPS0 = 00000000, FPS1 = 00000000, FPS2 = 00000000, FPS3 = 00000000 FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000 FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000 FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000 FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000 FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000 FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000 FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000 FPSCR= 00000000 J-Link>erase Erasing device... Comparing flash [100%] Done. Erasing flash [100%] Done. ****** Error: Failed to erase chip @ address 0x00400000 (Algo47: Sector is locked) Failed to erase chip. Failed to execute RAMCode for chip erase! J-Link: Flash download: Total time needed: 5.109s (Prepare: 0.182s, Compare: 0.000s, Erase: 4.872s, Program: 0.000s, Verify: 0.000s, Restore: 0.055s) ERROR: Erase returned with error code -5. J-Link>erase Erasing device... ****** Error: Failed to erase chip @ address 0x00400000 (Algo47: Sector is locked) Failed to erase chip. Failed to execute RAMCode for chip erase! J-Link: Flash download: Total time needed: 5.347s (Prepare: 0.197s, Compare: 0.000s, Erase: 5.075s, Program: 0.000s, Verify: 0.000s, Restore: 0.074s) ERROR: Erase returned with error code -5. J-Link>erase Erasing device... ****** Error: Failed to erase chip @ address 0x00400000 (Algo47: Sector is locked) Failed to erase chip. Failed to execute RAMCode for chip erase! J-Link: Flash download: Total time needed: 5.174s (Prepare: 0.195s, Compare: 0.000s, Erase: 4.901s, Program: 0.000s, Verify: 0.000s, Restore: 0.077s) ERROR: Erase returned with error code -5. J-Link>