Page 1 of 1

Proteus Simulation Failure

Posted: Fri Feb 25, 2022 7:01 am
by shenavar
I used to simulate my Arduino code in Proteus simulation software by Labcenter Electronics. I am new in STM32 field and started two weeks ago. My board is BackPill F401CC. It is very easy to program the board using STM32cubeIDE and upload it to board or simulate it using Proteus. However I can program the board using Arduino for STM32 but the resulting HEX file cannot be used in Proteus simulation and fails to simulate. What is the reason. Is there any workaround?

Re: Proteus Simulation Failure

Posted: Fri Feb 25, 2022 8:11 am
by fpiSTM
Hi,

first which core you used ?
What is the requirement for proteus simulation?
Maybe you need to enable debug symbol?

Re: Proteus Simulation Failure

Posted: Fri Feb 25, 2022 3:01 pm
by shenavar
Hi

Re: Proteus Simulation Failure

Posted: Sat Feb 26, 2022 4:57 am
by shenavar
fpiSTM wrote: Fri Feb 25, 2022 8:11 am Hi,

first which core you used ?
What is the requirement for proteus simulation?
Maybe you need to enable debug symbol?
Hi

I don't understand what exactly you mean by CORE. I am new to STM32 and used to work with mega328 most of the time.

As far as I know, the BlackPill F401 is Cortex M4 and I chose the Debug -g for optimization but there is no difference and the simulation doesn't work

By not working simulation I mean that the program runs the simulation but the aim of program which is blinking LED connected to pin 13 of GPIO C doesn't show up. If I use the HEX file produced by STM32cubeIDE, the simulation runs and the LED blinks accordingly.

I brought here the simulation limitation in Proteus from Labcenter Electronics website:

The following is a listing of known limitations in the current version of the ARM® Cortex™-M4:
x Clock security system is not implemented.
x SPI doesn't support IrDA and I2S audio protocols
x I2C::TRISE is not implemented
x I2C doesn't support SMBus protocol
x Tamper detection and backup functionality are not implemented
x Flash programming algorithm is not implemented.
x USB OTG Host capabilities and HNP protocol are not implemented.
x RTC doesn't perform reference clock detection
x RTC doesn't support calibration (RTC_CALR register)
x SDIO is not implemented
x Pins VCAP_1 and VCAP_2 are not modeled
x USART doesn't support Smartcard, LIN, IrDA protocols

Is it possible that one of the aforementioned limitations be the source of the weird Proteus behavior?

Thanks for your attention

Re: Proteus Simulation Failure

Posted: Sat Feb 26, 2022 3:37 pm
by shenavar
Hello everyone

I did a blind search on every possible combination of compile options in Arduino. I found a solution but I cannot explain why. :lol:

Two options should be changed from their default values. The first one is explicitly cast in the Proteus documentation that the optimization flag should be set to Debug -g. The second one is weird. You should choose INACTIVE or NONE for USB support. when those two are combined the resulting HEX file is ok for Proteus simulation.

Now I have this question: Why USB support result in Proteus simulation failure? :?:

Thanks

Re: Proteus Simulation Failure

Posted: Sat Feb 26, 2022 4:07 pm
by fpiSTM
You should ask to proteus😄

Re: Proteus Simulation Failure

Posted: Sat Feb 26, 2022 6:14 pm
by shenavar
fpiSTM wrote: Sat Feb 26, 2022 4:07 pm You should ask to proteus😄
You are right

I didn't check the CubeIDE, but the blink program written in that environment both used Debug mode and USB omission. I guess that if those two settings are in effect, the output of CubeIDE stops working in Proteus too.

Re: Proteus Simulation Failure

Posted: Thu Jun 16, 2022 5:16 am
by cuyrezky
shenavar wrote: Sat Feb 26, 2022 3:37 pm Hello everyone

I did a blind search on every possible combination of compile options in Arduino. I found a solution but I cannot explain why. :lol:

Two options should be changed from their default values. The first one is explicitly cast in the Proteus documentation that the optimization flag should be set to Debug -g. The second one is weird. You should choose INACTIVE or NONE for USB support. when those two are combined the resulting HEX file is ok for Proteus simulation.

Now I have this question: Why USB support result in Proteus simulation failure? :?:

Thanks
hello shenavar,
can you give me tutorial about STM32 with arduino ide and run simulation at proteus application. i new at proteus and STM32, i dont know about proteus documentation that the optimaztion flag should be set to Debug -g. where i can do this in proteus or arduino ? sorry for bad english. iam from asia region. thankyou :D

Re: Proteus Simulation Failure

Posted: Wed Jun 22, 2022 8:47 pm
by bearfoxy6
I used to simulate my Arduino code in Proteus simulation software by Labcenter Electronics.
I am new in STM32 field and started two weeks ago. My board is BackPill F401CC. It is very easy to program the board using STM32cubeIDE and upload it to board or simulate it using Proteus.

However I can program the board using Arduino for STM32 but the resulting HEX file cannot be used in Proteus simulation and fails to simulate.
What is the reason. Is there any workaround?

Re: Proteus Simulation Failure

Posted: Wed Jan 04, 2023 8:11 am
by xlwww
Yes, I also encountered this problem when using F103C6, proteus8.9, after making changes it can be loaded, but the code does not run normally.Have you solved it? Thanks~