Embedded coder code generation error with error in rtwcgfinddsmreuse

When I generate code by embedded coder, the following error occurred.
Code generation assertion 'blkModRef && (*blkModRef).size() == 1' failed in 'b:\matlab\src\simulink\sl_engin\rtwcgfinddsmreuse.cpp:1623'.
I'm trying to figure out which block is causing this error to occur.
It seems to be ok when I command a chart in my model, but I can't see any reason why the error might occur.

댓글 수: 3

blkModRef in a logical test is an implicit comparison blkModRef ~= 0 . And then *blkModRef is used, which is pointer deferencing. So blkModRef ~= 0 is testing a pointer and should better be coded as blkModRef ~= NULL . It is a test to see whether blkModRef points somewhere, followed by testing that if you call the size() function found there that the returned value is 1.
This can fail if blkModRef == NULL or if the size function returns something that is not 1.
NULL pointer is probably the more common problem. When it does not show up through programming error (not initialized properly) then it mostly showed up by running out of memory.
Hi,
Thanks for your quick reply.
If the error is caused by running out of memory, how can I check this problem?
The memory means rom or ram? Or I can delete cache files in disk?
Hi Y.L.,
Could you attach the model files to reproduce the error, so that we could have a better understanding of the problem.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2023년 8월 17일

댓글:

2023년 9월 6일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by