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

New Module.c file Dependcies Issue in Asset_tracker_v2

I working on Asset_tracker_v2. I need to add event based custom module to the application Asset_tracker_v2. I created follwoing files:

A. In the src/events folder

1. bms_event_module.h and included event_manger.h in it.

2. bms_event_module.c and included bms_module_event.h in it.

3. Added bms_module_event.c to target sources CMakeText File as below: 

     
target_sources(app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/app_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/cloud_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/gps_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/modem_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/data_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/sensor_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/ui_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/debug_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/util_module_event.c
${CMAKE_CURRENT_SOURCE_DIR}/led_state_event.c
${CMAKE_CURRENT_SOURCE_DIR}/bms_module_event.c
)

B. In the src/modules folder: 

4. bms_module.c file and included required files.

5. Kconfig.bms_module file with contents :

#*************************
menuconfig BMS_MODULE
bool "Bms module"
default y

if BMS_MODULE

config BMS_THREAD_STACK_SIZE
int "BMS module thread stack size"
default 512

endif # BMS_MODULE

module = BMS_MODULE
module-str = bms module
source "subsys/logging/Kconfig.template.log_config"

The issues are:

1. There is no dependecies shown in bms_module.c file in the left side pane as shown in attached image

2. The Build error appears , while the file bms_module_event.h  is included the c files  as mentioned above

 

  • Hello, I have myself resolved the issue. I was making a mistake in the function where evnet_submit is called. In that function, I forgot to create new instance of event. The on_state_running() with error is in previus image and the corrected one is in following image.

    0

    After these changes, the Build is successful and the Dependecies also are shown in left side pane for bms_module.c file. Now, I myself verify the answer. 

  • Hi 

    Good to hear you found the issue, thanks for sharing the solution. 

    I will close the case then. 

    Best regards
    Torbjørn

Related