Documentation inconsistency or error for MC3377xB Register Write block in MBDT S32K1xx

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

Documentation inconsistency or error for MC3377xB Register Write block in MBDT S32K1xx

跳至解决方案
1,493 次查看
ranulf
Contributor IV

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.

RegisterWriteInSimulink.png

The documentation shows that Reg Value is a UINT16. See below.

RegisterWriteDocs.png

Which is in error? I think the block port is in error because register values have 16 bits.

0 项奖励
回复
1 解答
1,478 次查看
mariuslucianand
NXP Employee
NXP Employee

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

在原帖中查看解决方案

4 回复数
1,474 次查看
ranulf
Contributor IV

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. 

0 项奖励
回复
1,470 次查看
mariuslucianand
NXP Employee
NXP Employee

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

1,462 次查看
ranulf
Contributor IV

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. 

0 项奖励
回复
1,479 次查看
mariuslucianand
NXP Employee
NXP Employee

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