Proteus simulation

Hello
I am a professor of electronics and microcontrollers. Due to covid-19 I can no longer do practical work with my students.
I have PROTEUS ISIS with VSM for ARM.
There are examples on STM32 F401 which work very well.
On the other hand I am unable with the online compiler to compile correctly with the .HEX extension which is recognized by PROTEUS.
I recover the .bin then I create a .hex with the ARM tool
srec_cat.exe a.bin -binary -o a.hex -Intel
I get a .hex, I link it with my PROTEUS scheme, the simulation runs but it doesn’t work.
Can you help me

1 Like

Hi,

You could use Mbed Studio for compiling. If you modify mbed_app.json and add there line
“target.OUTPUT_EXT” : “hex”,
inside of “target_overrides”: {
Mbed Studio will compile and build .hex file. You can use Mbed Cli as well. And you can add / modify the same mbed_app.json file in Online compiler and it will compile hex-file.

Regards,
Pekka

Hi, Pekka

Thank you for help, I tried your solution without success with mbed studio.
I have the error message
[ERROR] Could not parse mbed app configuration from. \ Mbed_app.json

this is my screen

Best regards
Christian Dupaty

Dear Pekka

I have solve my problem, it was a coma problem… sorry

As you see in the picture "target_OUTPUT … was in red

Best regards

Christian Dupaty

Hello,

I can now have a .hex but program does not work.
When i run it on proteus i can read an error message in terminal

This is my program
#include “mbed.h”
#include “platform/mbed_thread.h”
#include “mbed_trace.h”

#define TRACE_GROUP “main”

// Blinking rate in milliseconds
#define BLINKING_RATE_MS 200

int main()
{
DigitalOut led1(LED1); // Nucleo PA_5
DigitalOut led2(PA_6);
DigitalIn btn(PC_12);
Serial pc(SERIAL_TX, SERIAL_RX); // Nucleo PA_2, PA_3
int cpt=0;
pc.printf(“Hello\n”);
mbed_trace_init();
tr_debug(“message d erreur”);
while (true) {
led1 = !led1;
thread_sleep_for(BLINKING_RATE_MS);
if (!btn) led2=1; else led2=0;
pc.printf(“cpt: %d \n”,++cpt);
}
}

I can see on proteus terminal
++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0 : E000ED90
R1 : 200016DC
R2 : 200020D4
R3 : 00000000
R4 : E000ED08
R5 : 00000000
R6 : 00000000
R7 : 080091D3
R8 : 00000000
R9 : 00000000
R10 : 080091F4
R1 : 080091F4
R12 : 00000000
SP : 20017FF0
LR : 080053AB
PC : 080053EA
xPSR : 21000000
PSP : 00000000
MSP : 20017FD0
CPUID: 00000000
HFSR : 00000000
MMFSR: 00000000
BFSR : 00000000
UFSR : 00000000
DFSR : 00000000
AFSR : 00000000
Mode : Thread
Priv : Privileged
Stack: MSP

– MbedOS Fault Handler –

++ MbedOS Error Info +
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x80052CF
Error Value: 0x80053EA
Current Thread: H€GH Id: 0x0 Entry: 0x8000439 StackSize: 0x0 StackMem: 0x8000469 SP: 0x20017F74
For more info, visit: https://mbed.c

Hi, could you please help me with finding the “mbed_app.json” location in the directory?

Hello,

if you not have the mbed_app.json file in your project folder, you can create one.

BR, Jan