Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 4 months ago.
nordic platform can't be compiled.
There is a error message as shown below. It will appear, when any Nordic platform is built on the newest mbed-src.
Error: #error directive: "Device family must be defined. See nrf.h." in "mbed-src/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h", Line: 40, Col: 6
Why? Thanks
Question relating to:
![](/media/cache/profiles/af7fc8485f40dc495bc626d6dbe7faf1.50x50_q85.png)
7 Answers
9 years, 4 months ago.
There's new mbed lib v97, I was able to compile nrf demos. I believe this is now fixed also with mbed-src. Can you retest?
Hi Martin,
There are some information for you. 1, import mbed-src, compile nrf.h error. 2, import mbed, compile nrf.h pass. 3, import mbed then convert to library, compile nrf.h error.
Hope these information can help you.
Thanks Marco
posted by 16 Apr 2015I cant comment on his answer, so here For Radu: Update all libraries to the newest one, I did and it compiles ;) At least with mbed library rev97, once I add mbed-src there's an error with Gpio IRQ
posted by 16 Apr 2015Ble Thermometer - update all librareies, so BLE_API is 341, mbed lib is 97, nrf lib is 111. Selected platform - nordic nrf51822 - compiles. Then I remove mbed lib, add mbed-src revs 514 - GPiO error, which I am going to report.
Guys, provide complete details, how can we reproduce it.
posted by 16 Apr 2015I reported this issue I found : https://github.com/mbedmicro/mbed/issues/1045.
I can't reproduce the nrf51 error you are talking about. Share the program, all libraries revisions, platfrom you are compiling for, I'll give it a shot
posted by 16 Apr 20159 years, 4 months ago.
I have just imported http://developer.mbed.org/teams/RedBearLab/code/BLENano_SimpleControls/?platform=RedBearLab-BLE-Nano Same problem
9 years, 4 months ago.
I had the same problem with RedBearLab BLE Nano. It worked good after the following process. 1. Import mbed-src library. 2. Remove the original mbed.bld file. 3. Change the revision of mbed-src to the past one. I have tried the first rev. of Feb. 2015 and it did work successfully.
9 years, 4 months ago.
I am having this problem too. Even with the Blinky or Ble_HeartRate Template I got same error.
9 years, 4 months ago.
Also having the same problem here in multiple projects using RedBearLab BLE Nano.
9 years, 3 months ago.
I to got the same issue while compiling mbed-src. I'm using offline arm-gcc compiler with a custom Makefile. I was able to fix the issue:
diff --git a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h index e77307f..75a42c1 100644 --- a/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h +++ b/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/nrf.h @@ -32,6 +32,8 @@ #ifndef _WIN32 +#define NRF51 + /* Family selection for main includes. NRF51 must be selected. */ #ifdef NRF51 #include "nrf51.h"
May be this is the workaround, not sure!
When below snippet code in nrf.h is commented, the compile is pass.
#error "Device family must be defined. See nrf.h."
Why? Thanks Marco
posted by Marco Hsu 15 Apr 2015I'm getting the same error on the Nordic nRF51-DK platform. Any suggestions on how to fix?
Error: #error directive: "Device family must be defined. See nrf.h." in "extras/mbed_433970e64889/TARGET_NRF51_DK/nrf.h", Line: 40, Col: 6
posted by Rafael Feliciano 15 Apr 2015When I comment that out the compiler doesnt seem to notice the chage. how do you tell it that you edited one of the libarries?
posted by Michael Dietz 16 Apr 2015Marco, did you get yours to work yet? If so, what solution did you use?
posted by William Bransby 17 Apr 2015Working samples here, older mbed i think. http://developer.mbed.org/users/dragosIQ/code/
posted by Radu Radoveneanu 20 Apr 2015