after modify the S32k144_64_flash.ld,the mcu can't run

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

after modify the S32k144_64_flash.ld,the mcu can't run

2,889 Views
yongwan
Contributor III

hi

Hi

When i modify the Linker Files S32k144_64_flash.ld as follow:

 1.png

I download the .elf file to the mcu ,but it cant run ,see picture

 2.png

After that ,i modify the linker files as before see picture:

3.png

And save the file ,then down load the .elf file to the mcu ,and it also cant run.

See pircture

4.png

I just want to make a project work as app relative to bootloader.

0 Kudos
17 Replies

2,599 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I can't read which address you used, but for boot you need boot data and vector table starting from 0x00000000. Flash config needs to be placed to address 0x400. 

Jiri 

0 Kudos

2,599 Views
yongwan
Contributor III

I  know . which address is not important 。my question is that

at first the project is running ok 

after I modify the ld file it can not run

and I modify the ld file as the same as I first used  and it can not run also. 

why ?

0 Kudos

2,599 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

try to check memory if code is back on address 0x00000000. If you stop running - can you see where program ends? 

Jiri 

0 Kudos

2,599 Views
yongwan
Contributor III

now I make a new project ,it can not run I do not know why

0 Kudos

2,601 Views
yongwan
Contributor III

no I can not see where program ends

in order to make the code back on 0x000000000

what should I  do

0 Kudos

2,601 Views
jiri_kral
NXP Employee
NXP Employee

From your tiny screenshot it doesn't look that debugger is disconnected. Just click on Pause button. From disassembly you can identify on which address program ends. Memory you can view in memory tab when MCU is suspended: 

pastedImage_1.png

Jiri

0 Kudos

2,601 Views
yongwan
Contributor III

it ends at 0x000000000 

and a log"no source available for 0x0"disappeared 

0 Kudos

2,601 Views
jiri_kral
NXP Employee
NXP Employee

What about memory content on that address? It is empty (FF FF FF FF ) or is there valid code? 

0 Kudos

2,601 Views
yongwan
Contributor III

it is 00000000

0 Kudos

2,601 Views
jiri_kral
NXP Employee
NXP Employee

Okay, So, there is no valid code on address 0x00000000. Can you please share your project or s-record from your project? 

pastedImage_1.png

Jiri

0 Kudos

2,601 Views
yongwan
Contributor III

. elf or. hex? 

0 Kudos

2,601 Views
jiri_kral
NXP Employee
NXP Employee

s-record (.srec). Elf is okay too. 

0 Kudos

2,601 Views
yongwan
Contributor III

fyi

0 Kudos

2,601 Views
jiri_kral
NXP Employee
NXP Employee

Looks okay. There must be some issue with your j-link? debugger settings. Please check debug session settings and share output from debug console: 

pastedImage_1.png

pastedImage_2.png

0 Kudos

2,601 Views
yongwan
Contributor III

can you share two projects 

one is for boot loader

one is for app

0 Kudos

2,601 Views
yongwan
Contributor III

console log

SEGGER J-Link GDB Server V6.22e Command Line Version

JLinkARM.dll V6.22e (DLL compiled Jan  8 2018 11:44:25)

Command line: -if swd -device S32K144 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----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:      localhost only
Generate logfile:              off
Verify download:               on
Init regs on start:            on
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:                 S32K144
Target interface:              SWD
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V9 compiled May 17 2019 09:50:41
Hardware: V9.40
S/N: 59403398
Feature(s): GDB, RDI, FlashBP, FlashDL, JFlash
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xFFFFFFFE)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 0 0 0x1 0
Failed to enable SWO. Could not measure target CPU frequency.
Read 4 bytes @ address 0xFFFFFFFE (Data = 0x0000A882)
Downloading 1024 bytes @ address 0x00000000 - Verified OK
Downloading 16 bytes @ address 0x00000400 - Verified OK
Downloading 4096 bytes @ address 0x00000410 - Verified OK
Downloading 4096 bytes @ address 0x00001410 - Verified OK
Downloading 4096 bytes @ address 0x00002410 - Verified OK
Downloading 4096 bytes @ address 0x00003410 - Verified OK
Downloading 4096 bytes @ address 0x00004410 - Verified OK
Downloading 4096 bytes @ address 0x00005410 - Verified OK
Downloading 4096 bytes @ address 0x00006410 - Verified OK
Downloading 4096 bytes @ address 0x00007410 - Verified OK
Downloading 4096 bytes @ address 0x00008410 - Verified OK
Downloading 1384 bytes @ address 0x00009410 - Verified OK
Downloading 8 bytes @ address 0x00009978 - Verified OK
Downloading 700 bytes @ address 0x00009980 - Verified OK
WARNING: CPU could not be halted
ERROR: Failed to download RAMCode.
Failed to prepare for programming.
Failed to download RAMCode!
Can not read register 16 (XPSR) while CPU is running
Can not read register 20 (CFBP) while CPU is running
Can not read register 0 (R0) while CPU is running
Can not read register 1 (R1) while CPU is running
Can not read register 2 (R2) while CPU is running
Can not read register 3 (R3) while CPU is running
Can not read register 4 (R4) while CPU is running
Can not read register 5 (R5) while CPU is running
Can not read register 6 (R6) while CPU is running
Can not read register 7 (R7) while CPU is running
Can not read register 8 (R8) while CPU is running
Can not read register 9 (R9) while CPU is running
Can not read register 10 (R10) while CPU is running
Can not read register 11 (R11) while CPU is running
Can not read register 12 (R12) while CPU is running
Can not read register 14 (R14) while CPU is running
Can not read register 15 (R15) while CPU is running
Can not read register 17 (MSP) while CPU is running
Can not read r
Writing register (PC = 0x00000410)
Read 4 bytes @ address 0x00000410 (Data = 0x00000000)
Read 2 bytes @ address 0x000019E6 (Data = 0x0000)
Read 2 bytes @ address 0x000019E6 (Data = 0x0000)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0xFFFFFFFE)
Read 2 bytes @ address 0x000019E6 (Data = 0xFFFF)
Read 2 bytes @ address 0x000019E6 (Data = 0xFFFF)
Read 2 bytes @ address 0x000019E6 (Data = 0xFFFF)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= FFFFFFFC, MSP= FFFFFFFC, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = FFFFFFFE
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
WARNING: Failed to read memory @ address 0xFFFFFFFE
Setting breakpoint @ address 0x000019E6, Size = 2, BPHandle = 0x0001
Starting target CPU...
Debugger requested to halt target...
WARNING: CPU could not be halted
Reading all registers
WARNING: CPU could not be halted
ERROR: Can not read register 0 (R0) while CPU is running
ERROR: Can not read register 1 (R1) while CPU is running
ERROR: Can not read register 2 (R2) while CPU is running
ERROR: Can not read register 3 (R3) while CPU is running
ERROR: Can not read register 4 (R4) while CPU is running
ERROR: Can not read register 5 (R5) while CPU is running
ERROR: Can not read register 6 (R6) while CPU is running
ERROR: Can not read register 7 (R7) while CPU is running
ERROR: Can not read register 8 (R8) while CPU is running
ERROR: Can not read register 9 (R9) while CPU is running
ERROR: Can not read register 10 (R10) while CPU is running
ERROR: Can not read register 11 (R11) while CPU is running
ERROR: Can not read register 12 (R12) while CPU is running
ERROR: Can not read register 13 (R13) while CPU is running
ERROR: Can not read register 14 (R14) while CPU is running
ERROR: Can not read register 15 (R15) while CPU is running
ERROR: Can not read register 16 (XPSR) while CPU is running
ERROR: Can not read register 17 (MSP) while CPU is running
ERROR: Can not read register 18 (PSP) while CPU is running
ERROR: Can not read register 24 (PRIMASK) while CPU is running
ERROR: Can not read register 25 (BASEPRI) while CPU is running
ERROR: Can not read register 26 (FAULTMASK) while CPU is running
ERROR: Can not read register 27 (CONTROL) while CPU is running
ERROR: Can not read register 32 (FPSCR) while CPU is running
ERROR: Can not read register 33 (FPS0) while CPU is running
ERROR: Can not read register 34 (FPS1) while CPU is running
ERROR: Can not read register 35 (FPS2) while CPU is running
ERROR: Can not read register 36 (FPS3) while CPU is running
ERROR: Can not read register 37 (FPS4) while CPU is running
ERROR: Can not read register 38 (FPS5) while CPU is running
ERROR: Can not read register 39 (FPS6) while CPU is running
ERROR: Can not read register 40 (FPS7) while CPU is running
ERROR: Can not read register 41 (FPS8) while CPU is running
ERROR: Can not read register 42 (FPS9) while CPU is running
ERROR: Can not read register 43 (FPS10) while CPU is running
ERROR: Can not read register 44 (FPS11) while CPU is running
ERROR: Can not read register 45 (FPS12) while CPU is running
ERROR: Can not read register 46 (FPS13) while CPU is running
ERROR: Can not read register 47 (FPS14) while CPU is running
ERROR: Can not read register 48 (FPS15) while CPU is running
ERROR: Can not read register 49 (FPS16) while CPU is running
ERROR: Can not read register 50 (FPS17) while CPU is running
ERROR: Can not read register 51 (FPS18) while CPU is running
ERROR: Can not read register 52 (FPS19) while CPU is running
ERROR: Can not read register 53 (FPS20) while CPU is running
ERROR: Can not read register 54 (FPS21) while CPU is running
ERROR: Can not read register 55 (FPS22) while CPU is running
ERROR: Can not read register 56 (FPS23) while CPU is running
ERROR: Can not read register 57 (FPS24) while CPU is running
ERROR: Can not read register 58 (FPS25) while CPU is running
ERROR: Can not read register 59 (FPS26) while CPU is running
ERROR: Can not read register 60 (FPS27) while CPU is running
ERROR: Can not read register 61 (FPS28) while CPU is running
ERROR: Can not read register 62 (FPS29) while CPU is running
ERROR: Can not read register 63 (FPS30) while CPU is running
ERROR: Can not read register 64 (FPS31) while CPU is running
Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
Removing breakpoint @ address 0x000019E6, Size = 2
Reading 64 bytes @ address 0x00000000
Reading 432 bytes @ address 0x00000000
Read 4 bytes @ address 0x00000000 (Data = 0x00000000)
Read 4 bytes @ address 0x00000000 (Data = 0x00000000)

0 Kudos

2,601 Views
yongwan
Contributor III

debug console log

GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: the current language does not match this frame.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000000 in __isr_vector ()

0 Kudos