2 Replies Latest reply on Apr 16, 2019 2:59 AM by RaktimR_11

    humidity and temp tutorial 101

    alorc_4110946

      Can the CYW94343WWCD1_EVB do the tutorial 101 demo for humidity and temperature or is it specified for certain platforms?

        • 1. Re: humidity and temp tutorial 101
          alorc_4110946

          What I have done interms of mK, c, and the error follows. I am able to build and download many of the other programs in the tutorial.

           

          ww101.02.07_i2cread-CYW94343WWCD1_EVB download run

          07_i2cread.mk

          NAME := apps_ww101_02_07_i2cread

           

          $(NAME)_SOURCES := 07_i2cread.c

          07_i2cread.c

           

          #include "wiced.h"

           

          #define I2C_ADDRESS (0x42)

           

          #define TEMPERATURE_REG 0x07

           

          volatile wiced_bool_t buttonPress = WICED_FALSE;

           

           

          void button_isr(void* arg)

          {

          buttonPress = WICED_TRUE;

           

          }

           

           

          void application_start()

          {

          wiced_init();

           

           

          wiced_gpio_input_irq_enable(WICED_BUTTON1, IRQ_TRIGGER_FALLING_EDGE, button_isr, NULL);

           

          const wiced_i2c_device_t i2cDevice = {

                      .port = WICED_I2C_1,

                      .address = I2C_ADDRESS,

                      .address_width = I2C_ADDRESS_WIDTH_7BIT,

                      .speed_mode = I2C_STANDARD_SPEED_MODE

          };

           

           

          wiced_i2c_init(&i2cDevice);

           

           

          u_int8_t tx_buffer[] = {TEMPERATURE_REG};

           

           

          struct {

          float temp;

          float humidity;

          float light;

          float pot;

          }

           

          rx_buffer;

           

           

          wiced_i2c_write(&i2cDevice, WICED_I2C_START_FLAG | WICED_I2C_STOP_FLAG, tx_buffer, sizeof(tx_buffer));

           

          while(1)

          {

           

          if(buttonPress)

          {

                      wiced_i2c_read(&i2cDevice, WICED_I2C_START_FLAG | WICED_I2C_STOP_FLAG, &rx_buffer, sizeof(rx_buffer));

                      WPRINT_APP_INFO(("TEMPERATURE: %.1f\t Humidity: %.1f\t Light: %.1f\t Pot: %.1f\n", rx_buffer.temp, rx_buffer.humidity, rx_buffer.light, rx_buffer.pot));

           

                      buttonPress = WICED_FALSE;

          }

          }

          }

           

           

           

          Error

          09:13:13 **** Build of configuration Default for project 43xxx_Wi-Fi ****

          "C:\\Users\\Al\\Documents\\WICED-Studio-6.2\\43xxx_Wi-Fi\\make.exe" ww101.02.07_i2cread-CYW94343WWCD1_EVB download run

          MAKEFILE MAKECMDGOALS=ww101.02.07_i2cread-CYW94343WWCD1_EVB download run OTA2_SUPPORT is disabled

          Building Bootloader

          Building Serial Flash Loader App

          MAKEFILE MAKECMDGOALS=waf.sflash_write-NoOS-CYW94343WWCD1_EVB-SDIO OTA2_SUPPORT is disabled

          Applying changes made to: tools/makefiles/wiced_config.mk

          +-----------------------------------------------------------------------------------------------------+

          | IMPORTANT NOTES |

          +-----------------------------------------------------------------------------------------------------+

          | Wi-Fi MAC Address |

          | The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

          | Ensure each target device has a unique address. |

          +-----------------------------------------------------------------------------------------------------+

          | MCU & Wi-Fi Power Save                                                                              |

          | It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

          | reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

          | Application Note located in the documentation directory if you plan to use powersave features.   |

          +-----------------------------------------------------------------------------------------------------+

          +-----------------------------------------------------------------------------------------------------+

          | IMPORTANT NOTES |

          +-----------------------------------------------------------------------------------------------------+

          | Wi-Fi MAC Address |

          | The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt                 |

          | Ensure each target device has a unique address. |

          +-----------------------------------------------------------------------------------------------------+

          | MCU & Wi-Fi Power Save                                                                              |

          | It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz |

          | reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave   |

          | Application Note located in the documentation directory if you plan to use powersave features.   |

          +-----------------------------------------------------------------------------------------------------+

          1. waf.sflash_write-NoOS-CYW94343WWCD1_EVB-SDIO

          ----------------------------------|---------|

                                            |  Static |

                        Module              |   RAM |

          ----------------------------------+---------|

          App                               |   21130 |

          Host MCU-family library           | 11604 |

          Interrupt Vectors                 |     388 |

          libc                              |     556 |

          platform                          |    1104 |

          Ring_Buffer                       |      40 |

          SPI_Flash_Library_CYW94343WWCD1_EV|     936 |

          Startup Stack & Link Script fill  |     486 |

          WWD                               |     188 |

          ----------------------------------+---------|

          TOTAL (bytes)                     |   36432 |

          ----------------------------------|---------|

           

          Build complete

          Finished Building Bootloader

           

          Finished Building Serial Flash Loader App

          Making ww101.02.07_i2cread-CYW94343WWCD1_EVB.elf

           

          build/ww101.02.07_i2cread-CYW94343WWCD1_EVB/libraries/STM32F4xx.a(wiced_platform_common.o): In function `wiced_i2c_read':

          C:\Users\Al\Documents\WICED-Studio-6.2\43xxx_Wi-Fi/WICED/platform/MCU/STM32F4xx/../wiced_platform_common.c:287: undefined reference to `platform_i2c_read'

          build/ww101.02.07_i2cread-CYW94343WWCD1_EVB/libraries/STM32F4xx.a(wiced_platform_common.o): In function `wiced_i2c_write':

          C:\Users\Al\Documents\WICED-Studio-6.2\43xxx_Wi-Fi/WICED/platform/MCU/STM32F4xx/../wiced_platform_common.c:303: undefined reference to `platform_i2c_write'

          collect2.exe: error: ld returned 1 exit status

          tools/makefiles/wiced_elf.mk:315: recipe for target 'build/ww101.02.07_i2cread-CYW94343WWCD1_EVB/binary/ww101.02.07_i2cread-CYW94343WWCD1_EVB.elf' failed

          1. make.exe[1]: *** [build/ww101.02.07_i2cread-CYW94343WWCD1_EVB/binary/ww101.02.07_i2cread-CYW94343WWCD1_EVB.elf] Error 1

          Makefile:351: recipe for target 'main_app' failed

          make: *** [main_app] Error 2

           

          09:13:29 Build Finished (took 16s.380ms)

          • 2. Re: humidity and temp tutorial 101
            RaktimR_11

            That application is meant for a PSoC AFE shield and for CYW943907AEVAL1F platform. CYW94343WWCD1 does not have provision for a Arduino Shield, hence the application does not really work out of the box. You can connect an i2c sensor separately through J7 header and modify the code accordingly. Please let me know if you need any help in that.

            1 of 1 people found this helpful