Dear NXP Developer:
When I using imx8qxp android P automotive version.
I found property int value passing from vehicle driver to vehicle hal occurs error.
int value encoded in function 'vehicle_hal_set_property' in vehicle_core.c.
This value will pass to vehicle hal.
Such as 4 will become 2, 5 will become -3.
Did you find it.
I think it related with encode function.
Could you help fix it ?
Thank you.
I cannot find the code your mentioned. could you tell me more details about this?
VehcileDriver get value from M4 side by rpmsg. such as value is 5 which is int type.
In vehicle_hal_set_property it will encoded by nanopb.
file:/android/vendor/nxp-opensource/kernel_imx/drivers/mxc/vehicle/vehicle_core.c
file : /android/vendor/nxp-opensource/kernel_imx/drivers/mxc/vehicle/vehicle_protocol_callback.c
So, if you pass a value that is u32 type, is the decode value still wrong?
yes, u32 type still wrong
Could you provide the log of the error?
Value mismatch like this:
Driver Send | HAL receive
2 | 1
3 | -2
4 | 2
5 | -3
6 | 3
....
Could you tell me which Android P version are you using?
Hello jimmy:
Android security patch : 2019.1.5
Kernel version : 4.14.98-07194
Android version : Android 9 2.1.0-auto-ga-rc4
BTW, Can you ask question in one case once for all ?
I downloaded the newer version of Android BSP. (imx-p9.0.0_2.1.1-auto-ga.xml)
I found the vehicle_hal_set_property is different now.
please try it.
Hello Jimmy Chan:
Which 2.1.1 version are you using ?
Imx8qxp only release 2.1.0.
Imx8qxm released 2.1.1, but there is no difference in vehicle_hal_set_property .
you mean imx8qxp 2.1.1 verison ?
It still not release on NXP web.
Could you give me a download link ?
imx-manifest - i.MX Release Manifest
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-android-pie -m imx-p9.0.0_2.1.1-auto-ga.xml
hi jimmychan / nxp developers,
I would like to know how did u test this?
vehicle driver to vehicle hal ?
I am looking for CAN communication between CAN driver to Vehicle HAL?
Any idea of running vehicle hal test found here
<sources>packages/services/Car/tests/vehiclehal_test
or
running emulator in
<sources>/hardware/interfaces/automotive/vehicle/2.0/default/tests
Regards,
Ramesh
Please tell me you can reproduce it or not ?
Because I can reproduce this issue 100% on my side.
Add log in file /vendor/nxp-opensource/kernel_imx/drivers/mxc/vehicle/vehicle_protocol_callback.c
212bool encode_value_callback(pb_ostream_t *stream, const pb_field_t *field, void * const *arg)213{ ....237 propvalue.int32_values.arg = &data->value; // using pr_info check it, take value as 5 for example.... }
In below file to check the value received in Vehicle HAL received.
135void VehicleEmulator::doSetProperty(VehicleEmulator::EmulatorMessage& rxMsg,136 VehicleEmulator::EmulatorMessage& respMsg) { { ...157 if (protoVal.int32_values_size() > 0) {158 val.value.int32Values = std::vector<int32_t> { protoVal.int32_values().begin(),159 protoVal.int32_values().end() };160 }// recevice -3 at here. }
File path : /android/vendor/nxp-opensource/kernel_imx/drivers/mxc/vehicle/vehicle_core.c
In this file,function vehicle_hal_set_property will be called for encoding values.
Those value encoded by nanopb and decode by protobuf in HAL.
Please check it again.