Should I declare my mbed folder as a source folder?

Hi everyone,

I’m having a really hard time making my project compile on SW4STM32. I’m using mbed6.2 and my target is a NUCLEO-L073RZ.
I’m wondering if I have to declare the mbed folder as a source folder or not.

• If I don’t declare it as a source folder, here is what I get: fatal error: stm32l0xx.h: No such file or directory. This error is coming from the file system_stm32l0xx.c. Wheras I have added the path of this header file in the project properties (all languages, all configurations).
In case it has something to do with it, I have added system_stm32l0xx.c in the “Other objects” window in the linker properties.

• If I declare it as a source folder, here is what I get: fatal error: MBED_CONF_TARGET_MAC_ADDR_HIGH undeclared here (and 4 other similar errors), coming from a file named mbed/tools/export/codeblocks/ncs36510trim.c. These variables don’t exist anywhere else in the mbed folder so I don’t know what to do with them.

Do I have to add more files in the “Other objects” window? I don’t have any .o files in the mbed folder so I don’t really know if I should or not.

Thank you for your help!

what os are you using? what tools? Mbed Studio? Mbed CLI? CMake? it’s hard to help without this kind of information.

I’m sorry I have no idea about the tool! How to find this information?
My OS is Linux, the current toolchain I use in my project is Ac6 STM32 MCU GCC, the linker script is STM32L073XZ.ld from the mbed6.2 library, if this is of any help.

Thanks for the info! I also missed the SW4STM32 part of your original post.

I’m not sure mbed is easily compatible with SW4STM32.

If I were you, I’d go with one of the official ways to get mbed up and running:

Thank you for your reply. Unfortunately I’m working from an offline computer and I’m afraid Mbed Studio and Mbed CLI only work with an internet connexion. Can you confirm this?

I got mbed2 running on SW4STM32 so I thought I could do the same with mbed6.

Mbed studio I don’t know, I’m not using it. Mbed CLI, no, you don’t need an internet connection as long as you have downloaded mbed sources the first time.

mbed2 is a lot different than mbed6 and is not really supported. The closer you can get is by using the bare-metal profile in mbed6.

To get started, I would avoid fighting the tools. Follow the official way and when you get a sense of how it’s working, you can create your own process.

I will try Mbed CLI then, thanks a lot for your help!

I’ve set up a simple template that you can follow if needed: https://github.com/ladislas/Bare-mbed-Project/

Thank you very much for that! I will try it this week.