I’m using release mbed-os (#c73413893fb9, tags: mbed-os-6.9.0, mbed-os-6.9.0-rc1)
And I went trough examples of all ROTS APIs to learn use it.
If I hard copy Mutex or Semaphore example and compile it with Mbed Cli “mbed compile -m NUCLEO_L432KC -t GCC_ARM -f” it goers to ++ MbedOS Fault Handler ++
Both examples, the Mutex and the Semaphore, work fine when compiled with Mbed OS 6.15.0 for LPC1768. Maybe there was some issue with revision 6.9.0. So I’d recommend to try 6.15.0.
it runs. Total Static RAM memory (data + bss): 8440(+0) bytes Total Flash memory (text + data): 31332(+28) bytes
But When I keep both thread active, ++ MbedOS Fault Handler ++ appear. Total Static RAM memory (data + bss): 8440(+0) bytes Total Flash memory (text + data): 31336(+4) bytes
This was in console, it it helps:
Th 1:
++ MbedOS Fault Handler ++
FaultType: HardFault
Context:
R 0: 08007861
R 1: 00000000
R 2: 00000000
R 3: 200003B8
R 4: 20000420
R 5: 00000000
R 6: 00000000
R 7: 00000000
R 8: 00000000
R 9: 00000000
R 10: 00000000
R 11: 00000000
R 12: 00000000
SP : 200032B0
LR : 0800426D
PC : 200003B8
xPSR : 00000000
PSP : 20003290
MSP : 2000FFC0
CPUID: 410FC241
HFSR : 40000000
MMFSR: 00000001
BFSR : 00000000
UFSR : 00000000
DFSR : 00000008
AFSR : 00000000
Mode : Thread
Priv : Privileged
Stack: PSP
-- MbedOS Fault Handler --
++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0x200003B8
Error Value: 0x20001FE8
Current Thread: application_unnamed_thread Id: 0x20000498 Entry: 0x8004255 StackSize: 0x1000 StackMem: 0x200022B8 SP: 0x200032B0
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=NUCLEO_L432KC
-- MbedOS Error Info --
{
"name": "rtos",
"config": {
"present": 1,
"main-thread-stack-size": {
"help": "The size of the main thread's stack",
"value": 4096
},
"timer-thread-stack-size": {
"help": "The size of the timer thread's stack",
"value": 768
},
"idle-thread-stack-size": {
"help": "The size of the idle thread's stack",
"value": 512
},
"thread-stack-size": {
"help": "The default stack size of new threads",
"value": 2048
I don’t know why we have it on different files, but it works.
The mbed-os/cmsis/device/rtos/mbed_lib.json is a global configuration file of the rtos library. It is applied to all programs and targets using that library. That’s why it is not recommended to modify it (unless you need a permanent change to be applied to all programs and targets).
As opposed to that, the mbed_app.json is a configuration file used only for a specific application program. It should be created in the root directory of you program. Here you can adapt (override) the global (default) settings according to your needs. Moreover, if you would like to apply it only for a specific target then indicate its name rather than putting an asterisk (*). For example as below: