2021-02-19 11:14 PM
Hi
This is my first post on this Community. I am not sure I am getting in the right place for questions. If this is a wrong one, please let me know where I can find for help.
I am working on my own console project with VS2019 Community VC++. I have followed the example "STM32CubePrgApi" to have all settings done on my console project. I could compile it without error. But, when I ran it with debug on, I ran in to an exception
"Exception thrown at 0x0000000000000000 in MCP2221Demo.exe 0xC0000005:
Access violation executing location 0x0000000000000000."
This exception looks like a NULL exception to me. The code I was getting this exception is
"int uartConnectFlag = connectUsartBootloader(uartParam[2]);"
I peeked uartParam[2] and got uartParam[2].portName = "COM6". This meant that there was a serial port COM6 but was not allowed to access.
By the way, with same codes above, I could run nicely on "STM32CubePrgApi" example.
General project settings for both projects are
Does any one can help?
Thanks
Rick
2023-04-28 12:02 AM
I got Segmentation Fault on "connectUsartBootloader" - I think it's somehow connected to your problem.
EDIT:
Found solution. In my case the problem was caused by removing DisplayManger.cpp from the project. It seems the display callbacks MUST be set to anything else than NULL, otherwise I always get seg fault.
vsLogMsg.logMessage = DisplayMessage;
vsLogMsg.initProgressBar = InitPBar;
vsLogMsg.loadBar = lBar;
setDisplayCallbacks(vsLogMsg);