MBDT for S32k344

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

MBDT for S32k344

跳至解决方案
2,835 次查看
mgomez
Contributor II

Can anybody explain me what the bcc_TD_handles block of simulink does? The image below is an example of how to read the MC33775A board. What are the constant numbers of the image? What is the process od adquiring the cell voltages? Does it measure the voltages of all the cells or just of the first module? how can I measure different temperatures?

mgomez_2-1679915956566.png

Thank you!

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

Hello @mgomez,

Can anybody explain me what the bcc_TD_handles block of simulink does?

The purpose of the bcc_TD_handles blocks is to provide access to the buffers used for the exchanged data between the MCU and the S32K3. Because the TD Hanlder is a complex C structure, we chose to add a dedicated block, to provide access to the TD Handler fields information, so that the contents of the register could be extracted from the TD Handlers while the messages have been transferred. TDs are declared inside the external configuration tools and they are available in Simulink blocks because the MBDT reads the settings from the configuration tools project associated with the Simulink model.

mariuslucianand_0-1680084982577.png

 What are the constant numbers of the image? What is the process od adquiring the cell voltages?

The numbers in the screenshot you have added in the post represent the address location in the TD Handler BUffer of the responses, where the register's content information for the measurements are stored. So initially, we requested the BCC to do a primary and secondary chain measurement, and we packed this request in a TD_Hanlder, like you can see below, Once done, we call the TD_Send function, to begin the transfer between the S32K3 and the BCC.

mariuslucianand_2-1680085346848.png

When the exchange is done, we have in the TD handlers, the TPL packets that the BCC has responded with. So basically, we need to identify the location of the registers content in the expected TD handler buffer an retrieve the value, like in the screenshot you have added.

Does it measure the voltages of all the cells or just of the first module?

The current example measures only the voltages from the first module. In order to receive data from all the modules, you have to repeat the process above for the others modules as well, by adjusting the Device Address. You could use Stateflow to periodically switch the Device Address and each step time to read data from other BCC in a round robin approach.

mariuslucianand_3-1680085596546.png

how can I measure different temperatures?

You could identify the registers and commands that handle the temperatures, and complete the request blocks with the actions that read such temperatures. After the transaction is completed, you have to identify the location in the TD Hanlder and convert from RAW to what units you are interested in.

Hope this helps,

Marius

 

 

 

在原帖中查看解决方案

7 回复数
2,770 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello @mgomez,

Can anybody explain me what the bcc_TD_handles block of simulink does?

The purpose of the bcc_TD_handles blocks is to provide access to the buffers used for the exchanged data between the MCU and the S32K3. Because the TD Hanlder is a complex C structure, we chose to add a dedicated block, to provide access to the TD Handler fields information, so that the contents of the register could be extracted from the TD Handlers while the messages have been transferred. TDs are declared inside the external configuration tools and they are available in Simulink blocks because the MBDT reads the settings from the configuration tools project associated with the Simulink model.

mariuslucianand_0-1680084982577.png

 What are the constant numbers of the image? What is the process od adquiring the cell voltages?

The numbers in the screenshot you have added in the post represent the address location in the TD Handler BUffer of the responses, where the register's content information for the measurements are stored. So initially, we requested the BCC to do a primary and secondary chain measurement, and we packed this request in a TD_Hanlder, like you can see below, Once done, we call the TD_Send function, to begin the transfer between the S32K3 and the BCC.

mariuslucianand_2-1680085346848.png

When the exchange is done, we have in the TD handlers, the TPL packets that the BCC has responded with. So basically, we need to identify the location of the registers content in the expected TD handler buffer an retrieve the value, like in the screenshot you have added.

Does it measure the voltages of all the cells or just of the first module?

The current example measures only the voltages from the first module. In order to receive data from all the modules, you have to repeat the process above for the others modules as well, by adjusting the Device Address. You could use Stateflow to periodically switch the Device Address and each step time to read data from other BCC in a round robin approach.

mariuslucianand_3-1680085596546.png

how can I measure different temperatures?

You could identify the registers and commands that handle the temperatures, and complete the request blocks with the actions that read such temperatures. After the transaction is completed, you have to identify the location in the TD Hanlder and convert from RAW to what units you are interested in.

Hope this helps,

Marius

 

 

 

2,277 次查看
yavuzklcc
Contributor III
"You said, 'You could identify the registers and commands that handle the temperatures, and complete the request blocks with the actions that read such temperatures,'
but how can I do this?
For example, if the register I want to read is 186Fh PRMM_PER_AIN0, how do I set which index to send to the TD handler to obtain the information from this register? I'm reading this register when sending 30, but I can't understand why it's 30.
Could you please inform me about this?"
0 项奖励
回复
2,196 次查看
mariuslucianand
NXP Employee
NXP Employee

Hello @yavuzklcc 

Please find the indexes below on additional registers we read inside the example we provide with the MBDT. 

  • index 37, register PRMM_PER_PRMTEMP
  • index 58, register SECM_PER_SECTEMP
  • index 30, register PRMM_PER_AIN0
  • index 31, register PRMM_PER_AIN1
  • index 32, register PRMM_PER_AIN2
  • index 33, register PRMM_PER_AIN3
  • index 51, register SECM_PER_AIN4
  • index 52, register SECM_PER_AIN5
  • index 53, register SECM_PER_AIN6
  • index 54, register SECM_PER_AIN7

TD Handler block allows you to handle the TPL packets sent by the analog front-end and retrieve this kind of information. Basically, the indexes mentioned here contain register information, while the other contains data that is described inside the TPL protocol documents. Please access such documents.

Regards,

Marius

2,188 次查看
yavuzklcc
Contributor III

Hello Marius

I've reviewed almost all of the documents. However, I couldn't establish a connection between the register records and the indices. Could you please explain this to me with just one example? If you can clarify why PRMM_PER_PRMTEMP took the 37th index, I believe I can easily find the others. This is really important for me.I couldnt understand that which is the TPL protocol documents.Can you share with me links related to TPL document.

Thanks..

With Best Regards..

 

 

0 项奖励
回复
2,044 次查看
yavuzklcc
Contributor III
Hello Marius
Is there any progress ?
With best regards
0 项奖励
回复
2,760 次查看
mgomez
Contributor II

Yes thank you!!

Also, I have another question if you could answer me. How can I do an Stateflow to periodically switch the Device Address and each step time to read data from other BCC in a round robin approach is there any example of that? 

There is also a subsystem where the faults appear, how can I know what are those faults and what they verify? 

mgomez_0-1680086524121.png

Could I add an alarm in freemaster or something?

 

2,823 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I have moved your post to MDBT community where the support for MDBT is located.

best regards,

Peter