4 Replies Latest reply on Nov 23, 2020 1:36 AM by BeMb_4626836

    PSoC6 I2C stops working with DFU added

    BeMb_4626836

      Hi.guys

       

      our project works fine when downloaded with SWD to our PCBA.

      We added DFU SDK with UART interface, our application stops at I2C's

      There is a posted discussion with similar issue:

      Re: PSoC 6 I2C Stops Working When DFU SDK Included

       

      Can you provide a code snipet how this issue was addressed.

       

      I did send the same question to Dheeraj and Ganesh

       

      Thanks
      Ben

        • 1. Re: PSoC6 I2C stops working with DFU added
          GaneshD_41

          Hi Ben,

           

          Please check the linker scripts (dfu_cm0p.ld and dfu_cm4.ld) present in the attached code example. In that, please check the space allocated for the FLASH memory and RAM the respective core in which I2C code is placed and adjust them accordingly. For example, CM0+ linker file looks like this:

           

          linker_script.PNG

           

          Please use PDL 3.1.3 to build and program the attached code example.

           

          Thanks

          Ganesh

          • 2. Re: PSoC6 I2C stops working with DFU added
            BeMb_4626836

            Thanks Ganesh,
            I checked the code.

             

            Is the recommendation to use CY_SECTION to allocate flash/RAM to functions with I2C calls?
            Do you have a concrete examples you can share?
            For code you provided, there are no CY_SECTION directives used for functions in "DOWNLOADALE" project (app1);

            There are however a couple in the "LOADER" project (bootloader)

             

             

            Find results for 'CY_SECTION':

            ------------------------------

             

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\dfu_user.c - (line 36, col 1): CY_SECTION(".cy_boot_metadata") __USED

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c - (line 258, col 9):         CY_SECTION(".cy_ramfunc") CY_NOINLINE

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c - (line 349, col 5):     CY_SECTION(".cy_ramfunc") CY_NOINLINE

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c - (line 509, col 9):         CY_SECTION(".cy_ramfunc") CY_NOINLINE

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c - (line 572, col 13):             CY_SECTION(".cy_ramfunc") CY_NOINLINE

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\drivers\peripheral\syspm\cy_syspm.c - (line 2791, col 5):     CY_SECTION(".cy_ramfunc") CY_NOINLINE

            C:\Users\benmb\Documents\partners\cypress\Projects\DFU\DFU_UART_SINGLE_APP_I2C.cywrk.Archive01\DFU_UART_SINGLE_APP\LOADER.cydsn\Generated_Source\PSoC6\pdl\dfu\cy_dfu.c - (line 22, col 1): CY_SECTION(".cy_boot_noinit.appId") __USED static uint8_t cy_dfu_appId;

            • 3. Re: PSoC6 I2C stops working with DFU added
              GaneshD_41

              Hi Ben,

               

              Is the recommendation to use CY_SECTION to allocate flash/RAM to functions with I2C calls?

              No actually. You just have to ensure that proper flash area is allocated for the CM0+ and CM4 cores.

               

              The I2C used in the code example is fixed function I2C. So the registers of that particular I2C block is present in peripheral memory address space. There is no need to place the code corresponding to I2C in a separate section. In case you want to store some data in flash you can create a section for that data and use Emulated EEPROM component to store the data in that flash.

               

              Can you please attach your project (which is not working with I2C and UDB)? I will check it here once and get back to you with changes required.

               

              Thanks

              Ganesh

              • 4. Re: PSoC6 I2C stops working with DFU added
                BeMb_4626836

                Hi Ganesh,
                thanks for your feedback.

                 

                 

                My project is pretty large though.
                I have attached a couple of file where we are having the DFU/I2C issues.
                We have some screen files as data and use I2C to render the touchscreen data.
                We store this data in the internal flash and also have I2C talks in the internal flash.thin

                 

                Everything works when downloaded with SWD, but stops at I2C when downloaded with DFU/UART

                 

                 

                Thanks

                Ben