9 years, 1 month ago.

Compiling error with mbed

I get this error compiling: Error: Symbol RTC1_IRQHandler multiply defined (by app_timer.o and app_timer.cpp.NRF51822.o).

I understand that I have to find a multiple define of RTC1_IRQHandler. I can find this definition in app_timer.cpp. But where can I find app_timer-cpp.NRF51822.cpp??? I cannot find this class anywhere!!

Thank you to help, I am new in this mbed.

Question relating to:

An example BLE Health Thermometer using the mbed BLE API and Nordic NRF51822

I don't know the app, but your error is normally caused by the inclusion of the Symbol in a header file.

posted by David Fletcher 13 Mar 2015
posted by jean-marc jobin 14 Mar 2015

OK! First of all thank you for your support David. Yes I follow you on this, but I never include any Symbol. The app is BLE_Health_Thermometer_Blog taken from GIT.

The 2 errors are: Error: Symbol RTC1_IRQHandler multiply defined (by app_timer.o and app_timer.cpp.NRF51822.o). and Error: Symbol SWI0_IRQHandler multiply defined (by app_timer.o and app_timer.cpp.NRF51822.o).

I can find app_timer.cpp but cannot find these Symbol in app_timer.cpp neither in app_timer.h.

I also cannot find app_timer.cpp.NRF51822.cpp nor app_timer.cpp.NRF51822.h

I am not familiar with mbed at all and found quite difficult to make search on it.

Thanks again for your help.

posted by jean-marc jobin 14 Mar 2015

Stop all I found the solution:

I finally found both symbol and they were defined as : extern "C" void RTC1_IRQHandler(void)

I am not aware of what is extern "C" mean in this case, but the fact that it was declared "extern" made it failed.

I cut the declaration "extern "C" on both Symbol and it compile OK.

void RTC1_IRQHandler(void)

I also found this button "advanced" on the main page of the compiler (not always present) and this helped to search in the full application.

Thank you again

Jean-marc

posted by jean-marc jobin 14 Mar 2015

I imported the program into my workspace from the tag in your question, it compiled without error. Maybe your copy from git is a work in progress. Before you remove things like " extern "C" " make sure you do understand what it means. It's easy to google. The advanced button appears when you hit the search button.

posted by David Fletcher 14 Mar 2015

David I fully agree your comment :-D the matter of fact the extern "C" seems to play a role in the Symbol naming. Not using it it will change the Symbol name at compile time... thus avoid multiple declaration. But it is probably not a way to fix this, I do not know...

I took the example from http://developer.mbed.org/blog/entry/Bluetooth-LE-example-on-mbed/

which should be the official version from Donald Morrissey, and use the import button to load it in mbed On-line IDE. I am using mbed on-line IDE and not Keil.

For me it does not compile without these 2 errors. It does compile with my change and load in the Evaluation Kit. It does also switch the led as it should but does not advertise, so I cannot see the device.

Thanks again for your comments and help.

posted by jean-marc jobin 14 Mar 2015

Ok seems fixed now, below what I did (in sequence): 1) Right click on the app and selected "update"... 2) Checked my correction, these were still there so eliminated my correction, mean all was as original 3) Compiled... and no error!!!

Loaded the program in my EVK and can see the device with nrf Master Controller and other utilities..

Still does not work with nrfToolbox but this will be another problem to solve :-)

I have no idea what really happen, some magic or the update did it.

In the context I also never found these multiple declaration.

From here I can go on I will look deeply into this mbed and Nordic

Appreciate your help.

posted by jean-marc jobin 14 Mar 2015
Be the first to answer this question.