redlink server scripting behaviour

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

redlink server scripting behaviour

跳至解决方案
605 次查看
calvinj
Contributor I

Hi, I've been trying to investigate an issue I've been having with the i.MX RT1062 flash driver (using NOR flash connected to FLEXSPI1). In the process of doing so, I've been using the redlinkserv.exe program to view contents of flash.

The issue I've been diagnosing is in some conditions (that I've yet to nail down exactly), the RT1062 is incorrectly reading a constant variable from flash (accessing through the AHB bus, rather than through the FLEXSPI API).

Eg I have the variable boot_img_magic, which is eventually stored at address 0x601201d0:

 

static const uint32_t boot_img_magic[] = {
    0xf395c277U,
    0x7fefd260U,
    0x0f505235U,
    0x8079b62cU
};

 

If I use the following bash script to read it out using redlinkserv:

 

#!/bin/bash
{ 
    echo "probelist"; 
    echo "probeopenbyindex 1"; 
    echo "wireswdconnect 1"; 
    echo "MEMDUMP 1 0 0x601201d0 0x10"; 
    echo "exit"; 
} | /mnt/c/nxp/LinkServer_1.4.85/binaries/redlinkserv.exe --commandline
echo ""

 

Then I get the following (incorrect) output

 

redlink>Index = 1
Manufacturer = NXP Semiconductors
Description = MCU-LINK (r0FF) CMSIS-DAP V3.128
Serial Number = DVXJ42221NGTK
VID:PID = 1FC9:0143
Path = 0002:0015:00

redlink>Probe Handle 1 Open
redlink>DpID = 0BD11477
redlink>601201D0:  77  C2  95  F3  60  D2  EF  7F  40  00  00  00  00  00  00  00  

 

However, if I use the following (functionally identical?) .scp script with redlinkserv

 

1 probelist
2 probeopenbyindex 1
3 wireswdconnect 1
5 MEMDUMP 1 0 0x601201d0 0x10
6 exit

 

And execute it with the following command:

/mnt/c/nxp/LinkServer_1.4.85/binaries/redlinkserv.exe --commandline --script memorydump.scp

Then I get the following (expected) output

 

Index = 1
Manufacturer = NXP Semiconductors
Description = MCU-LINK (r0FF) CMSIS-DAP V3.128
Serial Number = DVXJ42221NGTK
VID:PID = 1FC9:0143
Path = 0002:0015:00

Probe Handle 1 Open
DpID = 0BD11477
601201D0:  77  C2  95  F3  60  D2  EF  7F  35  52  50  0F  2C  B6  79  80

 

This behaviour appears consistent, eg if I run the bash script 2x times, then the scp script, and then the bash script, I get the above outputs each time.

As such, I'm wondering what the difference in behaviour for redlinkserv internally is when running manual commands vs executing a scp script, as there must be some initial setup difference to produce this consistent behaviour. Any elaboration upon this would be greatly appreciated, as I've been unable to find any manuals or documentation regarding how redlinkserv.exe functions.

For reference, I'm running Windows 11 / WSL, using LinkServer 1.4.85, and my redlinkserv version is
"MCUXpresso IDE LinkServer v11.9 (Dec 11 2023 18:02:42 - redlinkserv.exe build 2)"

Cheers

0 项奖励
回复
1 解答
564 次查看
calvinj
Contributor I

For reference, turns out my particular issue was caused by the data cache, as I was able to mark the 0x60000000 region as uncacheable, and everything worked as intended. Still unsure as to why the redlinkserv was returning different results.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
551 次查看
Sam_Gao
NXP Employee
NXP Employee

Hi @calvinj 

Plz see this link for reference, there are some common question we met before.

 

B.R

Sam

 

 

0 项奖励
回复
565 次查看
calvinj
Contributor I

For reference, turns out my particular issue was caused by the data cache, as I was able to mark the 0x60000000 region as uncacheable, and everything worked as intended. Still unsure as to why the redlinkserv was returning different results.

0 项奖励
回复