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

Timeout: No response of the request msg received #45

Closed
sayali0112 opened this issue Jan 30, 2024 · 7 comments
Closed

Timeout: No response of the request msg received #45

sayali0112 opened this issue Jan 30, 2024 · 7 comments

Comments

@sayali0112
Copy link

Hello, i am new to xcp, i am trying to execute cpp_demo.exe but while calibrating global parameter. i am facing below error in CANape.
tmp_e05af837-d12f-40cb-8ddb-eac22cadcbc9

After debugging i found that download command not executing and in short_upload command error part is executing, you can refer below image. what do you mean by CRC_OUT_OF_RANGE

tmp_4795ae9f-b9fa-4e87-b6a8-147bc09e8a60

Can you please help me to resolve this error. Note: I am executing this code on aarch64 architecture.

@RainerZ
Copy link
Collaborator

RainerZ commented Jan 31, 2024

Hello,
this error message means, the requested number of bytes to upload, was larger than the available space in the XCP response message. That should be impossible to happen with an int32 variable, while the parameter XCPTL_MAX_CTO_SIZE is set to 252.
I can not reproduce this with latest CANape version. Which version did you try?
What was the actual value of the size parameter (should be 4) and which of the calibration parameters have you tried?
To look deeper into this, it might help us to look at the generated A2L file from your machine.
Thanks!

@sayali0112
Copy link
Author

sayali0112 commented Feb 1, 2024

Hi @RainerZ ,
Thanks for the reply!
image

Sorry for the wrong error code(above image error). Actually it will not showing above error while executing the code. When i trying to calibrating global parameter(uint32_t par_uint32 = 32), it will not executing XcpCommand() switch case. only executing XcpPrintCmd() SHORT_UPLOAD case then terminating the execution.
Note: I am trying to executing this code on QNX OS(aarch64). When i tested on linux OS it is working fine.
Do I need to add logic for A2l address creation for qnx os?

Please find details for your reference.
Which version did you try? --> CANape 21
What was the actual value of the size parameter (should be 4) --> Yes it is 4
which of the calibration parameters have you tried? --> All global parameters [uint8_t par_uint8 = 8; uint16_t par_uint16 = 16; uint32_t par_uint32 = 32; uint64_t par_uint64 = 64; int8_t par_int8 = -8; int16_t par_int16 = -16; int32_t par_int32 = -32; int64_t par_int64 = -64; float par_float = 0.32f; double par_double = 0.64;]

Please find generated A2l code for QNX
/begin CHARACTERISTIC gDebugLevel "" VALUE 0x7A0CA018 R_SLONG 0 NO_COMPU_METHOD -2147483648 2147483647 /end CHARACTERISTIC /begin CHARACTERISTIC par_uint8 "" VALUE 0xF1216008 R_SBYTE 0 NO_COMPU_METHOD -128 127 /end CHARACTERISTIC /begin CHARACTERISTIC par_uint16 "" VALUE 0xF121600A R_SWORD 0 NO_COMPU_METHOD -32768 32767 /end CHARACTERISTIC /begin CHARACTERISTIC par_uint32 "" VALUE 0xF121600C R_SLONG 0 NO_COMPU_METHOD -2147483648 2147483647 /end CHARACTERISTIC /begin CHARACTERISTIC par_uint64 "" VALUE 0xF1216010 R_A_INT64 0 NO_COMPU_METHOD -1E12 1E12 /end CHARACTERISTIC /begin CHARACTERISTIC par_int8 "" VALUE 0xF1216018 R_SBYTE 0 NO_COMPU_METHOD -128 127 /end CHARACTERISTIC /begin CHARACTERISTIC par_int16 "" VALUE 0xF121601A R_SWORD 0 NO_COMPU_METHOD -32768 32767 /end CHARACTERISTIC /begin CHARACTERISTIC par_int32 "" VALUE 0xF121601C R_SLONG 0 NO_COMPU_METHOD -2147483648 2147483647 /end CHARACTERISTIC /begin CHARACTERISTIC par_int64 "" VALUE 0xF1216020 R_A_INT64 0 NO_COMPU_METHOD -1E12 1E12 /end CHARACTERISTIC /begin CHARACTERISTIC par_float "" VALUE 0xF1216028 R_FLOAT32_IEEE 0 NO_COMPU_METHOD 0 1E12 /end CHARACTERISTIC /begin CHARACTERISTIC par_double "" VALUE 0xF1216030 R_FLOAT64_IEEE 0 NO_COMPU_METHOD -1E12 1E12 /end CHARACTERISTIC /begin GROUP TestParameters "" /begin REF_CHARACTERISTIC gDebugLevel par_int8 par_int16 par_int32 par_int64 par_uint8 par_uint16 par_uint32 par_uint64 par_float par_double /end REF_CHARACTERISTIC /end GROUP

Thanks!

@RainerZ
Copy link
Collaborator

RainerZ commented Feb 1, 2024

Ok

Sorry, the code has never been testet on QNX.
We would be happy to add support for QNX and get it running with your help. I am not familiar with QNX, but lets see how far we can get..

Most important thing to make sure is, that ApplXcpGetPointer(gXcp.MtaExt, gXcp.MtaAddr) creates a correct pointer to your calibration variable on QNX.

But another thing should be checked first:
You don't get a response to SHORT_UPLOAD.
My guess is, it goes into dynamic addressing mode and the SHORT_UPLOAD is just pending.
I understood your variable is just a global, not a member variable, which would need dynamic addressing.

The mode check happens a bit hidden in the macro below:
#define check_result(e) { err=(e); if (err!=0) { if (err==CRC_CMD_PENDING) { XcpPushCommand(); goto no_response;} else goto negative_response; } }

It goes in dynamic address mode, when address extension is 1. This happens in XcpWriteMta:
// Ext=0x01 Relativ addressing
#ifdef XCP_ENABLE_DYN_ADDRESSING
if (gXcp.MtaExt == 0x01) {
return CRC_CMD_PENDING; // Async command
}
#endif

So please check first, if XcpWriteMta returns CRC_CMD_PENDING and if yes, why the address extension is set to dynamic addressing mode (=1).

Regards
Rainer

1.)

@sayali0112
Copy link
Author

Hello @RainerZ,
Thanks for reply!

Most important thing to make sure is, that ApplXcpGetPointer(gXcp.MtaExt, gXcp.MtaAddr) creates a correct pointer to your calibration variable on QNX.

As I said program control does not go into switch case of XcpCommand(). The above function(ApplXcpGetPointer(gXcp.MtaExt, gXcp.MtaAddr) is calling from XcpCommand() switchcases like CC_SET_MTA, CC_SHORT_DOWNLOAD and CC_SHORT_UPLOAD.

And XcpWriteMta() it is calling from XcpCommand() switch cases.

tmp_c59a09e4-1f5d-4705-a611-49040d6ec7fa

But in XcpPrintCommand() SHORT_UPLOAD returning address ext 0h as given above image.
tmp_8144adff-b178-49ec-bffe-7bee2a90918e

My question is do we need to add any logic for address creation for a2l file. Because I see in xcpAppl.c their is some platform specific code is given for ApplXcpGetAddr() function. As shown in above image.

I have one more doubt, we can create A2l file using linker map file right? It is not necessary to use a2l.cpp class in application.

If we don't want to call a2l.cpp APIs then we need call only Xcp APIs only right? For that do we have any demo example. It will be very helpful.

Thanks!

@RainerZ
Copy link
Collaborator

RainerZ commented Feb 4, 2024 via email

@sayali0112
Copy link
Author

Hi @RainerZ,
Thanks for the updates. But still I am facing same error.

tmp_54b99699-2e62-4842-97c0-1bac3f9bcd66

It was failing inside XcpReadMta() function. It doesn't allow to assign value to *data from *gXcp.MtaPtr pointer.

tmp_f12f19c8-1eb9-43e8-83c4-d6c4817d79b3

Even if, It contains value. As shown in above image, gXcp.MtaPtr = 3089928206 It goes into while loop of XcpReadMta() function then terminate the code.

Note: Calibration and measurement is working for instance variable for aarch64.

Can you please help me to resolve this issue.

Thanks!

@RainerZ
Copy link
Collaborator

RainerZ commented Feb 13, 2024

Hello,

maybe I misunderstood, what you mean when you say "terminate the code",
Do you get an access violation ?

Please make sure the piece of code below works without terminating or assert:

// Test address conversion functions
uint32_t a = ApplXcpGetAddr((uint8_t*)&par_double);
uint8_t* p = ApplXcpGetPointer(0 /*addr_ext*/, a);
double val = *(double*)p; // read
assert(par_double== val); 
*(double*)p = 100.0; // write
assert(par_double== 100.0);

XCPlite uses direct memory access for static variables. The ApplXxx functions above, provide platform specific address translations from A2L representation (uint8_t,uint32_t) to code in XCPlite using (uint8_t*) (like in XcpReadMta). Note that XCPlite uses address extension 0, to access static memory in the main modules address space. Shared module support is not implemented.

XCPlite is not a Vector product. But if you are a CANape user, I suggest you to contact Vector CANape support to clarify this individually. Please ask for a second level support contact and refer to XCPlite for QNX on ARM architecture.

Regards
Rainer

@RainerZ RainerZ closed this as completed May 27, 2024
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

2 participants