Infineon / CY8CKIT-028-SENSE

The Sense Shield Board (CY8CKIT-028-SENSE) has been designed as a companion to add common sensors, audio components and user interface to an Arduino based baseboard.
Apache License 2.0
0 stars 1 forks source link

Example code not working as expected #1

Closed pongchileong closed 4 months ago

pongchileong commented 8 months ago

Prerequisites

Can you reproduce the problem reliably? Yes Did you check current release notes for known issues? Yes If this is not the latest release, have you checked newer releases? It is latest release Description: Example code is unable to build as per instructions in link. A clear and concise description of what the bug is. Need to add emWIN library and changes to Makefile Steps to Reproduce: Follow instructions in link.

Expected Result:

Actual Result: Failed to build

Frequency (1/1, 1/50, 1/100): NA

Build/Commit: NA Please specify the release, like 1.4.1. If there is no release, give us the commit for the code you used.

Target:

The chip or kit you are working with CY8cKIT-062S2-43012 + CY8CKIT-028-SENSE Host OS and Version:

MacOS, Windows, Linux Windows Compiler: MTB 3.1 Include the version!

Environment

Provide the context surrounding this problem. Perhaps an IDE, a debug probe, an RTOS, etc. (and versions)

Add CY8CKIT-028-SENSE and emWIN library

Add to Makefile COMPONENTS+=EMWIN_NOSNTS LDFLAGS+=-u _printf_float

Changes to original main.c /***

/***

/***

/***

/***

/***

if defined (CY_DEVICE_SECURE)

cyhal_wdt_t wdt_obj;

/* Clear watchdog timer so that it doesn't trigger a reset */
result = cyhal_wdt_init(&wdt_obj, cyhal_wdt_get_max_timeout_ms());
CY_ASSERT(CY_RSLT_SUCCESS == result);
cyhal_wdt_free(&wdt_obj);

endif

/* Initialize the device and board peripherals */
result = cybsp_init();

/* Board init failed. Stop program execution */
if (result != CY_RSLT_SUCCESS)
{
    CY_ASSERT(0);
}

/* Initialize the I2C to use with the OLED display */
result = cyhal_i2c_init(&i2c_obj, CY8CKIT_028_SENSE_PIN_I2C_SDA, CY8CKIT_028_SENSE_PIN_I2C_SCL, NULL);
CY_ASSERT(result == CY_RSLT_SUCCESS);

result = cyhal_i2c_configure(&i2c_obj, &i2c_cfg);
CY_ASSERT(result == CY_RSLT_SUCCESS);

xensiv_dps3xx_t* pressure_sensor = cy8ckit_028_sense_get_pressure_sensor();

/* Initialize pressure sensor */
//result = cy8ckit_028_sense_init(&i2c_obj, NULL, NULL, NULL, NULL);
result = xensiv_dps3xx_mtb_init_i2c(pressure_sensor, &i2c_obj, XENSIV_DPS3XX_I2C_ADDR_DEFAULT);
CY_ASSERT(result == CY_RSLT_SUCCESS);

//    /* Initialize the OLED display */
result = mtb_ssd1306_init_i2c(&i2c_obj);
CY_ASSERT(result == CY_RSLT_SUCCESS);

/* Enable global interrupts */
__enable_irq();

GUI_Init();

for (;;)
{
    /* Get the pressure and temperature data and print the results to the OLED display */
    xensiv_dps3xx_read(pressure_sensor, &pressure, &temperature);

// GUI_DispString("Pressure: %f, Temp: %f", pressure, temperature); GUI_GotoXY(0,0); sprintf(buf,"Pressure: %4.2f",pressure); GUI_DispString(buf); GUI_GotoXY(0,10); sprintf(buf,"Temp: %2.2f",temperature); GUI_DispString(buf);

    cyhal_system_delay_ms(1000);
}

}

/ [] END OF FILE /

THANKS!
Daniyal-Shaikh-15 commented 4 months ago

Hey @pongchileong,

Recently there is a release of new version(1.1.0 ) of"CY8CKIT-028-SENSE" library. I tried recreating your issue from my end, I did not face any build error while recreating.

The following conditions were checked with the code you provided:

  1. We tested using both the 1.0.0 version (old version) and new latest release 1.1.0 version of "CY8CKIT-028-SENSE" library by keeping the latest version(6.32.0) of "emwin" and did not face any build issue.

I would suggest you to retry building your project using the steps mentioned in "CY8CKIT-028-SENSE shield support library" and also try using the latest version of "CY8CKIT-028-SENSE" and "emwin" library in your project.

If your build error prevails then please do attach the screenshots of build error or the error log.

Hope this resolves your issue.

Thanks and Regards, Daniyal Shaikh

pongchileong commented 4 months ago

Hi Daniyal Shaikh,

I tried the new release and example code and it works as expected.

Thanks for following up.

Regards, Pong Chi Leong