Error: L6218E: Undefined symbol catch_rest (referred from app_task.o).

Hi all,

I am trying to create a passive scanner that will just scan for one particular BLE device name and activate the LED. When I try to build the project i get the following error message:

linking...
.\out_DA14531\Objects\ble_app_barebone_531.axf: Error: L6218E: Undefined symbol catch_rest (referred from app_task.o).
Not enough information to produce a SYMDEFs file.
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 3 information, 0 warning and 1 error messages.
".\out_DA14531\Objects\ble_app_barebone_531.axf" - 1 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:07

I am using the DA14531MOD-00DEVKT-P and have tried other examples.

I am attaching my project files for your reference and any help on this matter is appreciated. If you think I am doing something the hard way or if there is a better way of doing it please do not hesitate to let me know. I am very open to ideas and suggestions.

7827.ble_app_barebone.zip

Parents
  • Hi Audi,

    Thank you for posting your questions online.

    Please check here(7827.ble_app_barebone.zip):

    Quick way: rebuilt the project you will see the errors.

    Thanks

    JH_Renesas

  • Hi there, I solved this issue of mine. I think it was due to some SDK files being edited by mistake that kept bringing up this error. Once I changed it back to the original files it went away.

    But now I have an issue where it seems the code doesnt actually work. I am not sure where I am going wrong. Could you comment on why it may not be working for me?

    I even tried to put in arch_printf() to see where it seems to stop but nothing shows up even though I have a test to see if the suer_scan_start() function ever executes and LED does turn no but no print debug.

    Is there a way to improve or change my code so it works?

    /**
     ****************************************************************************************
     *
     * @file user_barebone.c
     *
     * @brief Barebone project source code.
     *
     * Copyright (C) 2015-2023 Renesas Electronics Corporation and/or its affiliates.
     * All rights reserved. Confidential Information.
     *
     * This software ("Software") is supplied by Renesas Electronics Corporation and/or its
     * affiliates ("Renesas"). Renesas grants you a personal, non-exclusive, non-transferable,
     * revocable, non-sub-licensable right and license to use the Software, solely if used in
     * or together with Renesas products. You may make copies of this Software, provided this
     * copyright notice and disclaimer ("Notice") is included in all such copies. Renesas
     * reserves the right to change or discontinue the Software at any time without notice.
     *
     * THE SOFTWARE IS PROVIDED "AS IS". RENESAS DISCLAIMS ALL WARRANTIES OF ANY KIND,
     * WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. TO THE
     * MAXIMUM EXTENT PERMITTED UNDER LAW, IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT,
     * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM, OUT OF OR IN
     * CONNECTION WITH THE SOFTWARE, EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY OF
     * SUCH DAMAGES. USE OF THIS SOFTWARE MAY BE SUBJECT TO TERMS AND CONDITIONS CONTAINED IN
     * AN ADDITIONAL AGREEMENT BETWEEN YOU AND RENESAS. IN CASE OF CONFLICT BETWEEN THE TERMS
     * OF THIS NOTICE AND ANY SUCH ADDITIONAL LICENSE AGREEMENT, THE TERMS OF THE AGREEMENT
     * SHALL TAKE PRECEDENCE. BY CONTINUING TO USE THIS SOFTWARE, YOU AGREE TO THE TERMS OF
     * THIS NOTICE.IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT PERMITTED TO USE THIS
     * SOFTWARE.
     *
     ****************************************************************************************
     */
    
    /**
     ****************************************************************************************
     * @addtogroup APP
     * @{
     ****************************************************************************************
     */
    
    /*
     * INCLUDE FILES
     ****************************************************************************************
     */
    
    
    #include "app_easy_timer.h"
    #include "user_barebone.h"
    #include "co_bt.h"
    #include "uart.h"
    #include "uart_utils.h"
    #include "arch_console.h"
    
    /*
     * TYPE DEFINITIONS
     ****************************************************************************************
     */
    
     /* 
    	* GLOBAL DEFINITIONS
    	***************************************************************************************
    	*/
    	
    // Scanning interval and window in units of 0.625 ms
    #define SCAN_INTERVAL 0x0030
    #define SCAN_WINDOW   0x0030
    
    // RSSI threshold for detecting the beacon
    #define RSSI_THRESHOLD -40
    
    // Beacon name to search for
    #define BEACON_NAME "dx54321"
    
    /*
     * FUNCTION DEFINITIONS
     ****************************************************************************************
    */
    
    void user_scan_start(void);
    
    
    /**
     ****************************************************************************************
     * @brief Initialising device and setting sleep mode to off
     * @return void
     ****************************************************************************************
     */
     void user_app_on_init(void)
    {
    
        // Set sleep mode
        arch_set_sleep_mode(app_default_sleep_mode);
      
    }
    	
    /**
     ****************************************************************************************
     * @brief Called upon device configuration complete message
     * @return void
     ****************************************************************************************
     */
    void user_on_set_dev_config_complete( void )
    {
    		arch_printf("Dev config complete\r\n");
    		user_scan_start();
    }
    
    /**
     ****************************************************************************************
     * @brief Starts scanning for Bluetooth advertisments
     * @return void
     ****************************************************************************************
     */
    void user_scan_start(void)
    {
        
    		struct gapm_start_scan_cmd* scan_cmd = KE_MSG_ALLOC(GAPM_START_SCAN_CMD, TASK_GAPM, TASK_APP,
                                                            gapm_start_scan_cmd);
        if (scan_cmd == NULL)
        {
            // Handle memory allocation failure
    				arch_printf("Scan command allocation failed\r\n");
            return;
        }
        
        scan_cmd->op.code = GAPM_SCAN_ACTIVE;
        scan_cmd->op.addr_src = GAPM_STATIC_ADDR;
        scan_cmd->interval = SCAN_INTERVAL; // Scan interval
        scan_cmd->window = SCAN_WINDOW;     // Scan window
        scan_cmd->mode = GAP_OBSERVER_MODE;
        scan_cmd->filt_policy = SCAN_ALLOW_ADV_ALL;
        scan_cmd->filter_duplic = SCAN_FILT_DUPLIC_DIS;
    
        // Start scanning
    		arch_printf("Starting scan\r\n");
        ke_msg_send(scan_cmd);
    		
    	GPIO_SetActive(LED_PORT, LED_PIN); // Example pin
    }
    
    /**
     ****************************************************************************************
     * @brief Function to handle advertising report and activate trigger depending on adverts
     * @return void
     ****************************************************************************************
     */
    void user_app_on_adv_report_ind(const struct gapm_adv_report_ind *param)
    {
        const uint8_t *data = param->report.data;
        uint8_t data_len = param->report.data_len;
        bool beacon_found = false;
        
    		arch_printf("Received advertising report\r\n");
    	
        // Search for the beacon name in the advertising data
        for (uint8_t i = 0; i < data_len; )
        {
            uint8_t length = data[i];
            uint8_t ad_type = data[i + 1];
            
            if (ad_type == GAP_AD_TYPE_COMPLETE_NAME && length >= strlen(BEACON_NAME) + 1)
            {
                if (memcmp(&data[i + 2], BEACON_NAME, strlen(BEACON_NAME)) == 0)
                {
    								//arch_printf("Beacon %s found with RSSI %d\r\n", BEACON_NAME, rssi);
                    // Check if the RSSI is within the desired range
                    int8_t rssi = param->report.rssi;
                    if (rssi > RSSI_THRESHOLD)
                    {
                        beacon_found = true;
                        break;
                    }
                }
            }
            
            i += length + 1;
        }
    
        // Set the GPIO pins based on beacon detection
        if (beacon_found)
        {
    				arch_printf("Beacon detected, setting LED\r\n");
            GPIO_SetActive(LED_PORT, LED_PIN); // Example pin
        }
        else
        {
    				arch_printf("Beacon not detected, clearing LED\r\n");
            GPIO_SetInactive(LED_PORT, LED_PIN); // Example pin
        }
    }
    
    /**
     ****************************************************************************************
     * @brief Scan complete function. Restart the scanning
     * @return void
     ****************************************************************************************
     */
    void user_on_scan_complete(const uint8_t param){
    	
    		arch_printf("Scan complete, restarting scan\r\n");
    		user_scan_start();
    }
    
    /**
     ****************************************************************************************
     * @brief Callback from SDK when an unhandled stack event occurs
     * @param[in] msgid ID of message from stack
     * @param[in] param - message data
     * @param[in] dest_id - destination task of message, e.g. TASK_APP
     * @param[in] src_id - task originator of message
     * @return void
     ****************************************************************************************
     */
    void user_catch_rest_hndl(ke_msg_id_t const msgid,
                              void const *param,
                              ke_task_id_t const dest_id,
                              ke_task_id_t const src_id)
    {
        switch(msgid)
        {
            case GAPM_CMP_EVT:
            {
                struct gapm_cmp_evt const *evt = (struct gapm_cmp_evt const *)(param);
                if (evt->operation == GAPM_SCAN_PASSIVE)
                {
                    // Restart scanning after scan completes
                    user_scan_start();
                }
            } break;
            
            default:
                // Handle other unhandled messages
                break;
        }
    }
    
    /// @} APP

  • Hi Audi,

    Could you please provide some infos:

    1, Which SDK you are using.

    2, which example you are using.

    3, Briefly having a description on your goal.

    It seems you want scan for devices under advertising?

    If so, it is impossible, BLE can't work as both central and peripheral. You need change the role when you needed.

    reference: BLE_SDK6_examples/connectivity/multirole at main · dialog-semiconductor/BLE_SDK6_examples · GitHub

    If not, please give us more descriptions 

    Thanks

    JH_Renesas

  • Hi, 

    Thank you for pointing that out to me.

    1. I am using the latest SDK which is 6.0.22.1401

    2. I am using the ble_app_barebone example and I have included the files for it below.

    3. What I am trying to do is the following:
    I have a BLE beacon named dx54321 and what I want to do is that the Dev board will continuously scan for this beacon and determine its RSSI values. If lets say the beacons comes within 4m then it activates the LED (maybe another output in the future). Has soon as the beacon leaves the range then it deactivates the LED. There can be multiple beacons all advertising the same name and they all can trigger the dev board.

    Please find my attached code (also I changed the GAPM_SCAN_ACTIVE to GAPM_SCAN_PASSIVE)

    ble_app_barebone (3).zip

  • Thanks for the reply!

    I am curious as to why you are recommending the central mode? Would it not be better for my system to run in observer mode and just read the advertising packets?

    I am pretty sure advertising packets would contrain the RSSI values or am I misunderstanding it and need to connect to it to read the rssi values?

  • Also when I try to build the central project after linking it following the instructions i get the following error message:

    linking...
    .\out_DA14531\Objects\central_531.axf: Error: L6218E: Undefined symbol my_custom_msg_handlers (referred from arch_rom.o).
    .\out_DA14531\Objects\central_531.axf: Error: L6218E: Undefined symbol patch_func (referred from user_periph_setup.o).
    .\out_DA14531\Objects\central_531.axf: Error: L6218E: Undefined symbol lld_force_timeout_refresh (referred from patch_1.o).
    Not enough information to produce a SYMDEFs file.
    Not enough information to list image symbols.
    Not enough information to list load addresses in the image map.
    Finished: 3 information, 0 warning and 3 error messages.
    ".\out_DA14531\Objects\central_531.axf" - 3 Error(s), 0 Warning(s).
    Target not created.
    Build Time Elapsed:  00:00:09

    Not sure what to do, since nothing was changed.

  • Hi Audi,

    1, Only central mode can scan, only peripheral mode can advertise. You must switch the mode in your software.

    2, From the screenshots you have shared, is that you are trying to debug the project directly from the BLE-SDK examples folder of the GitRepo.
    You should copy/paste the example you are interested in inside your SDK with the rest of the SDK examples included.
    Then use the python script included to fix the paths to your SDK. 
    The rest of the settings seems OK to me. 
    Keil is trying to locate the jlink_DA14531.ini which is part of the SDK folders and not from the GitRepo folder. This is why you cannot debug.

    BR,

    JH_Renesas 

  • Hi JH,

    Thanks for your reply but I have done exactly what you said and even redirected the initialization file to jlink_DA14531.ini  and still get the same error. 

    I even redownloaded the SDK and examples but same error persists. It just won't build.

    The Zip file of the project is attached for your reference.

    1351.central.zip

  • Hi Audi,

    please double click sdk_arch and add the library file from the following path. 

    (SDK path)\sdk\platform\system_library\src\DA14531

Reply Children
No Data