Read_register block error S32k142

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

Read_register block error S32k142

跳至解决方案
2,400 次查看
craanede
Contributor III

Hi!

I found an error when using the read register block for S32K142 platform.

The block when opening it tries to search for the list of .mat files in the wrong device folder.

This can be fixed with a work around by just copying the files to that location.

 

Extra note: If this block is used in 2021b, a new error triggers with less feedback, which I cannot solve. due to .p files. However, by clicking OK, the block appears to be usable, but I don't know if the output in code generation will be correct. This extra note links to: Compatibility issue list for matlab R2021b 

error message when running the initialization command of the mask:

>> mbd_s32k_rw_register_init;
Error using fgets
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in fgetl (line 32)
[tline,lt] = fgets(fid);

Error in mbd_s32k_get_periph_clock_list

Error in mbd_s32k_rw_register_init

标记 (1)
0 项奖励
1 解答
2,337 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello @craanede,

Unfortunately, I cannot reproduce this on my setup, but I think that I have a patch to solve this behavior. I am attaching some files which have to be replaced into the MBDT files.

To do so, you have to run the following command in MATLAB winopen(fullfile(mbd_find_s32k_root, 'mbdtbx_s32k', 'mscripts')) and in the newly opened window, to copy the content of the archive (the files are delivered in the same folders as the ones in the current mscripts files in the toolbox).

Can you please apply this patch and check if the registers blocks are now displaying the right information?

Regards,

Marius

在原帖中查看解决方案

标记 (1)
4 回复数
1,056 次查看
rathi_tg
Contributor III

Hi @mariuslucianand 

 I am using read write register in order to get the data from i2c block as I have observed that the data is not cleared in i2c register when the salve is removed after a period of time. So, i am planning to clear the buffer initially before every read operation.

But, when I select the i2c registers from read write Register i get the an error whose snapshot is been added. MATLAB Version 2020a.

rathi_tg_0-1688376735382.png

Regards

Gopal

 

0 项奖励
2,313 次查看
craanede
Contributor III

Hi Michael,

For me the files are located in this directory:

%AppData%\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\mbdtbx_s32k\devices\S32K142\signal_description

The toolbox was looking for the signal description files in the S32k148 or S32k146. So I copied the folder there as a work around.

However, try the solution proposed by NXP with the updated files. That for me also solved the secondary issue in 2021b.

0 项奖励
2,338 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello @craanede,

Unfortunately, I cannot reproduce this on my setup, but I think that I have a patch to solve this behavior. I am attaching some files which have to be replaced into the MBDT files.

To do so, you have to run the following command in MATLAB winopen(fullfile(mbd_find_s32k_root, 'mbdtbx_s32k', 'mscripts')) and in the newly opened window, to copy the content of the archive (the files are delivered in the same folders as the ones in the current mscripts files in the toolbox).

Can you please apply this patch and check if the registers blocks are now displaying the right information?

Regards,

Marius

标记 (1)
2,310 次查看
craanede
Contributor III

Hi @mariuslucianand ,

This solved the issue. I don't get an error message and all the information is available as it is for older versions.

Thank you for the support.

Best regards,

Dennie

0 项奖励