Hi Dear Daniel,
I am following the lecture tutorial (BLDC workshop). In lecture5, when I try to implement the "Event-based hall sensor reading", the FreeMaster will complain that "can't detect the board information".I did a little bit debugging to try to narrow down the problem scope. Finally, I found that when I remove the part circled by green, it works fine. When I add it, the Freemaster won't work properly with generated .elf.
I also attached the source code. Thank you for the help!
Sincerely,
Yujiang Wu
Solved! Go to Solution.
Hello,
I resolved the issue. I think my issue is a combination of execution order and power line noise.
I first used tips from https://community.nxp.com/thread/449904#comment-899761 to make sure that execution order is correct.
Then FreeMaster somehow worked.
Then I was encountering the same problem documented in Event ReadHallSensors Count and Crash
I turned on the filtering option as documented. Then it works fine.
Thanks dumitru-daniel.popa and jjacp for the great material, tips, and discussion.
I think a great take away is that even we are modeling stuff using more user-friendly MBD tool, we still need to keep in mind that execution order does matter. Especially, for peripheral units, initialization first, operation second. We still encounter the noise issue, which does not disappear because we transferred from C code and IDE to MATLAB MBD.
Sincerely,
Yujiang Wu
Hello,
I resolved the issue. I think my issue is a combination of execution order and power line noise.
I first used tips from https://community.nxp.com/thread/449904#comment-899761 to make sure that execution order is correct.
Then FreeMaster somehow worked.
Then I was encountering the same problem documented in Event ReadHallSensors Count and Crash
I turned on the filtering option as documented. Then it works fine.
Thanks dumitru-daniel.popa and jjacp for the great material, tips, and discussion.
I think a great take away is that even we are modeling stuff using more user-friendly MBD tool, we still need to keep in mind that execution order does matter. Especially, for peripheral units, initialization first, operation second. We still encounter the noise issue, which does not disappear because we transferred from C code and IDE to MATLAB MBD.
Sincerely,
Yujiang Wu
Hi Yujiang Wu,
I've retested on my side too.
The only potential issue that might be able to explain such behavior is related with the solver settings.
I changed it from AUTO to 1ms and seems to work just fine.
I've also attached the generated c-code so that you could potentially compare it against yours.
Hope this helps!
Daniel
Hi Dear Daniel,
Thanks for your help. I actually changed the solver before. I guess the version that I uploaded accidentally didn't save it. So in my case, it probably is not the main issue. My suspicion is that if the execution order is not correct and if the peripheral operates before it got initialized, it might cause something weird that preventing FreeMaster working with the UART.
Thanks again for the help and excellent educational material.
sincerely,
Yujiang