Flashing Mini-M4 with Jlink

General discussion on mikroElektronika development boards.
Post Reply
Author
Message
michig54
Posts: 2
Joined: 13 Aug 2023 03:04

Flashing Mini-M4 with Jlink

#1 Post by michig54 » 13 Aug 2023 15:03

I am new to STM and jlink and am having troubling flashing a Mikroe mini-m4 with a jlink edu mini.

I have the following pin connections:

PBA14 -> Pin 4 TCK
PBA13 -> Pin 2 TMS
PBA15 -> Pin 8 TDI
PB3 -> Pin 6 TDO
PB4 -> Pin 10 TRST
Vcc -> Pin 1
GND -> Pins 3,5,9

Image

I created a project for STM3215RG using CubeMx, but when I try to run it using the IDE, I get the following errors:

Code: Select all

SEGGER J-Link GDB Server V7.84e Command Line Version

JLinkARM.dll V7.84e (DLL compiled Feb  1 2023 16:41:39)

Command line: -port 2331 -s -device STM32F415RG -endian little -speed 10 -vd
-----GDB Server start settings-----
GDBInit file:                  none
GDB Server Listening port:     2331
SWO raw output listening port: 2332
Terminal I/O port:             2333
Accept remote connection:      yes
Generate logfile:              off
Verify download:               on
Init regs on start:            off
Silent mode:                   off
Single run mode:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 STM32F415RG
Target device parameters:      none
Target interface:              JTAG
Target interface speed:        10kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link EDU Mini V1 compiled Jun  6 2023 10:50:57
Hardware: V1.00
S/N: 801046201
Feature(s): FlashBP, GDB
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...

J-Link found 2 JTAG devices, Total IRLen = 9
JTAG ID: 0x4BA00477 (Cortex-M4)
Connected to target
Waiting for GDB connection...Connected to 0000:0000:0000:0000:0000:0000:0000:0001
GDB client (conn. 11) requested target.xml from GDB Server
Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000
Read register 'r1' (4 bytes) from hardware: 0x00000000
Read register 'r2' (4 bytes) from hardware: 0x00000000
Read register 'r3' (4 bytes) from hardware: 0x00000000
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0xFCFFFFFF
Read register 'lr' (4 bytes) from hardware: 0xFFFFFFFF
Read register 'pc' (4 bytes) from hardware: 0x00000008
Read register 'xpsr' (4 bytes) from hardware: 0x00000001
WARNING: Failed to read memory @ address 0x08000000
Received monitor command: ReadAPEx 0x0 0xF8
O.K.:0xE00FF003
Received monitor command: ReadMemAP 0x0 0xE00FFFD0 0x8 0x0
O.K.:0x00000000,0x00000000,0x00000000,0x00000000,0x00000011,0x00000004,0x0000000A,0x00000000
Connected to 0000:0000:0000:0000:0000:0000:0000:0001
GDB client (conn. 12) requested target.xml from GDB Server
Reading common registers: WARNING: Failed to read memory @ address 0xFFFFFFFE
Read register 'r0' (4 bytes) from hardware: 0x00000000
WARNING: Failed to read memory @ address 0xFFFFFFFE
Read register 'r1' (4 bytes) from hardware: 0x00000000
Read register 'r2' (4 bytes) from hardware: 0x00000000
Read register 'r3' (4 bytes) from hardware: 0x00000000
Read register 'r4' (4 bytes) from hardware: 0x00000000
Read register 'r5' (4 bytes) from hardware: 0x00000000
Read register 'r6' (4 bytes) from hardware: 0x00000000
Read register 'r7' (4 bytes) from hardware: 0x00000000
Read register 'r8' (4 bytes) from hardware: 0x00000000
Read register 'r9' (4 bytes) from hardware: 0x00000000
Read register 'r10' (4 bytes) from hardware: 0x00000000
Read register 'r11' (4 bytes) from hardware: 0x00000000
Read register 'r12' (4 bytes) from hardware: 0x00000000
Read register 'sp' (4 bytes) from hardware: 0xFCFFFFFF
Read register 'lr' (4 bytes) from hardware: 0xFFFFFFFF
Read register 'pc' (4 bytes) from hardware: 0x00000008
Read register 'xpsr' (4 bytes) from hardware: 0x00000001
WARNING: Failed to read memory @ address 0x08000000
Received monitor command: reset
Resetting target
Downloading 392 bytes @ address 0x08000000 - Verified OK
Downloading 5236 bytes @ address 0x08000188 - Verified OK
Downloading 16 bytes @ address 0x080015FC - Verified OK
Downloading 8 bytes @ address 0x0800160C - Verified OK
Downloading 4 bytes @ address 0x08001614 - Verified OK
Downloading 4 bytes @ address 0x08001618 - Verified OK
Downloading 12 bytes @ address 0x0800161C - Verified OK
Writing register 'pc' = 0x08001538
ERROR: Timeout while calculating CRC, RAMCode did not respond in time (PC = 0x200000EE, XPSR = 0x01000000, SP = 0x200005A0)!Failed to erase sectors 0 @ address 0x08000000 ((erase error))
Failed to erase sectors.

Starting target CPU...
GDB closed TCP/IP connection (Socket 12)
Restoring target state and closing J-Link connection...
Shutting down...

If use JFlashLite using the hex or bin file, then I get the following errors:

Code: Select all

Conecting to J-Link...
Connecting to target...
Downloading...
ERROR: Could not download file.
Done.
I sure I am missing a set somewhere, any help would be appreciated.

Thanks!

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Flashing Mini-M4 with Jlink

#2 Post by filip » 22 Aug 2023 14:52

Hi,

Can you set any programming parameters from J-Link, like COnnect under Reset and similar ?

Regards,
Filip.

Post Reply

Return to “Development Boards”