Fail to run NUCLEO_IHM03A1 sample code with Mbed Studio

I follow the code sample HelloWorld_IHM03A1. It is working normally if I build the program with online compiler. The bin file works fine with Nucleo-F401RE and IHM03A1. However, if I build the program with Mbed studio, IDE can generate .bin file but I got runtime error:

++ MbedOS Error Info++
Error Status: 0x80010133 Code: 307 Module: 1
Error Message: Mutex: 0x200005BC, Not allowed in ISR context
Localtion: 0x800B6E9
Eorror value: 0x200005BC
Curret Thread: main Id: 0x2000211c Entry: 0x800D15 stacksize: 0x1000 StackMem: 0x200009F8 SP: 0x20001834

– Mbed Error Info–

I have the following hardware & software:
Hardware: Nucleo-F401RE and IHM03A1
Mbed Studio: 0.9.0
Library: mbed-os 5.15.1, X_NUCLEO_IHM03A1

Is this due to some kind of bug with Mbed studio? Why online compiler generated output file is working ok but not Mbed studio for the same source code?

Hi there,

nope that is not a bug, that is correct, because the example is the old one and based on the old MbedOS2, which is without RTOS = no Mutexex = no errors. But the Mbed Studio works only with the MbedOS5 version 5.10+ I think.
Fastest solution what you can do, is set the bare metal profile. That will take RTOS off in the MbedOS5.

BR, Jan

1 Like

Hi Xuan,

@JohnnyK is correct. Mbed Studio on Desktop does not support Mbed OS 2. It is due to the compiler used in Studio (Arm Compiler 6.13). Officially supported versions are 5.12.0 and higher.

As Jan suggested the best solution is to use bare metal profile and update Mbed OS to at least version 5.12.0: https://os.mbed.com/docs/mbed-studio/current/mbed-os/bare-metal.html

Thanks,
Arek