Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCP-Download command problem #150

Open
mladjaa opened this issue Nov 29, 2023 · 13 comments
Open

XCP-Download command problem #150

mladjaa opened this issue Nov 29, 2023 · 13 comments

Comments

@mladjaa
Copy link

mladjaa commented Nov 29, 2023

Hello, I am using XCP protocol for communication with ECU in Python. When I want to write value inside of ECU, I use SET_MTA command, got message from slave "FF" as success, then I use Download command to write value in ECU and always slave respond "FE 23". I found that in error list "Memory location is protected to write". When I try to send same command for same memory location in CANape software, there are no errors (return FF as good and writes value on wished address).
Do you know what is the possible problem for this and how to solve it?

@christoph2
Copy link
Owner

Without context information, I would guess a side-effect of an UNLOCK operation?
Could you post the pyXCP code sequence your are using and most important, the CANape trace, esp. during setup?

@mladjaa
Copy link
Author

mladjaa commented Dec 6, 2023

Here is pictures of Python code and CANape trace window. Please give me your point if view.

20231128_135008.jpg

20231206_142529.jpg

@danielhrisca
Copy link
Contributor

You should also capture the CANape connection part

@mladjaa
Copy link
Author

mladjaa commented Dec 7, 2023

Here is XCP trace (received messages from slave marked yellow), Python Code, and address in A2L file where I want to write a value.

XCP trace.xlsx

Python Code.txt

Address in A2L.png

@danielhrisca
Copy link
Contributor

The excel trace does not contain the TX messages were the XCP commands are sent. Please provide a complete trace recorded when CANape is doing the connect and download

@christoph2
Copy link
Owner

Honestly, I don't know why you are completly bypassing pyXCP...
Are you sure this is a CANape trace?
One would expect CANape issuing GET_STATUS, GET_COMM_MODE_INFO, GET_ID commands after CONNECT.

@mladjaa
Copy link
Author

mladjaa commented Dec 8, 2023

Sorry for misunderstanding, trace file which I sent is trace according to Python Code. Now, I am sending trace files from CANape. Commands are in Trace2 file and marked yellow.

XCP-CANape Trace-2.xlsx

XCP-CANape Trace-1.xlsx

@danielhrisca
Copy link
Contributor

image
Trace 1 starts after CANape has established the XCP connection

@mladjaa
Copy link
Author

mladjaa commented Dec 8, 2023

Yes, but this trace is from beginning, I don't know why skiped CONNECT command.

@danielhrisca
Copy link
Contributor

it is possible that CANape is connecting with mode != 0
image

@mladjaa
Copy link
Author

mladjaa commented Dec 8, 2023

Let's focus please on Python code and DOWNLOAD command problem with error "FE 23"-memory location is protected to write. I found in XCP documentation that parameter which you want to change, first of all, needs to be moved from Flash to RAM, but I am not sure how to do this.
Have you any idea?

@christoph2
Copy link
Owner

The movement is usually done with SET_CAL_PAGE. In the first step you should consult your A2L (if available),
MOD_PAR/MEMORY_SEGMENTs, maybe your address is pageable to RAM.
Optional commands GET_PAG_PROCESSOR_INFO, GET_SEGMENT_INFO, and GET_PAGE_INFO may also helpful.

@mladjaa
Copy link
Author

mladjaa commented Dec 14, 2023

I resolved problem with command "SET_CAL_PAGE".
Thank you for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants