3 Replies Latest reply on Sep 13, 2015 2:04 PM by henry.choi

    Who calls initialize_psoc()?

    henry.choi

      Hello, I am ramping up on PSoC4 BLE using PSoC Creator with gnu toolchain (the default).  I generated a blink project using TCPWM, and reading the auto-generated code to understand how the device boots.   I just read AN60616 and currently am reading AN73854, but so far do not understand how the function initialize_psoc(), which configures all registers and sets up clocking, etc is called for the GNU case.  Can anyone shed some light for me please?

        • 1. Re: Who calls initialize_psoc()?
          user_1377889

          In cyboot the configuration data get stored into the configuration registers. Choices in the system tab depending on chip used allow for compressed, uncompressed and DMA transfer. All this is done before main() is called. Cyboot does a rather complex job as starting the clocks up to the defined frequencies and setting the dividers, checking the main clock sources for proper running, setting up the components and lastly setting the IO-pins from hi-z to the defined state and drive modes. All this is done automatically and has nothing to do with your GCC toolchain. Just pre-written Cypress software.

             

           

             

          Bob

          • 2. Re: Who calls initialize_psoc()?
            user_14586677

            You will find this (after a build) in Cm0Start.c -

               

             

               

            /*******************************************************************************
            * Function Name: Reset
            ********************************************************************************
            *
            * Summary:
            *  This function handles the reset interrupt for the RVDS/MDK toolchains.
            *  This is the first bit of code that is executed at startup.
            *
            * Parameters:
            *  None
            *
            * Return:
            *  None
            *

               

             

               

            Regards, Dana.

            • 3. Re: Who calls initialize_psoc()?
              henry.choi

              Thank you Bob and Dana, I was able to answer my own question by looking up the documentation on the constructor gcc attribute, and setting a breakpoint in initialize_psoc() in the debugger.