This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linker Errors L6218E with ARMCC

I've tried to drop in all non-main code from the spi 5W example into my program and I keep getting the following errors:

.\_build\nrf51422_xxac_s110.axf: Error: L6218E: Undefined symbol ble_gattc_evt_rel_disc_rsp_enc (referred from ble_event.o).
.\_build\nrf51422_xxac_s110.axf: Error: L6218E: Undefined symbol ble_enable_req_dec (referred from conn_mw_ble.o).
.\_build\nrf51422_xxac_s110.axf: Error: L6218E: Undefined symbol ble_enable_rsp_enc (referred from conn_mw_ble.o).

For the case of ble_gattc_evt_rel_disc_rsp_enc, if I go to the reference in ble_events (line 120) and ask the IDE to show me the definition of ble_gattc_evt_rel_disc_rsp_enc it throws up an error message that it can't resolve the reference. When I ask the IDE to show me the reference then it properly brings up the declaration in ble_gattc_evt_conn.h

When I look in the map file it show the linker removing ble_gattc_evt_rel_disc_rsp.o. I'm using the s110 soft device. The ble_gattc_evt_rel_disc_rsp.o file is indeed being generated during builds.

I've looked very carefully in the project options (and project files) to make sure I have all of the same files included as the example project. The file ble_gattc_evt_desc_disc_rsp.c is indeed included in the project as shown in the Manage Project Items/Project Items dialog. I have duplicated the Groups structure used in the SPI 5W example

Is there a reasonable way to do a diff on the configuration files? Any suggestions on how to track down this issue?

Additional info.

This is from the .dep file:

I (..........\components\drivers_nrf\hal\compiler_abstraction.h)(0x54B7F1BA) F (..........\components\serialization\application\codecs\s110\serializers\ble_gattc_evt_rel_disc_rsp.c)(0x54B7F1B0)(-c --cpu Cortex-M0 -D_EVAL -D_MICROLIB -g -O3 --apcs=interwork --split_sections -I..........\components\toolchain -I..........\components\softdevice\s110\headers -I..........\components\ble\common -I..........\components\drivers_nrf\simple_uart -I..........\components\libraries\button -I........\bsp -I..........\components\softdevice\common\softdevice_handler -I..........\components\libraries\timer -I..........\components\libraries\gpiote -I..........\components\drivers_nrf\hal -I..........\components\libraries\scheduler -I..........\components\libraries\util -I..........\components\toolchain\gcc -I......\Foo-Bar -I..........\components\drivers_ext\nrf6350 -I..........\components\drivers_nrf\twi_master -I..........\components\serialization\common\transport\ser_phy -I..........\components\serialization\common\transport -I..........\components\serialization\connectivity -I..........\components\serialization\application\transport -I..........\components\libraries\crc16 -I..........\components\serialization\common -I..........\components\serialization\connectivity\codecs\s110\serializers -I..........\components\serialization\common\struct_ser\s110 -I..........\components\serialization\connectivity\codecs\common -I..........\components\serialization\connectivity\hal -I..........\components\drivers_nrf\uart -I..........\components\serialization\common\transport\ser_phy\config -I..........\components\drivers_nrf\spi_slave -I..........\components\drivers_nrf\spi_master -I..........\components\serialization\connectivity\codecs\s110\middleware -I..........\components\ble\ble_dtm --c99

-I "C:\Nordic Semiconductor\nRF51_SDK_7.2.0_cf547b5\examples\ble_peripheral\foobar-nrf51\pca10028\arm\RTE"

-I C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\7.2.1\Device\Include

-I C:\Keil_v5\ARM\CMSIS\Include

-D__UVISION_VERSION="514" -DNRF51 -DBOARD_PCA10001 -DNRF51 -DBLE_STACK_SUPPORT_REQD -DS110 -DSOFTDEVICE_PRESENT -DDEBUG -DSER_CONNECTIVITY -DAPP_SCHEDULER_WITH_PAUSE -DBLE_STACK_SUPPORT_REQD

-o ._build\ble_gattc_evt_rel_disc_rsp.o --omf_browse ._build\ble_gattc_evt_rel_disc_rsp.crf --depend ._build\ble_gattc_evt_rel_disc_rsp.d)

And this is from the MAP file:

Component: ARM Compiler 5.05 update 1 (build 106) Tool: armlink [4d0efa]

==============================================================================

Section Cross References ... ble_gattc_evt_rel_disc_rsp.o(i.ble_gattc_evt_rel_disc_rsp_dec) refers to ble_serialization.o(i.uint16_t_dec) for uint16_t_dec ble_gattc_evt_rel_disc_rsp.o(i.ble_gattc_evt_rel_disc_rsp_dec) refers to ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_dec) for ble_gattc_evt_rel_disc_rsp_t_dec ... ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_dec) refers to ble_serialization.o(i.uint16_t_dec) for uint16_t_dec ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_dec) refers to ble_gattc_struct_serialization.o(i.ble_gattc_include_t_dec) for ble_gattc_include_t_dec ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_enc) refers to ble_serialization.o(i.uint16_t_enc) for uint16_t_enc ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_enc) refers to ble_gattc_struct_serialization.o(i.ble_gattc_include_t_enc) for ble_gattc_include_t_enc

==============================================================================

Removing Unused input sections from the image.

... Removing ble_gattc_evt_rel_disc_rsp.o(i.ble_gattc_evt_rel_disc_rsp_dec), (242 bytes). .... Removing ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_dec), (92 bytes). Removing ble_gattc_struct_serialization.o(i.ble_gattc_evt_rel_disc_rsp_t_enc), (78 bytes).
  • Hi Scott,

    The issue might be that you have forgotten to press OK after adding your files to Manage Project Items(had this issue a couple of days ago), as Keil does not add the files to your project before you have pressed ok.

    In any case I would recommend that you to switch to .zip style architecture as it is a lot more manageable.

    Could you also post a screenshot of your Keil project structure?

    Best regards,

    Øyvind

  • Øyvind,

    Thanks for the quick answer. Yes, the Keil UI for adding/maintaining project files is a little bit fussy, but I have gone back and done a side by side comparison of the two projects. I may be going cross eyed at this point, but as far as I can tell they are identical as show in both the Project Browser and the Manage Projects Dialog. Not having text files to diff make comparisons problematic. As you can see from the screen captures, ble)enable_rsp.c is included.

    image description

    image description

    image description

  • Hi, sorry for the late reply. I can't see the file ble_gattc_evt_rel_disc_rsp_enc.c in your file structure, only ble_gattc_evt_rel_disc_rsp.c, maybe this is causing your error?

Related