Data integrity protection in i.MX RT MBDT

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

Data integrity protection in i.MX RT MBDT

跳至解决方案
1,634 次查看
Maciek
Contributor V

Hi,

we are in a process of re-designing industrial controller that was developed using an RTOS. To maintain as much compatibility as we can with the previous design - we need to use Simulink messages. The messages are compound objects that use bus objects with enumerations. The message is constructed inside the function-call-subsystem block called by the hardware_interrupt_handler block. The message is then consumed by main application algorithm. This way the message is constructed inside communication peripheral ISR and then consumed inside Timer ISR. I have the following questions:
1. Are there any data integrity protection mechanisms used natively in the generated code ? (I suppose there aren't any...)
2. How can we assure integrity of the compound message (making both interrupts of the same priority can't be done in our application: main algorithm is of lower priority than communication peripheral ISR) ? By using Hardware_Interrupt_Start_Stop block ? Or by writing directly to registers using Write_Register block ?

All these issues were addressed in the previous design using RTOS mutex objects.

Can You comment on that issue ? What are your suggestions ?

Thanks for help
Maciek

标记 (3)
0 项奖励
回复
1 解答
1,612 次查看
nxa11767
NXP Employee
NXP Employee

Hi @Maciek ,

I am not aware of a data integrity mechanism to be incorporated default in the generated code.

if you modify/access the compound message in the interrupt routine then the recommended approach is to disable the timer interrupt when entering the interrupt handler do the work and then enable again the interrupts. Here you can either use the Enable/Disable ISR block that will call EnableIRQ/DisableIRQ  or disable/enable the interrupt source of the timer. For the latter we don't have specific blocks in the toolbox, you can either use register block to write the registers that deal with interrupt sources or use custom code block and call the SDK specific functions in the driver:  e.g void QTMR_DisableInterrupts(TMR_Type *base, qtmr_channel_selection_t channel, uint32_t mask)

Here is also an interesting topic on irq handling: https://mcuoneclipse.com/2015/10/16/nvic-disabling-interrupts-on-arm-cortex-m-and-the-need-for-a-mem...

I hope this helps,

Alexandra

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,613 次查看
nxa11767
NXP Employee
NXP Employee

Hi @Maciek ,

I am not aware of a data integrity mechanism to be incorporated default in the generated code.

if you modify/access the compound message in the interrupt routine then the recommended approach is to disable the timer interrupt when entering the interrupt handler do the work and then enable again the interrupts. Here you can either use the Enable/Disable ISR block that will call EnableIRQ/DisableIRQ  or disable/enable the interrupt source of the timer. For the latter we don't have specific blocks in the toolbox, you can either use register block to write the registers that deal with interrupt sources or use custom code block and call the SDK specific functions in the driver:  e.g void QTMR_DisableInterrupts(TMR_Type *base, qtmr_channel_selection_t channel, uint32_t mask)

Here is also an interesting topic on irq handling: https://mcuoneclipse.com/2015/10/16/nvic-disabling-interrupts-on-arm-cortex-m-and-the-need-for-a-mem...

I hope this helps,

Alexandra

0 项奖励
回复
1,599 次查看
Maciek
Contributor V

Thanks @nxa11767 for clear answer and a reference to the article...

Maciek

0 项奖励
回复