Read_register block error S32k142

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read_register block error S32k142

Jump to solution
2,318 Views
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

Tags (1)
0 Kudos
1 Solution
2,255 Views
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

View solution in original post

Tags (1)
4 Replies
974 Views
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 Kudos
2,231 Views
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 Kudos
2,256 Views
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

Tags (1)
2,228 Views
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 Kudos