Octal SPI on B-U585

Just declaring the following, using Mbed OS 6.17.0, Mbed Studio 1.4.5 and B_U585I_IOT02A board:

OSPIFBlockDevice obd(OSPI_FLASH1_IO0, OSPI_FLASH1_IO1, OSPI_FLASH1_IO2, OSPI_FLASH1_IO3, OSPI_FLASH1_IO4, OSPI_FLASH1_IO5, OSPI_FLASH1_IO6, OSPI_FLASH1_IO7,
                     OSPI_FLASH1_SCK, OSPI_FLASH1_CSN, OSPI_FLASH1_DQS, OSPIF_POLARITY_MODE_0, MBED_CONF_OSPIF_OSPI_FREQ);

causes the following to be output on the ST-Link VCP before main executes:

++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0   : 00000000
R1   : 00000000
R2   : 00000085
R3   : 00000000
R4   : 00000085
R5   : 00000000
R6   : 00000052
R7   : 0000005C
R8   : 00000085
R9   : 00000000
R10  : 00000053
R11  : 00000079
R12  : 20000614
SP   : 200015F0
LR   : 20000618
PC   : 08007D5C
xPSR : 81000000
PSP  : 20001588
MSP  : 200BFF88
CPUID: 410FD214
HFSR : 40000000
MMFSR: 00000000
BFSR : 00000082
UFSR : 00000000
DFSR : 0000000B
AFSR : 00000000
BFAR : 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: 0x8007D5C
Error Value: 0x200019F0
Current Thread: main Id: 0x20001FD4 Entry: 0x8012DBD StackSize: 0x1000 StackMem: 0x200006C8 SP: 0x200015F0 
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&tgt=B_U585I_IOT02A
-- MbedOS Error Info --

Also, STM32U585 doesn’t seem to be supported by the the debugging tools in Mbed Studio.

I have found an easy work around that works, but this still doesn’t explain why declaring the block device outright doesn’t work. Declaring a QSPIBlockDevice yields the same fault while HeapBlockDevice works as expected.

If you globally declare a block device pointer then allocate in the program, it works as expected, i.e.:

BlockDevice* obd;

Then:

{
    ...
    obd = new OSPIBlockDevice(...,);
    ...
}

Hmm, that implies that declaring OSPIBlockDevice as a global object is what causes the problem. Maybe it has something to do with initialization order, as global objects are constructed before main() is entered. It wouldn’t be the first time I’ve seen odd behavior with a globally declared object with Mbed…

I have run into a number of issues loading LittleFileSystem2 on the B-U585I-IOT02A Rev C02 board so I’m guessing that the STM32U585 mbed target isn’t ready for prime time.

I was able to recognize the octal SPI attached block device and format it with no errors, but after a reboot mounting returns an unknown -9968 error. Before rebooting I am able to do a directory listing and get the expected “.” and “…” entries but creating a file or directory seems to cause random failures. Sometimes: it works, hard faults, doesn’t appear in the listing or the file name is incomplete. It could be the discovery board but it is stock out of the bag and so far haven’t had any issues with any of the other peripherals.

I’ve double checked all the pin assignments and the OSPI CLK is set to 66MHz, well withing the 133MHz capability.

So I think I tracked down the reason for the fault occurring, and being more of an embedded C than C++ person I have some more digging and understanding to do.

Essentially the main.cpp declaration of the octal SPI block device causes the constructor code code to run before a array declarator, allocator and initializer in OSPIFBlockDevice runs before entry to main().

/* Init function to initialize Different Devices CS static list */
static PinName *generate_initialized_active_ospif_csel_arr();
// Static Members for different devices csel
// _devices_mutex is used to lock csel list - only one OSPIFBlockDevice instance per csel is allowed
SingletonPtr<PlatformMutex> OSPIFBlockDevice::_devices_mutex;
int OSPIFBlockDevice::_number_of_active_ospif_flash_csel = 0;
PinName *OSPIFBlockDevice::_active_ospif_flash_csel_arr = generate_initialized_active_ospif_csel_arr();

/********* Public API Functions *********/
/****************************************/
OSPIFBlockDevice::OSPIFBlockDevice(PinName io0, PinName io1, PinName io2, PinName io3, PinName io4, PinName io5, PinName io6, PinName io7, PinName sclk, PinName csel, PinName dqs,
                                   int clock_mode, int freq)
    : _ospi(io0, io1, io2, io3, io4, io5, io6, io7, sclk, csel, dqs, clock_mode), _csel(csel), _freq(freq),
      _init_ref_count(0),
      _is_initialized(false)
{
    _unique_device_status = add_new_csel_instance(csel);


Essentially, I have found that the functionally allocated and initialized “active_ospif_flash_csel_arr” global variable gets called after the OSPIFBlockDevice constructor code gets executed. The following is the

static PinName *generate_initialized_active_ospif_csel_arr()
{
    PinName *init_arr = new PinName[OSPIF_MAX_ACTIVE_FLASH_DEVICES];
    for (int i_ind = 0; i_ind < OSPIF_MAX_ACTIVE_FLASH_DEVICES; i_ind++) {
        init_arr[i_ind] = NC;
    }
    return init_arr;
}

int OSPIFBlockDevice::add_new_csel_instance(PinName csel)
{
    int status = 0;

//!!!!
    if(NULL == _active_ospif_flash_csel_arr) {
        error("ERROR: OSPIFBlockDev.cpp _active_ospif_flash_csel_arr=0x%08x",
            (unsigned)_active_ospif_flash_csel_arr);
    }
//!!!!

    _devices_mutex->lock();
    if (_number_of_active_ospif_flash_csel >= OSPIF_MAX_ACTIVE_FLASH_DEVICES) {
        status = -2;
        goto exit_point;
    }
    // verify the device is unique(no identical csel already exists)
    for (int i_ind = 0; i_ind < OSPIF_MAX_ACTIVE_FLASH_DEVICES; i_ind++) {
        if (_active_ospif_flash_csel_arr[i_ind] == csel) {
            status = -1;
            goto exit_point;
        }
    }

    // Insert new csel into existing device list
    for (int i_ind = 0; i_ind < OSPIF_MAX_ACTIVE_FLASH_DEVICES; i_ind++) {
        if (_active_ospif_flash_csel_arr[i_ind] == NC) {
            _active_ospif_flash_csel_arr[i_ind] = csel;
            break;
        }
    }
    _number_of_active_ospif_flash_csel++;

exit_point:
    _devices_mutex->unlock();
    return status;
}

You will notice the my added NULL check and error() diagnostic in add_new_csel_instance() which prints and halts at that point. If I bypass the guts of add_new_csel_instance() where the NULL array pointer cause the initial fault, the generate_initialized_active_ospif_csel_arr() initialization function is subsequently called. I tried hard allocating and initializing the array with “NC” entries which gets me past the block device declaration. This defeats OSPIF_MAX_ACTIVE_FLASH_DEVICES mechanism.

The init() and parameters gleaned from the block device are as expected and writing and reading of blocks appears to work and check out. Declaring a LittleFileSystem on it and formatting seems to produce the “.” and “…” entries. Immediately rebooting produces a -9968 error on file system mount() which is the ENOENT or no entry error, so evidentially there is more issues.

Again, not being an experienced C++ developer I’m not sure what to make of this and how many other places this mechanism could be affecting the code. Functional initialization of global variables is not something I have any experience with.

The QSPIFBlockDevice seems to use the same mechanism. I have another project that uses QSPI but doesn’t exhibit this fault. It uses a custom target and an STM32H743 so I also don’t have access to a debugger.

Hmm, I need to look into it in more detail, but this smells like your classic “initialization order of static variables is undefined” Heisenbug. In C++, if there are global objects defined in different cpp files, the order that their initializers are called is undefined – could be A before B, or B before A. And what makes it really nasty is, it can change due to random stuff like adding another global variable in a different file or using different compiler version. This makes it really easy to make a global object that references another global object and causes weird behavior only sometimes, when testers are looking the other way. It’s even bitten me at work a few times.

Yup, I took a look at the code, and this did seem to be the problem. I created a PR on Mbed CE to fix the issue: Attempt to fix declaring an OSPIFBlockDevice as a global object by multiplemonomials · Pull Request #167 · mbed-ce/mbed-os · GitHub

Since I don’t have access to a board with OSPI flash, any way you could give it a try?

Looked at the comments and changes and it makes sense to me.

I have been using the ARMmbed/mbed-os repo and MBED Studio so I had to clone the mbed-ce/mbed-os repo to get access to your branch. Has something changed in the mbed-ce fork as I now get the following build error:

c:\Users\tim\AppData\Local\Mbed Studio\mbed-studio-tools\python\python.exe: can’t open file ‘c:\Users\tim\Mbed Programs\discoU585/mbed-os/tools/make.py’: [Errno 2] No such file or directory

The mbed-ce/mbed-os/tools directory seems to be a much abbreviated version of the ARMmbed repo and looking at the documentation Mbed Studio may be the issue. Is there a way to use the mbed-ce/mbed-os with MBED Studio or do I need to convert to VSCode?

Also, QSPIFBlockDevice seems to have the same mechanism as you just fixed in OPSIFBlockDevice.

Hello,

MbedCE uses its own build system based on cmake so it it not compatible with MbedStudio

Home · mbed-ce/mbed-os Wiki (github.com)

BR, Jan

Migrating to mbed-ce will take some time so I merged your 3 file changes with ARMmbed/mbed-os V6.17.0. It solves the constructor fault.

I still have the LittleFileSystem2 -9968 mount error after a reboot. I also tried a reformat->unmount->mount only sequence and get the same error. No insight yet on where the failure is occurring though.

I plan to load the mbed-ce tools and see how that goes but I haven’t had much experience with CMake yet and I’m using the ARM Compiler for some tight fits in small devices like the STM32L072Z. Using GCC ups the code and ram usage. I assume from a licensing aspect, going the mbed-ce route (if possible) would require purchasing an ARM Compiler license for commercial projects?

And remember that the Quad SPI Block Device (QSPIFBlockDevice) uses the same errored initialization method as OSPIFBlockDevice, just in case that got lost in the shuffle.

Cheers!
Tim

Another follow-up test. I swapped out the OSPIFBlockDevice with a HeapBlockDevice and the latter appears to work (albeit obviously not through a reboot).

Unfortunately Mbed CE doesn’t support Arm Compiler currently, largely because it would be difficult to maintain (we don’t have access to arm compiler licenses to test with). So, if you really need Arm Compiler support, you might have to keep using Mbed Studio for those smaller projects.

I loaded the dev tools for mbed-ce on both Windows 10 and Mac OS to test this and the tool chain and I have run through a few issues. Let me know if you would like me to take some or all of this to a new thread.

First off, I seem to be running into some include issues. The “storage”, “connectivity”, and possibly a few other include search directories don’t seem to be set up in the CMake tools, i.e. ‘#include “OSPIFBlockDevice.h”’ is not found. Is there something I’m missing here? Is there a ARMmbed to mbed-ce migration procedure doc?

Tools setup suggestion:

  • I used “STM32Cube” as the UPLOAD_METHOD instead of “STM32CUBE”. Dumb mistake considering the CMake Argument column in the docs, but it took a while to track that one down as the error messages are vague.
  • I did not include “-c” in the list of STM32CUBE_CONNECT_COMMAND

I’m in the “an example is worth a thousand words camp”, which puts me at odds with the purists a lot. Just my $0.02 worth. Also, I did run across an UPLOAD_METHODS doc in my searches that listed out the different added parameters for the various upload methods. Initially I only included the “UPLOAD_METHOD: STM32CUBE” in the cmake-variants.yaml file as I thought the other parameters were defaulted. It must have been an earlier take on the cmake setup tools as they don’t appear to default as I found out. Again, take this with a grain of salt as I’m just providing comments of my experience.

Hi! Glad you found the time to check it out!

#include “OSPIFBlockDevice.h”’ is not found

Hmm, one common reason for this is not linking to the ospif block device library. Make sure you have

target_link_libraries(MyApplication mbed-storage-ospif)

somewhere in your CMakeLists.txt. Yeah, we definitely need better documentation about this part!

I used “STM32Cube” as the UPLOAD_METHOD instead of “STM32CUBE”.

Actually believe it or not I did something really similar last week and you’re right, it is hard to track down. I added a new check in the branch to detect this and fix it.

Initially I only included the “UPLOAD_METHOD: STM32CUBE” in the cmake-variants.yaml file as I thought the other parameters were defaulted

Yeah, they are supposed to be, it’s just that no one has added an upload method configuration file for your target board yet. I wrote one real quick and added it to the branch, any way you could test it out for me?

Also, while I was at it, I added what should be correct default OSPIF pins for your board, so you shouldn’t have to manually configure the pins in your code. That really should have been done when the board was first added but oh well :person_shrugging: . If you do a clean and reconfigure, those should show up after you pull the branch.

Anyway, let me know if that helps you out!

Getting a little closer and learning more about how this works. There doesn’t seem to be a compiled list of the available libraries so I assume you just drill down and look for the name in the add_library() line in the relevant CMakelists.txt file?

I checked out the latest commit of the bugfix/… branch

I added to my project CMakeLists.txt:

target_link_libraries(MyProgram
    mbed-os 
    mbed-storage
    mbed-storage-ospif
) # Can also link to mbed-baremetal here

I need the filesystem and blockdevice libraries but I tried with and without the mbed-storage entry.

I reloaded the build variant with no errors then built:

[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target all --
[build] [1/2  50% :: 1.478] Building CXX object CMakeFiles/MyProgram.dir/MyProgram.cpp.obj
[build] FAILED: CMakeFiles/MyProgram.dir/MyProgram.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @CMakeFiles\MyProgram.dir\MyProgram.cpp.obj.rsp -MD -MT CMakeFiles/MyProgram.dir/MyProgram.cpp.obj -MF CMakeFiles\MyProgram.dir\MyProgram.cpp.obj.d -o CMakeFiles/MyProgram.dir/MyProgram.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/MyProgram.cpp"
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/MyProgram.cpp:3:10: fatal error: OSPIFBlockDevice.h: No such file or directory
[build]     3 | #include "OSPIFBlockDevice.h"
[build]       |          ^~~~~~~~~~~~~~~~~~~~
[build] compilation terminated.
[build] ninja: build stopped: subcommand failed.
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target all -- exited with code: 1
[driver] Build completed: 00:00:01.573
[build] Build finished with exit code 1

I looked in mbed-os/storage/blockdevice/CMakelists.txt and found this:

if("OSPIF" IN_LIST MBED_TARGET_LABELS)
    add_subdirectory(COMPONENT_OSPIF)
endif()

I’m not exactly sure where the list of MBED_TARGET_LABELS is but I do know that the main targets.json file has:

    "B_U585I_IOT02A": {
        "inherits": [
            "MCU_STM32U585xI"
        ],
        "supported_form_factors": [
            "STMOD",
            "PMOD",
            "ARDUINO_UNO"
        ],
        "device_name": "STM32U585AIIx",
        "extra_labels_add": [
            "MX25LM51245G"
        ],
        "components_add": [
            "OSPIF",
            "EMW3080B"
        ],
        "device_has_add": [
            "QSPI",
            "OSPI"
        ],
        "overrides": {
            "network-default-interface-type": "WIFI"
        },
        "detect_code": [
            "887"
        ]
    },

Just for laughs, I commented out the “if(…” and “endif()” lines out of the mbed-os/storage/blockdevice/CMakelists.txt file and I ended up with the following:

[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target all --
[build] [1/3  33% :: 2.525] Building CXX object mbed-os/storage/blockdevice/COMPONENT_OSPIF/CMakeFiles/mbed-storage-ospif.dir/source/OSPIFBlockDevice.cpp.obj
[build] FAILED: mbed-os/storage/blockdevice/COMPONENT_OSPIF/CMakeFiles/mbed-storage-ospif.dir/source/OSPIFBlockDevice.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\storage\blockdevice\COMPONENT_OSPIF\CMakeFiles\mbed-storage-ospif.dir\source\OSPIFBlockDevice.cpp.obj.rsp -MD -MT mbed-os/storage/blockdevice/COMPONENT_OSPIF/CMakeFiles/mbed-storage-ospif.dir/source/OSPIFBlockDevice.cpp.obj -MF mbed-os\storage\blockdevice\COMPONENT_OSPIF\CMakeFiles\mbed-storage-ospif.dir\source\OSPIFBlockDevice.cpp.obj.d -o mbed-os/storage/blockdevice/COMPONENT_OSPIF/CMakeFiles/mbed-storage-ospif.dir/source/OSPIFBlockDevice.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/storage/blockdevice/COMPONENT_OSPIF/source/OSPIFBlockDevice.cpp"
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/storage/blockdevice/COMPONENT_OSPIF/source/OSPIFBlockDevice.cpp: In member function 'virtual mbed::bd_size_t OSPIFBlockDevice::get_read_size() const':
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/storage/blockdevice/COMPONENT_OSPIF/source/OSPIFBlockDevice.cpp:655:12: error: 'MBED_CONF_OSPIF_OSPI_MIN_READ_SIZE' was not declared in this scope; did you mean 'MBED_CONF_OSPIF_OSPI_POLARITY_MODE'?
[build]   655 |     return MBED_CONF_OSPIF_OSPI_MIN_READ_SIZE;
[build]       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build]       |            MBED_CONF_OSPIF_OSPI_POLARITY_MODE
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/storage/blockdevice/COMPONENT_OSPIF/source/OSPIFBlockDevice.cpp: In member function 'virtual mbed::bd_size_t OSPIFBlockDevice::get_program_size() const':
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/storage/blockdevice/COMPONENT_OSPIF/source/OSPIFBlockDevice.cpp:661:12: error: 'MBED_CONF_OSPIF_OSPI_MIN_PROG_SIZE' was not declared in this scope; did you mean 'MBED_CONF_OSPIF_OSPI_IO4'?
[build]   661 |     return MBED_CONF_OSPIF_OSPI_MIN_PROG_SIZE;
[build]       |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[build]       |            MBED_CONF_OSPIF_OSPI_IO4
[build] ninja: build stopped: subcommand failed.
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target all -- exited with code: 1
[driver] Build completed: 00:00:02.602
[build] Build finished with exit code 1

So that at least may point to why OSPIFBlockDevice.h isn’t made available but I’m not exactly sure why since the library entry mbed-storage-ospif supposedly specifies all the way down to it.

I’m not sure why the above 2 defines aren’t defined but, in case it is related to the previous issue, I haven’t drilled any further.

Hmm, that’s odd, if I open build/mbed_config.cmake, I see:

list(APPEND MBED_TARGET_LABELS
...
    OSPIF
...
)

So, that component should be active. But, I will note, I actually found a syntax error in targets.json and fixed it as part of this branch. Maybe your build dir was originally created using the old, broken file? Changes to targets.json currently aren’t picked up unless you do a clean build. So, maybe try doing a clean build and see if OSPIFBlockDevice becomes available.

The compile error you’re getting is also likely due to the target label being incorrectly unavailable.

I pulled the latest branch commit and the only change was the qspif fixes, thanks. So it had to be the build clean.

Using this tool chain, what is the proper way to “clean” the build? I just deleted the target build directory in the build/ directory.

I’m still getting the hang of cmake library specifying but in my trials ran across the following:

mbed-os/storage/platform/CMakelists.txt seems to be missing the following ospif check:

...
if("OSPIF" IN_LIST MBED_TARGET_LABELS)
    list(APPEND mbed-storage-libs mbed-storage-ospif)
endif()
...

LFS2 on the OSPIF now appears to be work, as well as remount after a reboot but I need to bring more of my code up to test manipulating the filesystem.

I am in the middle of debugging overriding the console uart port with a BufferedSerial declaration. I’m in the process of working through this so stay tuned…

One other thing I use are the STM32 Hardware UID field functions: HAL_GetUIDw0(), …1() and …2(). In Mbed Studio they are readily available but they do not appear to be declared/accessible. I’m still trying to figure out the required cmake configuration and/or includes to get these visible. “UID_BASE” is available without any changes so I am using it for now.

Looks like the OSPIFBlockDevice tests fine and I managed to get the rest of the Mbed Studio project moved over. Here is a snapshot of the my boot diagnostics and a couple file system commands.

B-U585I-IOT02A Discovery Test v0.0.1
MBED OS 6.17.0
STM32 UID: 00400051 57525015 20353339
SYSCLK:160M HCLK:160M PCLK1:160M PCLK2:160M
bd(ospif): rdsz:1 pgsz:1 ersz:4096 sz:65536K
fs(lfs2): blksz:4096 blks:16384 free:16377
kvstore(fs) initialized.
ush(vcp): starting...
/>df
Filesystem  4K-blocks  Used Available Use% Mounted on
lfs2            16384     7     16377   0% /
/>ll
/
d 777    4096 .
d 777    4096 ..
d 777    4096 kvstore
- 777       0 readme.txt
/>

You should be able merge the branch when your ready. Thanks for all your help.

Will this fix eventually migrate it’s way back to the ARMmbed/mbed-os repo?

Another include directory issue.

I added mbed-wifi to the project CMakelists.txt:

target_link_libraries(MyProgram
    mbed-os
    mbed-wifi
    mbed-storage-blockdevice
    mbed-storage-filesystem
    mbed-storage-kvstore
) # Can also link to mbed-baremetal here

and to my project .cpp file:

#include "EMW3080BInterface.h"
EMW3080BInterface wifi;

Results in:

[main] Building folder: Hello 
[build] Starting build
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target flash-MyProgram --
[build] [10/136   0% :: 0.309] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080BInterface.cpp.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080BInterface.cpp.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp"
[build] In file included from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080BInterface.cpp:25:
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.h:21:10: fatal error: mbed.h: No such file or directory
[build]    21 | #include "mbed.h"
[build]       |          ^~~~~~~~
[build] compilation terminated.
[build] [10/136   1% :: 0.327] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_EMAC.cpp.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_EMAC.cpp.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp"
[build] In file included from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.cpp:18:
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.h:23:10: fatal error: mbed.h: No such file or directory
[build]    23 | #include "mbed.h"
[build]       |          ^~~~~~~~
[build] compilation terminated.
[build] [10/136   2% :: 0.340] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_UART.cpp.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_UART.cpp.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp"
[build] In file included from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.cpp:21:
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_UART.h:21:10: fatal error: mbed.h: No such file or directory
[build]    21 | #include "mbed.h"
[build]       |          ^~~~~~~~
[build] compilation terminated.
[build] [10/136   2% :: 0.341] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_SPI.cpp.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\EMW3080B_SPI.cpp.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp"
[build] In file included from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.cpp:20:
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_SPI.h:23:10: fatal error: mbed.h: No such file or directory
[build]    23 | #include "mbed.h"
[build]       |          ^~~~~~~~
[build] compilation terminated.
[build] [10/136   3% :: 0.350] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-g++.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi_mbed_os.cpp.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi_mbed_os.cpp.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp"
[build] In file included from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi_mbed_os.cpp:16:
[build] C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/EMW3080B_EMAC.h:23:10: fatal error: mbed.h: No such file or directory
[build]    23 | #include "mbed.h"
[build]       |          ^~~~~~~~
[build] compilation terminated.
[build] [10/136   4% :: 0.360] Building C object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-gcc.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\mx_wifi.c.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\mx_wifi.c.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c"
[build] In file included from c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_conf.h:29,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.h:28,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.c:21:
[build] c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_mbed_os.h:27:10: fatal error: mbed_assert.h: No such file or directory
[build]    27 | #include "mbed_assert.h"
[build]       |          ^~~~~~~~~~~~~~~
[build] compilation terminated.
[build] [10/136   5% :: 0.375] Building C object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-gcc.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_hci.c.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_hci.c.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c"
[build] In file included from c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_conf.h:29,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_hci.c:26:
[build] c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_mbed_os.h:27:10: fatal error: mbed_assert.h: No such file or directory
[build]    27 | #include "mbed_assert.h"
[build]       |          ^~~~~~~~~~~~~~~
[build] compilation terminated.
[build] [10/136   5% :: 0.398] Building C object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-gcc.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_ipc.c.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_ipc.c.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c"
[build] In file included from c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_conf.h:29,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/mx_wifi.h:28,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_ipc.c:28:
[build] c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_mbed_os.h:27:10: fatal error: mbed_assert.h: No such file or directory
[build]    27 | #include "mbed_assert.h"
[build]       |          ^~~~~~~~~~~~~~~
[build] compilation terminated.
[build] [10/136   6% :: 0.409] Building C object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c.obj
[build] FAILED: mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c.obj 
[build] "C:\PROGRA~2\Arm GNU Toolchain arm-none-eabi\12.2 mpacbti-rel1\bin\arm-none-eabi-gcc.exe" @mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_slip.c.obj.rsp -MD -MT mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c.obj -MF mbed-os\connectivity\drivers\wifi\CMakeFiles\mbed-wifi.dir\TARGET_STM\COMPONENT_EMW3080B\mx_wifi\core\mx_wifi_slip.c.obj.d -o mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c.obj -c "C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c"
[build] In file included from c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_conf.h:29,
[build]                  from C:/Users/tim/Mbed Programs/mbed-ce/Hello/mbed-os/connectivity/drivers/wifi/TARGET_STM/COMPONENT_EMW3080B/mx_wifi/core/mx_wifi_slip.c:26:
[build] c:\users\tim\mbed programs\mbed-ce\hello\mbed-os\connectivity\drivers\wifi\target_stm\component_emw3080b\mx_wifi_mbed_os.h:27:10: fatal error: mbed_assert.h: No such file or directory
[build]    27 | #include "mbed_assert.h"
[build]       |          ^~~~~~~~~~~~~~~
[build] compilation terminated.
[build] [10/136   7% :: 0.435] Building CXX object mbed-os/connectivity/drivers/wifi/CMakeFiles/mbed-wifi.dir/esp8266-driver/ESP8266Interface.cpp.obj
[build] ninja: build stopped: subcommand failed.
[proc] The command: "C:\Program Files\CMake\bin\cmake.EXE" --build "c:/Users/tim/Mbed Programs/mbed-ce/Hello/build/B_U585I_IOT02A-Develop" --config Develop --target flash-MyProgram -- exited with code: 1
[driver] Build completed: 00:00:00.515
[build] Build finished with exit code 1

I’m scratching my head on this one.