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
Solved! Go to Solution.
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
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.
Regards
Gopal
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.
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
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