Timeout: No response of the request msg received
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.
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
Can you please help me to resolve this error. Note: I am executing this code on aarch64 architecture.
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!
Hi @RainerZ ,
Thanks for the reply!
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!
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.)
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.
But in XcpPrintCommand() SHORT_UPLOAD returning address ext 0h as given above image.
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!
Hi sayali0112,
In new v6 version, I made some changes in the CPP_Demo example, which might help to make things clearer. While doing this, I decided to merge the master branch v.5.4 with version V6.0. This was overdue. So just pull from the master branch.
I added some global variables in CCP_DEMO to show measurement and calibration of static address space, for people who just prefer the C++ class wrapper for the XCP driver, but do not intend to deal with dynamic instances.
There is an option to fully disable the dynamic measurement and calibration example code in CPP_Demo: #define OPTION_ENABLE_DYNAMIC_DEMO OFF
There is another option to enable/disable A2L generation (there was, but it should work now): #define OPTION_ENABLE_A2L_GEN OFF
In this case, the automatic detection of A2L file has to be turned off in CANape and Linker Map update may be turned on in the CANape device settings. I have added a second CANape project (CANape_static) to demonstrates these settings. Of course, you need to adjust the path to A2L and Linker file.
The job of ApplXcpGetAddr() is simply to create a valid byte pointer from the XCP address coming from XCP SET_MTA for instance. CANape gets the XCP address from A2L and A2L addresses are usually created or updated with the linker map reader. So it depends on platform and toolchain, how to convert it to a pointer. On Linux 32 bit, there is usually no transformation needed. This may not be the same on QNX with the toolchain you are using. You need to figure it out by yourself. If there are changes needed, we would be happy to take over this code.
I am still unclear, what the reason for the behavior of SHORT_DOWNLOAD is. I cannot reproduce it on Linux x64. May its Linux x86 or its your toolchain on QNX. When debugging, take a look at the macros involved.
Regards Rainer
From: sayali0112 @.> Sent: Friday, February 2, 2024 6:25 AM To: vectorgrp/XCPlite @.> Cc: Zaiser, Rainer @.>; Mention @.> Subject: Re: [vectorgrp/XCPlite] Timeout: No response of the request msg received (Issue #45)
Hello @RainerZhttps://github.com/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.png (view on web)https://github.com/vectorgrp/XCPlite/assets/91561440/00e4d9da-a5f1-4836-849a-4cb13c0a650d
But in XcpPrintCommand() SHORT_UPLOAD returning address ext 0h as given above image. tmp_8144adff-b178-49ec-bffe-7bee2a90918e.png (view on web)https://github.com/vectorgrp/XCPlite/assets/91561440/1858e9ad-848f-4161-8e9f-ae3832e15175
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!
— Reply to this email directly, view it on GitHubhttps://github.com/vectorgrp/XCPlite/issues/45#issuecomment-1922853212, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABAJOU3ZRWXDLFZRAZ3OE7TYRR2DVAVCNFSM6AAAAABCREPFFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRSHA2TGMRRGI. You are receiving this because you were mentioned.Message ID: @.@.>>
Hi @RainerZ, Thanks for the updates. But still I am facing same error.
It was failing inside XcpReadMta() function. It doesn't allow to assign value to *data from *gXcp.MtaPtr pointer.
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!
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