I'm familiarizing myself with DA14585 IoT Multi Sensor Development Kit using Eclipse/GCC. I ran through steps in AN-B064 and successfully compiled and ran debugger with no problems.
我决定尝试和配置空气质量指数per instructions in UM-B-101 section 4.2.4. After defining IAQ_ENABLED I get the following errors:
C:/IoT\u MSK/DA14585\u IOTP/v6.160.4/projects/target\u apps/common/lib/bsec/user\u iaq.C:86:未定义对“bsec\u init”的引用
C:/IoT_MSK/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:99: undefined reference to `bsec_set_state'
C:/IoT_MSK/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:101: undefined reference to `bsec_init'
C:/IoT_MSK/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:117: undefined reference to `bsec_update_subscription'
./bsec_lib/user_iaq.o: In function `update_iaq':
C:/IoT_MSK/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:145: undefined reference to `bsec_sensor_control'
C:/IoT\u MSK/DA14585\u IOTP/v6.160.4/projects/target\u apps/common/lib/bsec/user\u iaq.C:169:未定义对“bsec\u do\u steps”的引用
collect2.exe: error: ld returned 1 exit status
我猜链接器不知道如何处理用户iaq.c。因为只有在定义了IAQ\u ENABLED时,它才存在。
有没有办法解决这个问题?我对Eclipse/GCC显然是个新手。
谢谢
嗨,亲爱的,
谢谢你的在线提问。让我检查一下,试着复制一下,我会尽快给你回复的。
谢谢, PM_Dialog
嗨,亲爱的,
Please read section 4.2.4 Configure for Air Quality Index from theUM-B-101:DA14585物联网多传感器开发工具包开发人员指南document.
The Bosch BSEC Library that computes the Air Quality Index (AQI) is not included in the default configuration (IAQ_ENABLED is undefined). If users would like to compile an image that includes this library, other features should be removed to gain the required memory space. For example, this could be accomplished with the following steps:
1.卸下VCNL4010接近传感器和da1458x\ U config\ U basic.h提供的未定义VCNL4010\光电传感器。
2. Disable "wake on motion" feature by defining ALWAYS_ADVERTISE in user_app_iot_config.h. This also removes the low power configuration parts of ICM426xx driver.
3.禁用快速加速计校准,并在user\u app\u iot\u config.h中取消定义始终使用\u fast\u ACC\u CAL。
4. Build.
5.定义从da1458x_c IAQ_ENABLEDonfig_basic.h
6. Build again. The produced iot585.hex now includes the AQI feature.
谢谢, PM_Dialog
I did read section 4.2.4 Configure for Air Quality Index from UM-B-101 and I thought I followed the instructions correctly. Perhaps I missed something; so, I'll run through them again.
I deleted my entire SDK directory and re-extracted from zip file into C:\DA14585_IOTP_v6.160.4. Then I opened SmartSnippets, went into IDE (remember I'm using Eclipse/GCC) and reimported project so I can start from scratch. I built project, ran debugger and everything is working fine.
1.卸下VCNL4010接近传感器和da1458x\ U config\ U basic.h提供的未定义VCNL4010\光电传感器。
我不太清楚“移除VCNL4010”是什么意思。这是否意味着我应该从电路板上物理删除该部分,或者我应该从项目中删除虚拟文件夹vcnl4010,或者这是否意味着其他什么?我不知道该怎么办;所以,我什么都没做。
我将da1458x\u config\u basic.h中的第75行改为:
#定义VCNL4010光电传感器
to this:
#undef VCNL4010光电传感器可用
Save file.
2. Disable "wake on motion" feature by defining ALWAYS_ADVERTISE in user_app_iot_config.h. This also removes the low power configuration parts of ICM426xx driver.
I'm changing line 24 of user_app_iot_config.h from this:
#undef ALWAYS_ADVERTISE //Disables wake on motion feature
to this:
#define ALWAYS\u advised//禁用运动唤醒功能
Save file.
3.禁用快速加速计校准,并在user\u app\u iot\u config.h中取消定义始终使用\u fast\u ACC\u CAL。
我在user\u app\u iot\u config.h中搜索了ALWAYS\u USE\u FAST\u ACC\u CAL,但它不在那里;但是,有一个USE\u FAST\u ACC\u CAL(前面没有“ALWAYS\u”),所以我认为这是一个拼写错误,将第41行改为:
#定义使用\u快速\u帐户\u校准
to this:
#undef USE_FAST_ACC_CAL
Save file.
4. Build.
我建立,运行调试器,打开物联网传感器,可以看到接近传感器不再工作;所以,我想到目前为止我做的一切都很好。
5.定义从da1458x_c IAQ_ENABLEDonfig_basic.h
我是da1458x\u config\u basic.h的第88行:
#undef IAQ_ENABLED // Include the iAQ library, process gas data on board
to this:
#define IAQ_ENABLED // Include the iAQ library, process gas data on board
Save file.
6. Build again. The produced iot585.hex now includes the AQI feature.
我再次构建,得到7个错误。当我打开控制台时,我在窗口末端看到:
COLLECT_GCC_OPTIONS='-mcpu=cortex-m0' '-mthumb' '-Os' '-fmessage-length=0' '-fsigned-char' '-ffunction-sections' '-fdata-sections' '-g3' '-T' './ldscript_common.lds' '-L../../../../../../projects/target_apps/iot/common_iot_files/lib' '-L../../../../../../SDK_585/sdk/common_project_files/misc' '-L../../../../../../SDK_585/sdk/platform/system_library/output/GCC' '-specs=nano.specs' '-specs=nosys.specs' '-v' '-o' 'iot585.elf'
C:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin / lib / gcc / arm-none-eabi / 7.3.1 / collect2.exe -plugin c:/diasemi/smartsnippetsstudio2.0.10/GCC / 7-2018-Q2 / BIN / ... lib / gcc / arm-none-eabi / 7.3.1 / liblto_plugin-0.dll -plugin-opt = c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2 / bin / bin / arm-none-eabi / 7.3.1 / lto-wrapper.exe -plugin-opt = -freesolution = c:\ david \ appdata \ local \ temp \ ccokcoya.res -plugin-opt = -pasp-tod = -lgcc -plugin-opt = -pass-tout = -lg_nano -plugin-opt = -pasp-tod = -lc_nano -plugin-opt = -pass-tout = -lgcc-plugin-opt = -pasp-opt = -lc_nano -plugin-opt = -pass-opt = -lnosys -plugin-opt = -lgcc-tod = -lgcc -plugin-opt = -pase-tout = -lc_nano -plugin-opt = -pass-tod = -lnosys - sysroot = c:\ diasemi \ smartsnippetsstudio2.0.10 \ gcc \ 7-2018-q2 \ bin \ ../ arm-none-eabi-x -o iot585.elf c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v6-m/crti.o c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v6-m/crtbegin.o c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v6-m/crt0.o -L../../../../../../projects/target_apps/iot/common_iot_files/lib -L../../../../../../SDK_585/sdk/common_project_files/misc -L../../../../../../SDK_585/sdk/platform/system_library/output/GCC -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v6-m -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib/thumb/v6-m -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../arm-none-eabi/lib/thumb/v6-m -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1 -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/lib -Lc:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../arm-none-eabi/lib --gc-sections -Map iot585.map --no-wchar-size-warning ./wkup_adapter/wkup_adapter.o ./vcnl4010/vcnl4010.o ./vcnl4010/vcnl4010_impl.o ./user_sfl/user_sfl_util.o ./user_sensors/user_sensor_config.o ./user_sensors/user_sensor_raw.o ./user_sensors/user_sensor_sfl.o ./user_sensors/user_sensors.o ./user_profiles/dws.o ./user_profiles/dws_task.o ./user_platform/i2c_gpio_extender.o ./user_platform/sensors_periph_interface.o ./user_platform/user_iot_dk_utils.o ./user_platform/user_periph_setup.o ./user_app/user_dws.o ./user_app/user_dws_reports.o ./user_app/user_dws_task.o ./user_app/user_iot.o ./sensors_interface/sensors_interface.o ./sensors_interface/sensors_interface_api.o ./sensor_calibration/basic_acc_cal.o ./sensor_calibration/basic_autocal.o ./sensor_calibration/basic_prox_cal.o ./sensor_calibration/sensor_calibration.o ./sensor_calibration/static_calibration.o ./sdk_profiles/attm_db_128.o ./sdk_profiles/bass.o ./sdk_profiles/bass_task.o ./sdk_profiles/custom_common.o ./sdk_profiles/diss.o ./sdk_profiles/diss_task.o ./sdk_profiles/prf.o ./sdk_profiles/prf_utils.o ./sdk_profiles/proxr.o ./sdk_profiles/proxr_task.o ./sdk_profiles/suotar.o ./sdk_profiles/suotar_task.o ./sdk_driver/adc.o ./sdk_driver/battery.o ./sdk_driver/gpio.o ./sdk_driver/hw_otpc.o ./sdk_driver/sky66111.o ./sdk_driver/spi.o ./sdk_driver/spi_flash.o ./sdk_driver/syscntl.o ./sdk_driver/systick.o ./sdk_driver/timer0.o ./sdk_driver/trng.o ./sdk_driver/uart2.o ./sdk_driver/wkupct_quadec.o ./sdk_boot/hardfault_handler.o ./sdk_boot/ivtable_DA14585_586.o ./sdk_boot/nmi_handler.o ./sdk_boot/startup_DA14585_586.o ./sdk_boot/system_DA14585_586.o ./sdk_ble/rf_585.o ./sdk_ble/rwble.o ./sdk_ble/rwip.o ./sdk_arch/arch_console.o ./sdk_arch/arch_main.o ./sdk_arch/arch_rom.o ./sdk_arch/arch_sleep.o ./sdk_arch/arch_system.o ./sdk_arch/jump_table.o ./sdk_arch/nvds.o ./sdk_app/app.o ./sdk_app/app_bass.o ./sdk_app/app_bass_task.o ./sdk_app/app_customs.o ./sdk_app/app_customs_common.o ./sdk_app/app_customs_task.o ./sdk_app/app_default_handlers.o ./sdk_app/app_diss.o ./sdk_app/app_diss_task.o ./sdk_app/app_easy_msg_utils.o ./sdk_app/app_easy_security.o ./sdk_app/app_easy_timer.o ./sdk_app/app_entry_point.o ./sdk_app/app_msg_utils.o ./sdk_app/app_proxr.o ./sdk_app/app_proxr_task.o ./sdk_app/app_security.o ./sdk_app/app_security_task.o ./sdk_app/app_suotar.o ./sdk_app/app_suotar_task.o ./sdk_app/app_task.o ./icm426xx/Icm426xxDriver.o ./icm426xx/Icm426xxDriver_HL.o ./icm426xx/Icm426xxTransport.o ./icm426xx/Icm426xx_impl.o ./driver_adaptation_layer/environmental_bme680.o ./driver_adaptation_layer/magneto_ak099.o ./driver_adaptation_layer/motion_bmi160.o ./driver_adaptation_layer/motion_icm4X6.o ./driver_adaptation_layer/optical_vcnl4010.o ./bsec_lib/user_iaq.o ./bmi160/bmi160.o ./bmi160/bmi160_impl.o ./bme680/bme680.o ./bme680/bme680_impl.o ./ak09915/ak09915.o ./ak09915/ak09915_impl.o -lsystem_library -lsensor_fusion -lsensor_calibration --start-group -lgcc -lg_nano -lc_nano --end-group --start-group -lgcc -lc_nano -lnosys --end-group --start-group -lgcc -lc_nano -lnosys --end-group c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v6-m/crtend.o c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/thumb/v6-m/crtn.o -T ./ldscript_common.lds
./bsec_lib/user_iaq.o: In function `init_iaq':
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:86: undefined reference to `bsec_init'
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:99: undefined reference to `bsec_set_state'
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:101: undefined reference to `bsec_init'
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:117: undefined reference to `bsec_update_subscription'
./bsec_lib/user_iaq.o: In function `update_iaq':
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:145: undefined reference to `bsec_sensor_control'
C:/DA14585_IOTP_v6.160.4/DA14585_IOTP/v6.160.4/projects/target_apps/common/lib/bsec/user_iaq.c:169: undefined reference to `bsec_do_steps'
collect2.exe: error: ld returned 1 exit status
make:**[iot585.elf]错误1
10:41:19 Build Finished (took 1m:49s.426ms)
Please let me know if I'm doing something wrong.
谢谢
嗨,亲爱的,
我对耽搁表示歉意。我得到了团队的反馈。不幸的是,Bosch库在GCC项目中有很大的内存需求。因此,无法在基于GCC的项目中启用空气质量配置。
谢谢, PM_Dialog
谢谢for the reply.
这些步骤基本上减少了代码的大小,以便在使用Keil进行编译时,空气质量指数代码能够适合。我猜GCC在优化方面不如Keil高效(我不知道,因为我没有访问Keil的权限),但这并不能真正回答为什么有大量未定义的引用指向bsec_init、bsec_set_state、bsec_update_subscription、bec_sensor_control和bsec_do_步骤的问题。
我做了更多的挖掘,看起来这些函数存在于一个名为libalgobsec_full.lib的库中,它与user_iaq.c位于同一个目录中。为了让GCC使用这个库,我经历了一些痛苦。最后,我想出来了,但我得出了相同的结论,这段代码将不适合部分。理论上,我认为其他传感器的更多代码可能会被删除,以使空气质量指数发挥作用,但我不太确定。
I'm including steps I used to get GCC to use the library so that others won't have to figure it out the hard way (like I did).
The linker is already looking for some libraries in /projects/target_apps/iot/common_iot_files/lib. I was able to get the linker to find this library by doing the following steps:
1. Copy libalgobsec_full.lib in /projects/target_apps/common/lib/bsec to /projects/target_apps/iot/common_iot_files
2. Rename the '.lib' extension to '.a' so that file name is 'libalgobsec_full.a' (I noticed the other libraries in this directory had .a versions. When I did a file compare, I noticed the contents of the .lib and .a versions are the same.)
3、在Eclipse中右键单击IOT585项目、属性、C/C++ +通用、路径和符号,然后在库选项卡添加“ALGOBSECGULL”(不要使用“LIB”,确保前面不包括“LIB”)
4. Make sure you define IAQ_ENABLED from step 5 above.
5.Build
Linker should not complain about undefined references to functions above, but now a whole bunch of different errors appear starting with:
c:/diasemi/smartsnippetsstudio2.0.10/gcc/7-2018-q2/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld.exe: iot585.elf section `i.bsec_GasHumidityBaselineTracker_isBaselineAllowedAdapt' will not fit in region `LR_IROM3'
嗨,亲爱的,
Many thanks for your indications and glad that you are able to reduce the code size.
谢谢, PM_Dialog