I'm referring to the block at NXP Model-Based Design Toolbox for S32K1xx MCUs/External Devices/Battery Management System/BMS/MC3377xB Register Write
@mariuslucianand The block in Simulink shows a data type mismatch between the constant (uint16) feeding Reg Value the Reg Value port (uint8). See below.
The documentation shows that Reg Value is a UINT16. See below.
Which is in error? I think the block port is in error because register values have 16 bits.
已解决! 转到解答。
Hello @ranulf,
You are right, the issue is with the block not with the documentation.
To get the right input value type, please replace the mc3377xb_s32k_reg_write.mexw64 file, from the archive attached to the {Toolbox install path}\external_devices\blocks\mc3377xb.
To find the Toolbox install path, please type the mbd_find_s32k_root command in Matlab.
Hope this helps,
Marius
Hi @mariuslucianand ,
I followed your instructions and now the block Reg Value port has the correct data type. However, I have not been successful in changing register values. I can read them but not change them. This perhaps is a different question and issue.
Hello @ranulf ,
I will investigate the behavior that you have mentioned and reply tomorrow. Until then, I remember that I've noticed at some point a reinitialization behavior to the battery cell controller and provided a file called mbdtargetmainlibs32k.tlc that prevents this to happen. I wonder if the block writes the register but due to this reinitialization, the value is set back to reset.
You can find the file that I am talking about here together with instructions. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/How-to-put-S32K-MCU-into-sleep-low-power-m...
Hope this helps,
Marius
Hi Marius,
I followed your instructions and have replaced the indicated file. The file replacement appears to have made it possible or me to write register values!! I need to test, but it looks like the blocks related to cell balancing are changing register values. Please do test yourself.
Hello @ranulf,
You are right, the issue is with the block not with the documentation.
To get the right input value type, please replace the mc3377xb_s32k_reg_write.mexw64 file, from the archive attached to the {Toolbox install path}\external_devices\blocks\mc3377xb.
To find the Toolbox install path, please type the mbd_find_s32k_root command in Matlab.
Hope this helps,
Marius