Reply
<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Genius</font></font> </a> YK
Posts: 8
Registered: ‎02-13-2017
Accepted Solution

How to make HaContactSensorSoc work on EFR32MG kits?

I tried to import HaContactSensorSoc to EFR32MG Kit but I get the following build error. How can I define GPIO_SENSOR_PIN correctly and make it work?

 

Errors: 1
Warnings: none

  #error "No definition for GPIO_SENSOR_PIN found.  Select an pin for this plugin and define it to something like 6"
   ^
"C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v1.0\util\plugin\plugin-common\gpio-sensor\gpio-sensor.c",35  Fatal error[Pe035]: #error directive: "No definition for GPIO_SENSOR_PIN found.  Select an pin for this plugin and define it to something like 6"
Fatal error detected, aborting.
Building file: C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0/platform/emlib/src/em_adc.c
make: *** [gpio-sensor/EFR32/gpio-sensor.o] Error 2
make: *** Waiting for unfinished jobs....

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Genius</font></font> </a> YK
Posts: 8
Registered: ‎02-13-2017

Re: How to make HaContactSensorSoc work on EFR32MG kits?

Upated: After adding GPIO_SENSOR_PORT and GPIO_SENSOR_PIN define into gpio-sensor.c, I can solve the build error. However, I end up with the following link error. How can I solve it?

 

Invoking: IAR Linker for ARM
ilinkarm  ./tamper-switch/EFR32/tamper-switch.o  ./simple-main/simple-main.o  ./sim-eeprom1/EFR32/sim-eeprom.o  ./silabs-device-ui/silabs-device-ui.o  ./security-sensor/security-sensor.o  ./reporting/reporting-cli.o ./reporting/reporting.o  ./poll-control-server/poll-control-server.o  ./ota-storage-simple-eeprom/ota-storage-eeprom-page-erase.o ./ota-storage-simple-eeprom/ota-storage-eeprom-read-modify-write.o ./ota-storage-simple-eeprom/ota-storage-eeprom.o  ./ota-storage-simple/ota-storage-simple-simulation.o ./ota-storage-simple/ota-storage-simple.o  ./ota-storage-common/ota-storage-common-cli.o ./ota-storage-common/ota-storage-common.o  ./ota-common/ota-common.o  ./ota-client-policy/ota-client-policy.o  ./ota-client/ota-client-cli.o ./ota-client/ota-client-page-request.o ./ota-client/ota-client-signature-verify.o ./ota-client/ota-client.o  ./ota-bootload/ota-bootload-cli.o ./ota-bootload/ota-bootload-soc.o  ./network-find/network-find.o  ./manufacturing-library-ota/manufacturing-library-ota.o  ./manufacturing-library-cli/manufacturing-library-cli.o  ./led-blink/EFR32/led-blink.o  ./idle-sleep/idle-sleep-cli.o ./idle-sleep/idle-sleep-soc.o ./idle-sleep/idle-sleep.o  ./identify/identify-cli.o ./identify/identify.o  ./ias-zone-server/ias-zone-server-cli.o ./ias-zone-server/ias-zone-server.o  ./i2c-driver/EFR32/em_i2c.o ./i2c-driver/EFR32/i2c-driver-efr32.o ./i2c-driver/EFR32/i2cspm.o  ./hal-library/EFR32/coexistence-efr32.o  ./gpio-sensor/EFR32/gpio-sensor.o  ./generic-interrupt-control/EFR32/generic-interrupt-control-efr32.o  ./form-and-join/form-and-join-afv2.o ./form-and-join/form-and-join-node-adapter.o ./form-and-join/form-and-join.o  ./external-generated-files/bootloader-interface-app.o ./external-generated-files/bootloader-interface.o ./external-generated-files/btl_interface.o ./external-generated-files/btl_interface_storage.o  ./end-device-support/end-device-move.o ./end-device-support/end-device-support-cli.o ./end-device-support/end-device-support.o ./end-device-support/polling-common.o ./end-device-support/polling-soc.o  ./emlib/em_adc.o ./emlib/em_cmu.o ./emlib/em_core.o ./emlib/em_emu.o ./emlib/em_gpio.o ./emlib/em_ldma.o ./emlib/em_leuart.o ./emlib/em_mpu.o ./emlib/em_msc.o ./emlib/em_prs.o ./emlib/em_rmu.o ./emlib/em_rtcc.o ./emlib/em_system.o ./emlib/em_timer.o ./emlib/em_usart.o ./emlib/em_wdog.o ./emlib/system_efr32mg1p.o  ./emdrv/dmadrv.o ./emdrv/gpiointerrupt.o ./emdrv/rtcdriver.o ./emdrv/sleep.o ./emdrv/spidrv.o ./emdrv/tempdrv.o ./emdrv/uartdrv.o ./emdrv/ustimer.o  ./ember-minimal-printf/ember-printf.o  ./efr32/assert-crash-handlers.o ./efr32/button.o ./efr32/buzzer-efr32.o ./efr32/com.o ./efr32/cstartup-common.o ./efr32/diagnostic.o ./efr32/ext-device.o ./efr32/faults-v7m.o ./efr32/isr-stubs.o ./efr32/led.o ./efr32/mfg-token.o ./efr32/micro-common.o ./efr32/micro.o ./efr32/mpu.o ./efr32/sleep-efm32.o ./efr32/token.o  ./eeprom/eeprom-cli.o ./eeprom/eeprom.o  ./debug-basic-library/EFR32/SEGGER_RTT.o  ./connection-manager/connection-manager-cli.o ./connection-manager/connection-manager.o  ./configuration-server/configuration-server-cli.o ./configuration-server/configuration-server.o  ./button-interface/EFR32/button-interface.o  ./basic/basic.o  ./antenna-stub/antenna-stub.o  ./address-table/address-table-cli.o ./address-table/address-table.o  ./adc/EFR32/adc-efr32.o  ./HaContactSensorSoc_callbacks.o ./af-event.o ./af-main-common.o ./af-main-soc.o ./af-node.o ./af-security-common.o ./af-trust-center.o ./afv2-bookkeeping.o ./attribute-size.o ./attribute-storage.o ./attribute-table.o ./call-command-handler.o ./callback-stub.o ./callbacks.o ./cli.o ./client-api.o ./command-interpreter2.o ./core-cli.o ./crc.o ./crypto-state.o ./descriptors.o ./em_usbd.o ./em_usbdch9.o ./em_usbdep.o ./em_usbhal.o ./em_usbint.o ./em_usbtimer.o ./ember-base-configuration.o ./ember-configuration.o ./endian.o ./library.o ./mem-util.o ./message.o ./multi-network.o ./network-cli.o ./option-cli.o ./plugin-cli.o ./print-formatter.o ./print.o ./process-cluster-message.o ./process-global-message.o ./random.o ./security-address-cache.o ./security-cli.o ./serial.o ./service-discovery-common.o ./service-discovery-soc.o ./stack-handler-stub.o ./time-util.o ./token-def.o ./util.o ./zcl-cli.o ./zdo-cli.o ./zigbee-device-common.o ./zigbee-device-library.o   -o "HaContactSensorSoc.out" --config "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0/platform/base/hal/micro/cortexm3/efm32/iar-cfg.icf" --config_def APP_BTL=1 --config_def RAM_RETAIN_SIZE=12K --config_def FLASH_SIZE=262144 --config_def RAM_SIZE=32768 --no_wrap_diagnostics "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/enhanced-beacon-request-stub-library-cortexm3-iar-efr32mg1p-rail/enhanced-beacon-request-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-library-dsa-verify-283k1-stub-cortexm3-iar-efr32mg1p-rail/cbke-library-dsa-verify-283k1-stub.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-stub-library-cortexm3-iar-efr32mg1p-rail/cbke-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/packet-validate-library-cortexm3-iar-efr32mg1p-rail/packet-validate-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/zll-stub-library-cortexm3-iar-efr32mg1p-rail/zll-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-163k1-stub-library-cortexm3-iar-efr32mg1p-rail/cbke-163k1-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/rf4ce-stack-stub-library-cortexm3-iar-efr32mg1p-rail/rf4ce-stack-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/install-code-library-stub-cortexm3-iar-efr32mg1p-rail/install-code-library-stub.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/binding-table-library-cortexm3-iar-efr32mg1p-rail/binding-table-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/hal-library-cortexm3-iar-efr32mg1p-rail/hal-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/security-library-link-keys-stub-cortexm3-iar-efr32mg1p-rail/security-library-link-keys-stub.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/debug-basic-library-cortexm3-iar-efr32mg1p-rail/debug-basic-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/gp-stub-library-cortexm3-iar-efr32mg1p-rail/gp-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-library-dsa-verify-stub-cortexm3-iar-efr32mg1p-rail/cbke-library-dsa-verify-stub.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/security-library-core-cortexm3-iar-efr32mg1p-rail/security-library-core.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/zigbee-pro-leaf-stack-cortexm3-iar-efr32mg1p-rail/zigbee-pro-leaf-stack.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-283k1-stub-library-cortexm3-iar-efr32mg1p-rail/cbke-283k1-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/sim-eeprom1-library-cortexm3-iar-efr32mg1p-rail/sim-eeprom1-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/end-device-bind-stub-library-cortexm3-iar-efr32mg1p-rail/end-device-bind-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/cbke-library-dsa-sign-stub-cortexm3-iar-efr32mg1p-rail/cbke-library-dsa-sign-stub.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/debug-extended-stub-library-cortexm3-iar-efr32mg1p-rail/debug-extended-stub-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//platform/radio/rail_lib/autogen/librail_release/librail_efr32xg1_iar_release.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/mfglib-library-cortexm3-iar-efr32mg1p-rail/mfglib-library.a" "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0//protocol/zigbee_5.9/build/multi-network-stub-library-cortexm3-iar-efr32mg1p-rail/multi-network-stub-library.a" --entry halEntryPoint --map "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0/app/builder/HaContactSensorSoc/IAR ARM - Default/HaContactSensorSoc.map" --log_file "C:/SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v1.0/app/builder/HaContactSensorSoc/IAR ARM - Default/HaContactSensorSoc.log" --log initialization,modules,sections,veneers --diag_suppress=Lp012 --diag_suppress=Lp012 --redirect _Printf=_PrintfSmall --redirect _Scanf=_ScanfFull  

   IAR ELF Linker V7.80.2.11947/W32 for ARM
   Copyright 2007-2016 IAR Systems AB.
Error[Lp011]: section placement failed
            unable to complete "place at" directives with a total estimated minimum size of 0x3c1a bytes in <[0x20000000-0x20002fef]> (total space 0x2ff0).
Error[Lp015]: section placement failure: overcommitted content in [0x20000000-0x20002fef]

  168 926 bytes of readonly  code memory
      528 bytes of readwrite code memory
   49 436 bytes of readonly  data memory
   23 081 bytes of readwrite data memory (+ 156 absolute)

Errors: 2
Warnings: none

Link time:   0.87 (CPU)   1.11 (elapsed)
make: *** [HaContactSensorSoc.out] Error 2

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Genius</font></font> </a> YK
Posts: 8
Registered: ‎02-13-2017

Re: How to make HaContactSensorSoc work on EFR32MG kits?

Can anyone from Silicon Labs support this?

Posts: 5
Registered: ‎06-15-2016

Re: How to make HaContactSensorSoc work on EFR32MG kits?

That error means that your program is too big to fit in the flash on the device.  It looks like you're 3249 bytes over.  The easiest way to save some flash is to disable debug prints or CLI commands that you don't need.  You can do this on the "Printing and CLI" tab in Simplicity Studio.

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Genius</font></font> </a> YK
Posts: 8
Registered: ‎02-13-2017

Re: How to make HaContactSensorSoc work on EFR32MG kits?

I already tried to disable debug prints and CLI commands but still get similar error. Have you suecced to build this example for EFR32?
Posts: 5
Registered: ‎06-15-2016

Re: How to make HaContactSensorSoc work on EFR32MG kits?

I realized that the issue is RAM, not flash.  The problem is the configuration got corrupted when switching from em358x to efr32.  I've filed a bug on this.  In the mean time, the workaround is:

go to the HAL configuration tab

change the selected architecture to em3587

change ram retention to all

change the selected architecture back to the efr32 you have

change the board header back to your board

generate

build

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Genius</font></font> </a> YK
Posts: 8
Registered: ‎02-13-2017

Re: How to make HaContactSensorSoc work on EFR32MG kits?

In the end, I create a blank project to do IAS Zone device from scratch.