Mbed forum

nRF52-DK - "platform.h" not found


(Tim H) #1

When compiling a simple mBed OS2 example for the nRF52-DK, I get the following error:

Error: Cannot open source input file “device.h”: No such file or directory in “extras/mbed/platform/platform.h”, Line: 29, Col: 21

According to this page: https://os.mbed.com/cookbook/Compiler-Error-5 - it is because the mbed library version does not support this board.

However according to the platforms page - https://os.mbed.com/platforms/?mbed-os=17&tvend=11 - it does. What gives?


(Ralph Fulchiero) #2

Hi Tim,

Are you using a public example with the Online Compiler? If so - which is it? It’s possible that the example is so old that it pre-dates support for the nRF52-DK. You can try selecting “mbed” in the project (in the left-side Program Workspace) and then right-click to “Update” the version of Mbed in the project. That might fix the problem.

If you are building from the command line (with Mbed CLI), could you send us the steps to recreate the problem? Perhaps you don’t have a valid Mbed project. Mbed OS2 projects can be a little quirkly with the CLI, especially if you have an older version. You can check the version you are using with “mbed --version”.

Regards,
Ralph, Team Mbed